<< NL_G_LoadGraphNE NL_G: Graph NL_G_MakeGraph >>

NARVAL >> NL_G: Graph > NL_G_LocalClustering

NL_G_LocalClustering

Perform the local clustering of the k-degree nodes of a graph.

Calling Sequence

[I,N,C] = NL_G_LocalClustering(G,K)

Arguments

G :

Graph.

K :

Node degree.

I :

Index of the k-degree nodes.

N :

Vector with the number of links between neighbors of the k-degree nodes.

C :

Local clustering.

Description

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).

Examples

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

Dependency

NL_G_GraphDegreeDist, NL_G_NodeNeighbors, NL_G_InternalLinks

Report an issue
<< NL_G_LoadGraphNE NL_G: Graph NL_G_MakeGraph >>