<< NL_R_FloydWarshall NL_R: Routing NL_R_MultiPathERT >>

NARVAL >> NL_R: Routing > NL_R_FloydWarshallPath

NL_R_FloydWarshallPath

Extract the shortest path between two network nodes in respect with the Floyd-Warshall algorithm.

Calling Sequence

[P] = NL_R_FloyWarshallPath(L,N,I,J)

Arguments

L :

Matrix of path length between two network nodes.

N :

Matrix of successor nodes.

I :

Source node.

J :

Destination node.

P :

Path.

Description

NL_R_FloydWarshallPath finds the shortest path between the two nodes (I,J) of the graph G (WIKIPEDIA). L(I,J) provides the total length of the shortest path between the nodes I and J. N(I,J) gives the intermediate node that should be crossed in order to reach the node J from the node I in respect with the shortest path. They are generated by NL_R_FloydWarshall.

Examples

[path]=NL_F_NLPath();//path to NARVAL module
path=path+'/demos/';//folder path
load(path+'topo_100.graph');//loading of the network graph
load(path+'RoutingTables_topo_100.dat','pt','rt1','rt2','rt3','rt4','rt5');//loading of the network routing tables
[Path,Next]=NL_R_FloydWarshall(g);//Application of the Floyd-Warshall algorithm
n=length(g.node_x);
[i,j]=NL_F_RandIntNiNj(n)//generation of extremal connection nodes
[p]=NL_R_FloydWarshallPath(Path,Next,i,j)//application of NL_R_FloyWarshallPath

Dependency

NL_G_NodeNeighbors

Report an issue
<< NL_R_FloydWarshall NL_R: Routing NL_R_MultiPathERT >>