- Published on
Network Flows - Part 4
- Authors

- Name
- Till Heller
In Part 3, we proved the Max-Flow Min-Cut Theorem and saw that augmenting paths are the key to finding maximum flows. The natural algorithm is clear: start with the zero flow, find an augmenting path in the residual graph, push flow along it, and repeat. But several important questions remain. Does this process always terminate? How do we choose which augmenting path to use? And how fast is the resulting algorithm? In this part, we'll answer all three questions.
The Ford-Fulkerson Method
Let's start by writing down the augmenting path strategy as a precise algorithm. The Ford-Fulkerson method, introduced by Lester Ford and Delbert Fulkerson in 1956, is the framework that makes this idea concrete.
Ford-Fulkerson Method:
- Initialize for every arc .
- Build the residual graph .
- Search for an augmenting path from to in .
- If no augmenting path exists, stop — is a maximum flow.
- Otherwise, compute the bottleneck .
- Update the flow: for each arc on , if is a forward arc, set ; if it corresponds to a backward arc , set .
- Go to step 2.
We call this a "method" rather than an "algorithm" because it doesn't specify how to find the augmenting path in step 3. Any search procedure — depth-first search, breadth-first search, or something else entirely — can be used. As we'll see, this choice has a dramatic impact on performance.
Correctness
The correctness of the Ford-Fulkerson method follows directly from the Max-Flow Min-Cut Theorem (Theorem 1 from Part 3). When the method terminates, no augmenting path exists in the residual graph. By the equivalence of conditions (i) and (ii) in the theorem, the current flow is maximum.
We should also verify that each augmentation produces a valid flow. This is straightforward: the capacity constraints are preserved because we only push units, which is at most the residual capacity on every arc. Flow conservation is preserved because on each intermediate vertex of the path, the incoming flow and outgoing flow both change by the same amount .
Termination
Correctness tells us that if the method stops, it gives the right answer. But does it always stop?
For integer capacities, the answer is yes. Each augmentation increases the flow value by at least (since the bottleneck is a positive integer). The flow value is bounded above by any cut capacity, which is finite. So the method must terminate after at most augmentations, where is the maximum flow value.
Observation 2. With integer capacities, the Ford-Fulkerson method terminates after at most augmentations.
This gives a running time of , since each augmentation requires finding a path in the residual graph (which takes time using BFS or DFS, where ). For networks with small flow values, this is perfectly fine. But the flow value can be enormous — it can be exponential in the size of the network.
Consider the following example. Take a network with vertices and arcs , , , , with capacities and , where is a large integer. The maximum flow is . A clever adversary could force the algorithm to alternately find augmenting paths and , each pushing only unit through the bottleneck arc or its reverse. This would require augmentations — even though a smarter choice of paths would solve the problem in just augmentations1.

