ProofComplete

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

Theorem7.3Ford-Fulkerson Correctness and Termination

Given a flow network with integer capacities, the Ford-Fulkerson algorithm terminates in at most ∣f∗∣|f^*| iterations (where f∗f^* is the max flow value) and returns a maximum flow. With BFS augmenting paths (Edmonds-Karp variant), termination is guaranteed in O(nm)O(nm) augmentations even for irrational capacities.


Proof

Proof

Algorithm description. Start with f(e)=0f(e) = 0 for all ee. Repeat: find an ss-tt path PP in the residual graph GfG_f; augment ff along PP by the bottleneck capacity δ=min⁡e∈Pcf(e)\delta = \min_{e \in P} c_f(e). Stop when no ss-tt path exists in GfG_f.

Invariant: ff is a valid flow after each augmentation. Initially f≡0f \equiv 0 is valid. Augmenting along PP: for forward edges (u,v)∈P(u,v) \in P, increase f(u,v)f(u,v) by δ\delta; for backward edges, decrease f(v,u)f(v,u) by δ\delta. The capacity constraint holds because δ≤cf(e)\delta \leq c_f(e) ensures f(e)≤c(e)f(e) \leq c(e) and f(e)≥0f(e) \geq 0. Flow conservation holds because augmentation changes inflow and outflow at each internal vertex by equal amounts (δ\delta in and δ\delta out along the path).

Monotonicity. Each augmentation increases ∣f∣|f| by δ>0\delta > 0. For integer capacities, δ≥1\delta \geq 1, so ∣f∣|f| increases by at least 1 per iteration. Since ∣f∣≤∣f∗∣<∞|f| \leq |f^*| < \infty, termination occurs in at most ∣f∗∣|f^*| iterations.

Optimality at termination. When the algorithm terminates, no ss-tt path exists in GfG_f. As shown in the max-flow min-cut proof: define S={v:v reachable from s in Gf}S = \{v : v \text{ reachable from } s \text{ in } G_f\}. Then ∣f∣=c(S,V∖S)=some cut capacity|f| = c(S, V\setminus S) = \text{some cut capacity}. By weak duality, ∣f∣≤|f| \leq max flow ≤\leq min cut ≤c(S,V∖S)=∣f∣\leq c(S, V\setminus S) = |f|. So ∣f∣|f| is the max flow.

Edmonds-Karp bound. When augmenting paths are chosen by BFS (shortest paths in GfG_f): the distance d(s,v)d(s, v) in GfG_f 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 (u,v)(u,v) can only reappear after d(s,u)d(s,u) increases by at least 2. Since distances are at most nn, each edge is saturated at most n/2n/2 times, giving at most nm/2nm/2 augmentations total. Each BFS takes O(m)O(m), so total time is O(nm2)O(nm^2).

Improved bound: More careful analysis shows O(nm)O(nm) augmentations suffice for Edmonds-Karp. □\square

■

ExampleNon-Termination with Irrational Capacities

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 ϕ−k\phi^{-k} (where ϕ=(1+5)/2\phi = (1+\sqrt{5})/2), converging to a non-maximum flow. BFS path selection (Edmonds-Karp) avoids this issue.

RemarkComplexity Summary
  • Ford-Fulkerson (DFS): O(∣f∗∣⋅m)O(|f^*| \cdot m) (pseudo-polynomial)
  • Edmonds-Karp (BFS): O(nm2)O(nm^2) (polynomial)
  • Dinic's algorithm: O(n2m)O(n^2 m)
  • Push-relabel: O(n2m)O(n^2\sqrt{m}) or O(n3)O(n^3)
  • Orlin's algorithm: O(nm)O(nm) (optimal for dense graphs)