<< NL_R_ARCTrafficPlot NL_R: Routing NL_R_AggregationWCDS >>

NARVAL >> NL_R: Routing > NL_R_AggregationTree

NL_R_AggregationTree

Perform the data aggregation on each node of a graph (Tree).

Calling Sequence

[R] = NL_R_AggregationTree(P,D,S)

Arguments

P :

Predecessor vector.

D :

Distance vector.

S :

Sink.

R :

Output data.

Description

NL_R_AggregationTree performs the data aggregation R (all information from its children) on each node of the graph defined by the predecessor vector P generated by the Bellman-Ford algorithm, the Dijkstra's algorithm, BFS, DFS or the Prim's algorithm applied in the sink node S. The graph is assumed to be composed by n nodes. R is a matrix (n,n+1). We assume that each graph node forwards a packet towards the sink in respect with the path performed in respect with the predecessor vector P. We store in each line of index i within R the source node of all packets that have crossed the node i to reach the sink. Thus R gives the relevant information about the location where it is preferable to aggregate packets in constrained environments.

Examples

n=100;//network size
L=1000;//network squared area side
r=150;//Locality radius
[g]=NL_T_LocalityConnex(n,L,r);//generation of a topology
st=[1 17 5 6 2 3];//style
w=1;//window index
f=NL_G_ShowGraph(g,w);//graph visualization
n=g.node_number;//quantity of nodes
sink=NL_F_RandInt1n(n);//selection of the sink
ind=2;//window index
dw=5;//display parameter
[gBFS,VBFS,predBFS]=NL_R_BFSPlot(g,sink,dw,ind);//performance of the BFS algorithm
dist=ones(1,g.node_number);//distance vector used in NARVAL_R_AggregationTree 
dist(sink)=100000000;//initialization of the value for the sink
[dataBFS]=NL_R_AggregationTree(predBFS,dist,sink);//application of NL_R_AggregationTree
ip=3;//window index
ymax=max([dataBFS(:,$)]);//graph visualization
scf(ip);
clf(ip);
plot2d(1:n,dataBFS(:,$)',style=st(1),rect=[1 0 n ymax]);
plot2d3(1:n,dataBFS(:,$)',style=st(1),rect=[1 0 n ymax]);
xtitle('BFS','Sensor ID','Aggregation Level','');
xgrid(1);

Dependency

NL_F_RemoveFirstOcc, NL_R_PredecessorRoute

Report an issue
<< NL_R_ARCTrafficPlot NL_R: Routing NL_R_AggregationWCDS >>