MIT 6.1220 — Lecture 10
Maximum Flow (Part II)
Let's first analyze the runtime of our Ford-Fulkerson algorithm.
Solution. (Ford-Fulkerson) Repeatedly find augmenting paths , then recompute the residual network each time. Repeat until no more augmenting paths exist. This is optimal.
Suppose all capacities are integers in , so our algorithm actually terminates.
Computing at each step takes .
Searching for an augmenting path at each step takes .
The number of steps is at most the max flow . This is:
Lower-bounded by the number of augmentations, and…
Upper-bounded by the cut of the cut , which is upper-bounded by .
So overall, we have a runtime of , or where is the max flow.
Remark. This is a pseudopolynomial runtime; we can still get pseudopolynomial runtime with rational capacities! But real-numbered capacities might yield an infinite loop, so this is the best we can do.
However, if we choose our paths poorly, Ford-Fulkerson can have needlessly long runtime.

If Ford-Fulkerson picks paths and , it can finish in just two steps.
But it might also finish in steps if it picks paths and .
Solution. (Better Ford-Fulkerson) Repeatedly find the highest bottleneck capacity augmenting path , and recompute the residual network each time.
How? Dijkstra's, but store the minimum encountered edge weight at each vertex. This takes time.
To analyze the runtime of this algorithm, we make the following claim.
Claim. For any graph with max flow , there exists a path with bottleneck capacity at least .
Proof: Flow Decomposition Lemma. When decomposing a flow into paths and cycles, every path / cycle created will “use up” at least one of the edges. So the flow can be decomposed into at most paths and cycles.
Now apply a probabilistic argument.
Now for the runtime of Better Ford-Fulkerson.
Claim. The better Ford-Fulkerson runs in time.
Proof: Each step takes time (finding the maximum bottleneck path). Also, each step cuts the remaining flow down by a factor of , so the total number of steps is upper-bounded by . The end.
The gain here is that the dependence on is now logarithmic, not linear. This is weakly polynomial runtime.
It turns out we have other solutions.
Solution. (Edmonds-Karp) Repeatedly find the shortest (least # of edges) augmenting path , and recompute the residual network each time. How? BFS.
This has runtime , with no dependence on .
Solution. (Chen Kyng Liu … '22) You can solve this problem in time.
We'll end with an application of our newfound max-flow-finding tech.
Problem. (Bipartite Matching) Given a bipartite graph , find the largest possible matching.
Solution. (Bipartite Matching) Construct and , then direct all edges and give them weight . Then the maximum flow yields the largest possible matching. (How is the “matching” constraint enforced?)