Maximum Flow
Find augmenting paths in a residual network, push each bottleneck, and use reverse edges to reroute flow.
Core idea
A residual network records how much more flow can move forward and how much previous flow can be canceled backward. Each augmenting path pushes its smallest residual capacity.
Read the visualization
Edge labels show flow over capacity. The active path is highlighted before its bottleneck is added, and reverse residual choices preserve the ability to reroute earlier decisions.
Initialize every network edge with zero flow and its full residual capacity.
Complexity and tradeoffs
Time: O(EF) for integer Ford-Fulkerson. Space: O(V+E). The bound depends on maximum flow F; Edmonds-Karp or Dinic gives stronger path-selection guarantees.
Where it fits
Maximum flow solves transport capacity, bipartite matching, image segmentation, and many disjoint-path problems. The final unreachable boundary also identifies a minimum cut.