Highlight the leaves of a tree (BFS,BFSW,DFS,DFSW).
[gl] = NARVAL_G_TreeLeaves(g,s,pred,d,sc,sb,sd,ac,ab,ad,lc,lb,ld,ec,ew)
network graph.
sink.
vector composed by the predecessor of each node in order to reach the sink.
aggregation matrix.
sink color.
sink border.
sink diameter.
aggregator color.
aggregator border.
aggregator diameter.
leaf color.
leaf border.
leaf diameter.
tree edge color.
tree edge width.
output graph.
NARVAL_G_TreeLeaves highlights the leaves of a tree (BFS,BFSW,DFS,DFSW) extracted from the graph g. The sink of the tree is s. The predecessor vector pred generated by BFS, BFSW, DFS or DFSW algorithms applied in s is needed. d is a matrix (n,n+1) if the graph is composed by n nodes. We assume that each graph node forwards a packet towards the sink according to the path performed in respect with the predecessor vector pred. We store in each line of index i of d the source node of all packets that have crossed the node i to reach the sink. The visualization highlights the tree components, e.g. the sinks (color: sc, border: sb, diameter: sd), the aggregators (color: ac, border: ab, diameter: ad) and the leaves (color: lc, border: lb, diameter: ld). The edges of the tree are also displayed with the color ec and the width ew. The output graph is stored in gl.
n=100;//network size L=1000;//network squared area side r=150;//Locality radius [g]=NARVAL_T_LocalityConnex(n,L,r);//generation of a topology w=1;//window index f=NARVAL_G_ShowGraph(g,w);//graph visualization n=g.node_number;//real network size sink=NARVAL_F_Random(n);//selection of the sink dw=5;//visualization parameter ind=1;//window index [gBFS,VBFS,predBFS]=NARVAL_R_BFS(g,sink,dw,ind);//tree building dist=ones(1,g.node_number);//distance vector dist(sink)=100000000; [dataBFS]=NARVAL_R_AggregationTree(predBFS,dist,sink);//generation of the aggregation matrix sc=2;//visualization parameters sb=10; sd=40; ac=1; ab=3; ad=30; lc=5; lb=10; ld=20; ec=2; ew=3; [gl]=NARVAL_G_TreeLeaves(g,sink,predBFS,dataBFS,sc,sb,sd,ac,ab,ad,lc,lb,ld,ec,ew);//application of NARVAL_G_AggregationLeaf i2=2;//window index ft=NARVAL_G_ShowGraph(gl,i2);//graph visualization | ![]() | ![]() |
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