Definition · Flow, and its valueGiven a digraph with a non-negative capacity c(a) on every arc, a source s and a sink t, a flow assigns to each arc a number f(a) with 0 ≤ f(a) ≤ c(a), such that at every vertex other than s and t the total on incoming arcs equals the total on outgoing ones. Its value is the net amount leaving s.
Definition · The residual networkFor a flow f, the residual network has, for each arc a from u to v, a forward arc from u to v of capacity c(a) - f(a) and a backward arc from v to u of capacity f(a). Arcs of residual capacity 0 are omitted. An augmenting path is any path from s to t in it, and its bottleneck is the least residual capacity along it.
Pushing the bottleneck along an augmenting path — adding it on each forward arc and subtracting it on each backward one — produces a flow again, whose value is higher by the bottleneck. Capacities hold because the bottleneck was the minimum, and conservation holds because each interior vertex of the path gains the same amount on one side as the other.
The method
- Start with zero on every arc.
- Build the residual network and look for a path from s to t in it.
- If there is one, push its bottleneck along it and repeat.
- If there is not, stop.
Example · Four vertices, and a first push that has to be undoneThe lab opens on 1>2 1, 1>3 1, 2>3 1, 2>4 1, 3>4 1 with source 1 and sink 4, and with backward arcs switched OFF. The first-found rule takes the three-arc path 1>2, 2>3, 3>4, pushes its bottleneck of 1, and then finds nothing: the search reaches only vertices 1 and 3, although the arc 1>3 still has spare capacity. The value stops at 1. Switch the backward arcs on and the same rule finds 1>3, then backwards along 2>3, then 2>4, pushes 1 more, and reaches 2.
Look at what the second path does. It sends a new unit from 1 to 3, cancels the unit that was going 2 to 3, and sends that one on to 4 instead. The net effect is two units arriving at the sink by two disjoint routes, and it was reachable only by rewriting a decision the first path had made. That is why the backward arc is part of the algorithm and not a refinement of it.
The stuck flow is worth naming precisely. It satisfies both constraints — the lab confirms conservation at every interior vertex — and no more can be pushed without taking something back. It is MAXIMAL. The maximum is 2. Two words that differ by three letters and by the whole content of this module.
The rule that chooses the path is a second question
The failure above was exhibited with a RULE rather than with a hand-picked path, and that matters: it is a claim about what an implementation does, not about what an adversary could do. On the same network the shortest-path rule happens never to take the middle arc, so it reaches 2 even with backward arcs off. That does not rescue the forward-only method, it just means this network does not defeat that particular rule.
Example · One thin arc between two fat onesOn 1>2 100, 1>3 100, 2>3 1, 2>4 100, 3>4 100 both rules reach the maximum of 200, and they take different numbers of steps to do it. The shortest-path rule augments twice, by 100 each time. The first-found rule augments four times, by 1, then 99, then 1, then 99: it walks into the thin arc, pays for it with a backward arc later, and does it twice.
That is the case the choice of rule is usually justified by, and the lab lets you watch it rather than describing it. The shortest-path rule — always take an augmenting path with the fewest arcs — is the one the kit's own maximum-flow routine uses, and its augmentation count on this network is the one the panel reports.
On the six-vertex network with capacities from 4 to 20, the shortest-path rule reaches 23 in three augmentations, pushing 12, then 4, then 7. Three numbers that add to the answer, and the third path is four arcs long where the first two were three — the rule takes the shortest available, and what is available changes as the residual network does.
Measured against proved, and this lesson is where the two are furthest apart. Three augmentations reaching 23 is a measurement. That 23 cannot be beaten is not something any number of augmentations can establish, because stopping means only that this search found no path. “Max Flow and Min Cut” supplies the missing half, and it is the one place on this course where the algorithm hands back its own proof.