Proofs: Capacity scaling max-flow algorithm
These are the human proofs of Capacity scaling max-flow algorithm, at full length.
Capacity scaling makes at most 2m augmentations per phase full
This proof shows: time.worst.
Use the notation of the correctness proof, let be the maximum flow value, and assume (otherwise add per search).
Lemma 1. At the end of a -phase, .
Proof. Let be the set of vertices reachable from in ; because the phase has ended. For every s-t flow , , where the first sum is over edges from to and the second over edges from to , since and . An edge from to has , else its head would be reachable in ; an edge from to has for the same reason. Each edge is in at most one of the two sums, so when some edge crosses the cut, and otherwise. Take maximum.
Lemma 2. Each phase performs fewer than augmentations, or none.
Proof. The first threshold is a power of 2, and line L7 halves it, so every threshold is a power of 2 and each later threshold follows a phase with threshold exactly . For the first phase, by the choice in line L2, so . For a later phase with threshold , Lemma 1 for the previous phase says that the missing value at the start is less than . In every phase each augmentation carries at least , so the phase has fewer than augmentations.
Theorem. The algorithm runs in time and space.
Proof. There are phases. Each phase has fewer than augmentations, each preceded by one search, plus one failing search; a search costs and an augmentation . So a phase costs and the total is , plus for lines L1, L2, L8 and L9. The arrays of residual capacities, the adjacency lists, the queue and the parent arcs take space.
Capacity scaling returns a maximum flow and a minimum cut full
This proof shows: correctness, termination.
Let be a flow network with integer capacities , edges and , and . Write for the residual capacities, , for the residual graph of arcs with , and for the arcs with .
Claim 1 (invariant). Before and after each augmentation, is an s-t flow, every is a nonnegative integer, and for each edge.
Proof. True after line L1. Line L4 finds a path of from to ; BFS marks each vertex once, so is simple. Line L5 sets to the least on , an integer with . Line L6 is an augmentation along by its bottleneck, which keeps the invariant by the augmentation lemma of augmenting path, and raises by .
Claim 2 (termination). Each augmentation raises by at least 1, and , so there are finitely many augmentations. Line L7 halves , so the loop of line L3 runs times, or not at all if .
Claim 3 (no augmenting path at the end). If , the last phase has and ends when BFS over the arcs with does not reach . Since all are integers, means , so is not reachable in . If , has no arcs at all.
Claim 4 (optimality). Line L8 computes the set of vertices reachable from in , with and, by Claim 3, . Each edge with , has , so ; each edge with , has , so . By conservation, . Every s-t flow has value at most and every s-t cut has capacity at least , so the flow is maximum and the cut is minimum.