Extract the connex component a graph.
[Go] = NL_G_GraphConnexPartI(G,N,C,I)
Graph.
Size vector of each connex component.
Vector of nodes per connex component.
Index of the selected connected set.
Output network graph.
NL_G_GraphConnexPartI extracts the connex component of index I of the graph G. C represents a vector composed by ordered nodes of each connex component and N gives their size. They can be performed with the function NL_G_Connex. In fact, the first connex component has a size of . Thus it is composed by nodes
. Afterwards the second connex component has a size of
. Thus it is composed by nodes
, etc. Thus we have
and
with
.
n=50;//network size L=1000;//network square area side dmax=100;//locality radius [g]=NL_T_Locality(n,L,dmax);//generation of a random topology in respect with the Locality method. ind=1;//window index f=NL_G_ShowGraphN(g,ind);//graph visualization [nc,compo]=NL_G_ConnexComponent(g);//extraction of connex parameters inf=find(nc>2);//selection of component composed by more than 2 nodes for j=1:length(inf) [gc]=NL_G_GraphConnexPartI(g,nc,compo,inf(j));//application of NL_G_GraphConnexPartI f=NL_G_ShowGraphN(gc,j+ind);//graph visualization f.figure_name=gc.name + string(j); end | ![]() | ![]() |