<< NL_R_FloodInitialization NL_R: Routing NL_R_FloodRT >>

NARVAL >> NL_R: Routing > NL_R_FloodIteration

NL_R_FloodIteration

Perform the topology discovery propagation of the Flood algorithm.

Calling Sequence

[M,N] = NL_R_FloodIteration(G,I,J,M,N)

Arguments

G :

Graph.

I :

Source node.

J :

Destination node.

M :

Discovery packet storage matrix.

N :

Quantity of discovery packets.

Description

NL_R_FloodIteration propagates discovery packets of the Flood algorithm on the graph G emitted from the source node I towards the destination node J.

The set of candidate routes is stored into the matrix M ([route|arrival|TTL|route length]). The current quantity of discovery packets rates N.

Examples

n=100;//network size
L=1000;//network square area side
dmax=100;//locality radius
[g]=NL_T_LocalityConnex(n,L,dmax);//generation of a random topology in respect with the Locality method. 
nl=length(g.head);//quantity of network links
nf=length(g.node_x);//real network size
[ne nr]=NL_F_RandIntNiNj(nf)//selection of the source and destination nodes
TTL=10;//initialization of TTL
[m,np]=NL_R_FloodInitialization(g,ne,nr,TTL);//application of NL_R_FloodInitialization
[m,np]=NL_R_FloodIteration(g,ne,nr,m,np)//application of NL_R_FloodIteration
EC=ones(1,nl);//edge color
EB=2*ones(1,nl);//edge width
D=5*ones(1,nf);//node border
D(ne)=10;
v=[];//display the first step of the flood
for i=1:np
v=[v NL_G_Nodes2Path(m(i,1:2),g)];
end
[v]=unique(v);//remove duplicated values
EC(v)=5;
EB(v)=3;
D(m(:,2)')=8
v=[];//display the second step of the flood
for i=1:np
v=[v NL_G_Nodes2Path(m(i,2:3),g)];
end
[v]=unique(v);//remove duplicated values
EC(v)=2;
EB(v)=4;
D(m(:,3)')=6;
g.node_border=D;
g.edge_color=EC;
g.edge_width=EB;
ind=1;//window index
f=NL_G_ShowGraphN(g,ind);//graph visualization

Dependency

NL_G_NodeNeighbors, NL_F_DistanceNiNj

Report an issue
<< NL_R_FloodInitialization NL_R: Routing NL_R_FloodRT >>