Extract the ith connex component a network graph.
[gc] = NARVAL_G_GraphConnexInd(g,nc,compo,ic)
network graph.
size vector of each connex component.
vector of nodes per connex component.
index of the selected connected set.
output network graph.
NARVAL_G_GraphConnexInd extracts the connex component of index ic of the network graph g. compo represents a vector composed by ordered nodes of each connex component and nc gives their size. They can be performed with the function NARVAL_G_Connex. In fact, the first connex component has a size of nc(1). Thus it is composed by nodes compo(1:nc(1)). Afterwards the second connex component has a size of nc(2). Thus it is composed by nodes compo(nc(1)+1:nc(1)+1+nc(2)), etc. Thus we have nc=[nc(1),nc(2),..,nc(s)] and compo=[NC1{1:nc(1)},NC2{1:nc(2)},..,NCS{1:nc(s)}] with NCi=compo(1+nc(1)+nc(2)+...+nc(i-1):1+nc(1)+nc(2)+...+nc(i)). As a matter of course a network must be connex as its nodes should be reachable from its structure.
n=50;//network size L=1000;//network square area side dmax=100;//locality radius [g]=NARVAL_T_Locality(n,L,dmax);//generation of a random topology in respect with the Locality method. ind=1;//window index f=NARVAL_G_ShowGraph(g,ind);//graph visualization [nc,compo]=NARVAL_G_Connex(g);//extraction of connex parameters inf=find(nc>2);//selection of component composed by more than 2 nodes for j=1:length(inf) [gc]=NARVAL_G_GraphConnexInd(g,nc,compo,inf(j));//application of NARVAL_G_GraphConnexInd f=NARVAL_G_ShowGraph(gc,j+ind);//graph visualization f.figure_name=gc.name + string(j); end | ![]() | ![]() |
Dr. Foued Melakessou
Research Associate
Interdisciplinary Centre for Security, Reliability and Trust
Room F106
University of Luxembourg
6, rue Coudenhove Kalergi
L-1359 Luxembourg-Kirchberg
E-mail: foued.melakessou@uni.lu
Tel: (+352) 46 66 44 5346