Skip to content
All tags

#shortest-path

2 posts

Stanford CS161 Lecture 11: Dijkstra, Bellman-Ford, and Two Orders of Relaxation

Dijkstra finalizes the minimum estimate and relies on nonnegative weights; Bellman-Ford repeatedly relaxes every edge, spending O(nm) to support negative edges and detect a negative cycle reachable from the source.

Stanford CS161 Lecture 12: Dynamic Programming with Bellman–Ford and Floyd–Warshall

Dynamic programming starts by defining subproblems, derives a recurrence from optimal substructure, and evaluates states in dependency order; Bellman–Ford layers by edge count, while Floyd–Warshall layers by allowed intermediate vertices.