# NOT RUN {
######################################################
# Finding the representative elements of the clusters
######################################################
# 1st: create data (not perturbed graph)
Data <- CreateDataSet(k=3, n=20, p=list(p_inside=0,p_outside=0))
# 2nd: find the structure of the graph
Structure <- FindStructure(Data$A_hat)
# 3rd: find the optimal number of clusters (here, 3 clusters)
Clusters <- FindNbrClusters(A = Data$A_hat, structure = Structure, k=3)
# 4th: find the representative elements of the clusters
Elements <- FindElement(A = Data$A_hat, structure = Structure, clusters = Clusters)
# if elements is not provided, the representative elements of each component are chosen
# by maximizing the edge betweenness score
Elements <- FindElement(A = Data$A_hat, structure = Structure,
clusters = Clusters, elements = c(1,5,12))
# }
Run the code above in your browser using DataLab