Proof of Correctness of Ford-Fulkerson Algorithm
The Ford-Fulkerson algorithm finds maximum flows by iteratively augmenting along paths in the residual graph. We prove its correctness and termination for integer capacities.
Algorithm and Statement
Given a flow network with integer capacities, the Ford-Fulkerson algorithm terminates in at most iterations (where is the max flow value) and returns a maximum flow. With BFS augmenting paths (Edmonds-Karp variant), termination is guaranteed in augmentations even for irrational capacities.
Proof
Algorithm description. Start with for all . Repeat: find an - path in the residual graph ; augment along by the bottleneck capacity . Stop when no - path exists in .
Invariant: is a valid flow after each augmentation. Initially is valid. Augmenting along : for forward edges , increase by ; for backward edges, decrease by . The capacity constraint holds because ensures and . Flow conservation holds because augmentation changes inflow and outflow at each internal vertex by equal amounts ( in and out along the path).
Monotonicity. Each augmentation increases by . For integer capacities, , so increases by at least 1 per iteration. Since , termination occurs in at most iterations.
Optimality at termination. When the algorithm terminates, no - path exists in . As shown in the max-flow min-cut proof: define . Then . By weak duality, max flow min cut . So is the max flow.
Edmonds-Karp bound. When augmenting paths are chosen by BFS (shortest paths in ): the distance in is non-decreasing after each augmentation (key lemma, proved by considering how the residual graph changes). Each augmenting path saturates at least one edge (the bottleneck), and a saturated edge can only reappear after increases by at least 2. Since distances are at most , each edge is saturated at most times, giving at most augmentations total. Each BFS takes , so total time is .
Improved bound: More careful analysis shows augmentations suffice for Edmonds-Karp.
Ford-Fulkerson with arbitrary path selection may not terminate when capacities are irrational. The Ford-Fulkerson counterexample (due to Zwick) uses a network where alternating augmentations increase the flow by geometrically decreasing amounts (where ), converging to a non-maximum flow. BFS path selection (Edmonds-Karp) avoids this issue.
- Ford-Fulkerson (DFS): (pseudo-polynomial)
- Edmonds-Karp (BFS): (polynomial)
- Dinic's algorithm:
- Push-relabel: or
- Orlin's algorithm: (optimal for dense graphs)