Extract the shortest path between two network nodes in respect with the Floyd-Warshall algorithm performance.
[p]=NARVAL_R_FloyWarshallP(Path,Next,i,j)
matrix of path length between two network nodes.
matrix of successor nodes.
source node.
destination node.
path.
NARVAL_R_FloydWarshallP finds the shortest path between two nodes (i,j) of the graph g. Path(i,j) provides the total length of the shortest path between the nodes i and j. Next(i,j) provides an intermediate node that should be crossed in order to reach j from i in respect with the shortest path. They are generated by RoutingFloydWarshall.
[path]=NARVAL_F_NARVALPath();//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]=NARVAL_R_FloydWarshall(g);//Application of the Floyd-Warshall algorithm n=length(g.node_x); [i,j]=NARVAL_F_Random_i_j(n);//generation of extremal connection nodes [p]=NARVAL_R_FloydWarshallP(Path,Next,i,j);//Application of NARVAL_R_FloyWarshallP p | ![]() | ![]() |