Extract the shortest path between two network nodes in respect with the Floyd-Warshall algorithm.
[P] = NL_R_FloyWarshallPath(L,N,I,J)
Matrix of path length between two network nodes.
Matrix of successor nodes.
Source node.
Destination node.
Path.
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.
[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 | ![]() | ![]() |