A.3 THE FLOYD-WARSHALL ALGORITHM
The Floyd-Warshall algorithm is an all-points shortest path algorithm. If no negative cycles exist in the graph, the algorithm finds the shortest path between all possible pairs of nodes in the graph. The algorithm constructs n + 1 matrices (k), k = 1, 2, … , n + 1, which are each of size n × n, as described in Figure A.4.
If TRUE is returned, then r(n+1)(U, V) is SUV , which is the shortest path from the node U to the node V. If FALSE is returned, then the graph contains a negative cycle.
Get VLSI Digital Signal Processing Systems: Design and Implementation now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.