Chapter 10 · Iterative Improvement
Maximum Flow & Minimum Cut
Push as much material as possible from source to sink. Breadth-First Search (BFS) labels find the shortest augmenting path — even through a backward edge — until the sink can't be reached; the labeled vertices then reveal the minimum cut.
Edit capacities (or click an edge on the graph)
labeled vertex (l, i±)
front of queue / edge being checked
augmenting path, forward edge
backward edge (flow undone)
edge carrying flow (thick = full)
minimum-cut edge
source side X
sink side
How to read this
- Each edge shows flow/capacity (x/u). Flow must stay between 0 and u, and at every middle vertex flow in = flow out.
- A labeled vertex j carries (l, i+) or (l, i−): l = how much extra flow can reach j; i = the vertex it was reached from; + means along a forward edge with room left, − means against an edge that already carries flow.
- Chips under the graph are the queue; ↑ marks vertices already dequeued (as in Levitin's figures).
- When the sink is labeled, its first label is the augmentation amount. Follow second labels backward to trace the path, add on forward edges, subtract on backward ones.
- When the sink stays unlabeled, the labeled set X (green) and the rest form the minimum cut (red dashed edges).
Try this
- Levitin §10.2 example: predict the second augmenting path. It must use edge 2→3 backward: 1→4→3←2→5→6 — the only way to use the idle capacity on 1→4.
- At the end, check the cut {(1,2), (4,3)}: capacity 2 + 1 = 3 = the flow value. Try any other cut by hand (e.g. X = {1}: 2 + 3 = 5) — it's never smaller.
- Pick the bad-path example, U = 20, with "Unlucky" path choice: 40 augmentations of 1 unit each. Switch to BFS: just 2. Now drag U to 40 — the unlucky count doubles, BFS stays at 2.
- Raise capacity 4→3 from 1 to 2 in the Levitin §10.2 example. Does the max flow grow? (Yes, to 4 — and now two cuts tie at capacity 4: X = {1, 4} and X = {1, 3, 4}.)
- Lesson network: the third augmenting path s→c→b←a→d→t reroutes 3 units from b over to d. Predict the final cut before playing to the end.
Go deeper
📖 Lesson 10: Iterative Improvement
🏟️ Arena · Chapter 10
🧩 Problem: max-flow-sap
🧩 Problem: min-cut-capacity
🎮 Bipartite matching (max flow in disguise)
🎮 Simplex
Reference: Levitin §10.2. Edmonds and Karp showed the shortest-augmenting-path algorithm needs at most nm/2 augmentations, each a BFS in O(m), for O(nm²) total.