Perform the local clustering of the k-degree nodes of a graph.
[I,N,C] = NL_G_LocalClustering(G,K)
Graph.
Node degree.
Index of the k-degree nodes.
Vector with the number of links between neighbors of the k-degree nodes.
Local clustering.
NL_G_LocalClustering performs the local clustering C of the K-degree nodes within the graph G. If is the average number of links between the neighbors of k-degree nodes, the local clustering C is the ratio of this number to the maximum possible such links:
. If two neighbors of a node are connected, then these three nodes form together a triangle (3-cycle). Thus the local clustering corresponds to the average number of 3-cycles involving k-degree nodes (WIKIPEDIA).
n=300;//network size l0=5;//a maximum of 5 links are created for each new node L=1000;//network square area side [g,dd]=NL_T_BarabasiAlbert(n,l0,L);//generation of the topology ind=1;//window index [f]=NL_G_ShowGraph(g,ind);//graph visualization [d,dv]=NL_G_GraphDegreeDist(g);//extraction of the node degree distribution m=max(dv);//maximum degree LCv=[]; for i=2:m [ik,LN,LC]=NL_G_LocalClustering(g,i);//application of NL_G_LocalClustering LCv=[LCv LC]; end LCv | ![]() | ![]() |