Graph Theory37 sections · 1633 units
Open in Course

Variants of Floyd-Warshall

(Minimax and maximin paths)

Floyd-Warshall can solve related problems by changing the update rule. Minimax path: replace min\min with max\max and addition with min\min to find paths where the maximum edge is minimized. Maximin path: replace min\min with max\max and addition with max\max to find paths where the minimum edge is maximized.

The same O(n3)O(n^3) structure solves different improvement problems. This shows the power of the dynamic programming formulation.

Space complexity is O(n2)O(n^2) for the data structures used.