Perform the topology discovery propagation of the Flood algorithm.
[M,N] = NL_R_FloodIteration(G,I,J,M,N)
Graph.
Source node.
Destination node.
Discovery packet storage matrix.
Quantity of discovery packets.
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.
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 | ![]() | ![]() |