Extract the shortest path between two network nodes in respect with the Floyd-Warshall algorithm performance.
[p]=RoutingFloyWarshallPath(Path,Next,i,j)
matrix of path length between two network nodes.
matrix of successor nodes.
source node.
destination node.
path.
RoutingFloydWarshallPath 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.
load('./demos/RoutingTables_topo_100_1.dat');//loading of the network routing tables g=load_graph('./demos/topo_100_1.graph');//loading of the network graph [g]=EdgeLength(g); [Path,Next]=RoutingFloydWarshall(g);//Application of the Floyd-Warshall algorithm n=length(g.node_x); [i,j]=Random_i_j(n);//generation of extremal connection nodes [p]=RoutingFloydWarshallPath(Path,Next,i,j);//Application of RoutingFloyWarshallPath p | ![]() | ![]() |