Perform the initialization of the Flood algorithm.
[M,N] = NL_R_FloodInitialization(G,I,J,T)
Graph.
Source node.
Destination node.
Discovery radius (Packet Time-To-Live).
Discovery packet storage matrix.
Quantity of discovery packets on the network.
NL_R_FloodInitialization initializes the Flood algorithm from the source node I on the graph G in order to find multiple paths towards the destination node J.
The research is limited by the maximal quantity of nodes T that a discovery packet can cross before its rejection by the network. The set of possible 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 v=[];//display the first step of the flood for i=1:np v=[v m(i,1:2)]; end pr=NL_G_Nodes2Path(v,g); EC=ones(1,nl);//edge color EB=2*ones(1,nl);//edge width EC(pr)=5; EB(pr)=4; D=5*ones(1,nf);//node border D(ne)=10; g.node_border=D; g.edge_color=EC; g.edge_width=EB; ind=1;//window index f=NL_G_ShowGraphN(g,ind);//graph visualization | ![]() | ![]() |