For irrational capacities, the situation is even worse: there exist examples where the Ford-Fulkerson method does not terminate at all. The flow values can converge to a limit that is not the maximum flow. This was shown by Uri Zwick in 1993 and is one of the reasons why the Ford-Fulkerson method is considered a framework rather than a complete algorithm — it needs a good path-selection rule to guarantee termination and efficiency.
The Edmonds-Karp Algorithm
The weakness of the Ford-Fulkerson method is its freedom in choosing augmenting paths. Jack Edmonds and Richard Karp (and independently Yefim Dinitz) discovered in 1972 that a simple rule eliminates all the problems: always choose a shortest augmenting path, where "shortest" means fewest arcs.
Definition 10. The Edmonds-Karp algorithm is the Ford-Fulkerson method where the augmenting path in each iteration is a shortest --path in the residual graph , found using breadth-first search (BFS).
BFS explores vertices layer by layer: first all vertices at distance from , then distance , and so on. It naturally finds a shortest path in time. By always augmenting along a shortest path, we ensure that the residual graph doesn't develop "shortcuts" that could lead to the pathological behavior we saw above.
Analysis
The key to analyzing the Edmonds-Karp algorithm is the following lemma, which shows that distances in the residual graph can only increase over time.
For a flow , let denote the shortest-path distance (in number of arcs) from to in the residual graph .
Lemma 2. Let be a flow, and let be the flow obtained after one augmentation along a shortest path. Then for every vertex .
The proof uses a careful argument by contradiction: if some vertex got closer to after the augmentation, we can trace back the new shorter path and show that it must use an arc that was created by the augmentation — but this leads to a contradiction with the fact that we augmented along a shortest path. We omit the full proof here, but the intuition is that augmenting along shortest paths is "conservative" — it doesn't create shortcuts in the residual graph.
With this lemma, we can bound the total number of augmentations.
Theorem 3. The Edmonds-Karp algorithm performs at most augmentations, where and .
Proof sketch. We call an arc on an augmenting path critical if it has the minimum residual capacity — that is, . After augmenting, a critical arc disappears from the residual graph (its residual capacity drops to zero).
Consider a specific arc . When it is critical, we have (since it lies on a shortest path). For to reappear in the residual graph later, flow must be pushed backwards through it — meaning must appear on some future augmenting path. At that point, . By Lemma 2, distances never decrease, so:
Each time an arc becomes critical, the distance of one of its endpoints from increases by at least . Since distances are bounded by (there are only vertices), each arc can be critical at most times. There are arcs, so the total number of critical arc events is . Since each augmentation has at least one critical arc, the total number of augmentations is at most .
Since each augmentation takes time (for BFS plus the flow update), the total running time is:
Corollary 2. The Edmonds-Karp algorithm runs in time.
This is a polynomial bound that depends only on the size of the network, not on the magnitude of the capacities. Whether the capacities are or , the algorithm runs in the same polynomial time.
A Worked Example
Let's trace the Edmonds-Karp algorithm on a slightly larger network to see it in action. Consider the network with vertices and the following arcs and capacities:
Iteration 1. Starting from the zero flow, the residual graph equals the original network. BFS from finds a shortest path. One such path is with bottleneck . We push units: , , . Flow value: .
Iteration 2. BFS finds with bottleneck . We push units: , . Flow value: .
Iteration 3. BFS finds with bottleneck . We push units: , , , . Flow value: .
Iteration 4. BFS finds . The residual capacities are , , — but , so this path is blocked. In fact, no path from to exists in the residual graph: the arcs and are fully saturated, and the remaining forward capacity out of is only , but it cannot reach 2.
Wait — let's be more careful. Let me recheck. From : we can reach (residual on ) and via ? No, is a backward arc with residual , but that goes from to — it doesn't help us leave . Actually, can go to with residual . From : has residual , has residual , and there's a backward arc with residual . From : has residual , backward arcs with residual and with residual . None of these reach .
So the algorithm terminates with maximum flow . The minimum cut can be read from the residual graph: is the set of vertices reachable from , which is and . The cut capacity is , confirming .
The algorithm needed only augmentations — far fewer than the theoretical bound of — because BFS guided us to efficient choices.

Looking Ahead
The Edmonds-Karp algorithm gives us a reliable polynomial-time method for computing maximum flows. While is efficient enough for many practical purposes, faster algorithms exist — Dinitz's algorithm achieves using the concept of blocking flows, and more recent algorithms improve this further.
In the next part, we'll shift from algorithms to applications. We'll see how maximum flow can be used to solve problems that, at first glance, have nothing to do with flows: bipartite matching, edge-disjoint paths, and project selection. These applications demonstrate the remarkable versatility of network flow theory.
Footnotes
This example shows that the choice of augmenting path matters enormously. With DFS, a poor choice of paths can lead to augmentations, while BFS would find paths that avoid the bottleneck arc entirely. ↩
To verify this, note that can only reach via with capacity . From , the arc has and has , but from , the arc has . Going backwards from to (via reverse of ) reaches , but has leading back to — a dead end. So is unreachable. ↩