A.2 THE BELLMAN-FORD ALGORITHM
The Bellman-Ford algorithm is a single-point shortest path algorithm. If no negative cycles exist in the graph, it finds the shortest path from an arbitrarily chosen node U (called the origin) to each node in the graph. For a graph with n nodes, the algorithm constructs n − 1 vectors r(k), k = 1, 2, … , n − 1, which are each of size n × 1, as described in Figure A.2. Note that r(k) (U) represents the U-th entry in the column vector r(k).
If TRUE is returned, then r(n−1)(V) is SUV , which is the shortest path from the node U to the node V. If FALSE is returned, then the graph contains at least one 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.