<< NL_R_DijkstraRT NL_R: Routing NL_R_FloodInitialization >>

NARVAL >> NL_R: Routing > NL_R_Flood

NL_R_Flood

Perform the shortest path between two network nodes in respect with the Flood algorithm.

Calling Sequence

[P] = NL_R_Flood(G,I,J,T)

Arguments

G :

Graph.

I :

Source node.

J :

Destination node.

T :

Flood Time-To-Live.

P :

Shortest path.

Description

NL_R_Flood calculates the shortest path between the source node I and the destination node J of the graph G.

Examples

n=80;//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.
N=length(g.node_x);//real network size
nl=length(g.head);//quantity of network links
[ne,nr]=NL_F_RandIntNiNj(N)//selection of two distinct nodes
TTL=10;//Time-To-Live update
[path]=NL_R_Flood(g,ne,nr,TTL)//application of NL_R_Flood
p=NL_G_Nodes2Path(path,g);//links of the shortest path
EC=ones(1,nl);//display the path between i and j: edge color
EB=2*ones(1,nl);//edge width
EC(p)=5;
EB(p)=5;
D=5*ones(1,N);//node border
D(path)=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

Dependency

NL_R_FloodInitialization, NL_R_FloodIteration

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