A Bit of History
In 1972, Jack Edmonds (already met via the Chu-Liu/Edmonds algorithm in Part 11) and Richard Karp (of Held-Karp and soon Hopcroft-Karp) published "Theoretical Improvements in Algorithmic Efficiency for Network Flow Problems," proving that simply choosing the shortest augmenting path (via BFS) at every step guarantees polynomial time, fixing the pathological slowness the Ford-Fulkerson deep dive described. What Edmonds and Karp couldn't have known: two years earlier, in 1970, Soviet computer scientist Yefim (Efim) Dinitz had already discovered essentially the same idea — and a more sophisticated "blocking flow" algorithm besides — publishing it in a Soviet journal. Cold War-era restrictions on scientific communication meant neither research group learned of the other's work for years; the algorithm is now credited to both, sometimes explicitly written "Edmonds-Karp (independently, Dinitz)" in careful modern references.
Working Principle
Edmonds-Karp is Ford-Fulkerson with exactly one change: the augmenting path is always found via BFS (guaranteeing the shortest, in edge count, augmenting path available in the current residual graph), rather than an arbitrary DFS or unspecified search. Every other part of the algorithm — pushing bottleneck flow, updating residual capacities — is identical to Ford-Fulkerson.
Key Insight
This is a beautiful, minimal fix: the entire improvement over Ford-Fulkerson's worst-case behavior comes from swapping DFS for BFS in exactly the same augmenting-path search — nothing else about the method changes. It's a strong illustration of how much a seemingly small implementation choice (BFS vs. DFS) can affect worst-case guarantees, even when both choices produce a "correct" algorithm.
Why BFS Bounds the Iteration Count
The key lemma: the shortest-path distance from \(s\) to any vertex \(v\) in the residual graph is monotonically non-decreasing across successive augmentations — it never gets shorter as the algorithm progresses. Combined with a careful counting argument (each edge can be the "bottleneck" of an augmenting path at most \(O(V)\) times before its distance from \(s\) must strictly increase, and distances are bounded by \(V\)), this bounds the total number of augmentations at \(O(VE)\) — a bound that depends only on the graph's size, not on capacity values at all, unlike plain Ford-Fulkerson.
Complexity Analysis
\(O(VE)\) augmentations, each requiring an \(O(E)\) BFS to find:
$$\text{Time: } O(VE^2) \qquad \text{Space: } O(V + E)$$
Crucially, this bound is strongly polynomial — independent of the actual capacity values, unlike Ford-Fulkerson's \(O(EF)\) pseudo-polynomial bound from its own deep dive.
Implementation
Real-World Applications
Guaranteed-Time Network Provisioning
Wherever a max-flow computation needs a hard, predictable time bound regardless of capacity magnitudes — telecommunications bandwidth provisioning, real-time network reconfiguration in emergency-response systems — Edmonds-Karp's strongly polynomial \(O(VE^2)\) guarantee is preferred over plain Ford-Fulkerson, precisely because the latter's runtime can depend unpredictably on capacity values that might be very large or unevenly distributed.
Exercises
- Run Edmonds-Karp by hand on the Ford-Fulkerson deep dive's worked example, and confirm the augmenting paths chosen (by BFS) differ from the DFS-found ones there, while the final max flow value still matches.
- Explain, in your own words, why "shortest augmenting path is non-decreasing across iterations" is enough to bound the total number of iterations at \(O(VE)\).
- Construct a small network where Ford-Fulkerson (using an adversarial DFS choice) would take noticeably more iterations than Edmonds-Karp on the same graph.
- Challenge: Implement both Ford-Fulkerson (DFS) and Edmonds-Karp (BFS) side by side, instrument both to count iterations, and compare the counts on a graph specifically designed to be adversarial for DFS.
Limitations
Not the Fastest Known Max-Flow Algorithm
\(O(VE^2)\) is a solid guarantee, but far from state of the art — Dinitz's own blocking-flow algorithm achieves \(O(V^2E)\), and modern max-flow research (briefly previewed in Part 23) has pushed the bound to nearly linear time in some settings. Edmonds-Karp remains an excellent teaching and general-purpose choice, but production systems handling very large flow networks typically reach for faster, more specialized algorithms.