Algorithm Search⌘K

Proofs: Maximum-capacity augmenting path algorithm

These are the human proofs of Maximum-capacity augmenting path algorithm, at full length.

The maximum-capacity augmenting path algorithm returns a maximum flow after at most m ln f* + 1 augmentations full

This proof shows: correctness, termination, complexity.

Setting. G=(V,E)G = (V, E) is a directed graph with nn vertices, mm edges, integer capacities c(e)≥0c(e) \ge 0, a source ss and a sink t≠st \ne s. Parallel and antiparallel edges are allowed. For a flow ff, the residual graph GfG_f has, for each edge e=(u,v)e = (u, v), a forward residual edge (u,v)(u, v) of capacity c(e)−f(e)c(e) - f(e) and a backward residual edge (v,u)(v, u) of capacity f(e)f(e). The bottleneck of a path is the least residual capacity on it. Let f∗f^{*} be the maximum flow value.

Lemma 1 (WIDEST-PATH). When a vertex uu is extracted for the first time at line L9, b[u]b[u] equals the largest bottleneck w(u)w(u) of an ss-uu path in GfG_f (with w(s)=∞w(s) = \infty), and following via from uu gives a path with that bottleneck. Vertices with w(u)=0w(u) = 0 keep b[u]=0b[u] = 0.

Proof. Every value b[v]>0b[v] > 0 is the bottleneck of the path that via records, so b[v]≤w(v)b[v] \le w(v) always. Suppose the claim fails, and let uu be the first extracted vertex with b[u]<w(u)b[u] < w(u). Take a path PP from ss to uu with bottleneck w(u)w(u). Let (x,y)(x, y) be the first edge of PP with xx extracted and yy not yet extracted before uu; it exists because ss is extracted first and uu is not yet extracted. The part of PP up to xx has bottleneck at least w(u)w(u), so w(x)≥w(u)w(x) \ge w(u) and, by the choice of uu, b[x]=w(x)b[x] = w(x). When xx was scanned, line L12 made b[y]≥min⁡(b[x],cf(x,y))≥w(u)b[y] \ge \min(b[x], c_f(x, y)) \ge w(u), and yy entered QQ with that key. Since uu came out of QQ before yy, b[u]≥b[y]≥w(u)b[u] \ge b[y] \ge w(u), a contradiction. The case y=uy = u gives b[u]≥w(u)b[u] \ge w(u) directly. □\square

So WIDEST-PATH returns an empty path exactly when GfG_f has no ss-tt path of positive capacity, and otherwise a path with the largest bottleneck.

Lemma 2 (augmentation). If PP is an ss-tt path in GfG_f with bottleneck δ>0\delta > 0, line L5 gives a flow of value ∣f∣+δ|f| + \delta.

Proof. On a forward edge the flow rises by δ≤c(e)−f(e)\delta \le c(e) - f(e); on a backward edge it falls by δ≤f(e)\delta \le f(e); so capacities hold. Each inner vertex of PP has one edge of PP in and one out, and in each of the four cases of forward or backward edges the net change of its inflow minus outflow is 0. At ss the net outflow rises by δ\delta. □\square

Lemma 3 (a wide path exists). If ∣f∣<f∗|f| < f^{*}, then GfG_f has an ss-tt path with bottleneck at least (f∗−∣f∣)/m(f^{*} - |f|)/m.

Proof. Let gg be a maximum flow. Define hh on GfG_f edge by edge: for e=(u,v)e = (u, v), if g(e)≥f(e)g(e) \ge f(e) put g(e)−f(e)g(e) - f(e) on the forward residual edge, and otherwise put f(e)−g(e)f(e) - g(e) on the backward one. These amounts are within the residual capacities, hh is conserved at every vertex other than ss and tt because ff and gg are, and its value is ∣g∣−∣f∣=r>0|g| - |f| = r > 0. At most one residual edge per edge of GG carries hh, so hh has at most mm edges in its support. By flow decomposition, hh is a sum of at most mm path flows and cycle flows, each removing at least one support edge, and the path flows sum to rr. So some ss-tt path carries at least r/mr/m, and each of its edges has residual capacity at least that much. □\square

Lemma 4 (termination). With integer capacities the flow stays integral, and each δ\delta is a positive integer.

Proof. By induction: residual capacities of an integral flow are integers, so δ\delta is a positive integer, and Lemma 2 keeps the flow integral. □\square

Theorem. The algorithm stops after at most ⌊mln⁡f∗⌋+1\lfloor m \ln f^{*} \rfloor + 1 augmentations when f∗≥1f^{*} \ge 1, and after none when f∗=0f^{*} = 0. It returns a maximum flow ff, and the set SS of vertices that ss reaches in GfG_f is a minimum cut.

Proof. Let rkr_k be the missing flow f∗−∣f∣f^{*} - |f| after kk augmentations, so r0=f∗r_0 = f^{*}. By Lemmas 1 and 3, the next augmentation uses δ≥rk/m\delta \ge r_k / m, so rk+1≤rk(1−1/m)≤rke−1/mr_{k+1} \le r_k (1 - 1/m) \le r_k e^{-1/m}, and rk≤f∗e−k/mr_k \le f^{*} e^{-k/m}. For k>mln⁡f∗k > m \ln f^{*} this is less than 1, and rkr_k is an integer by Lemma 4, so rk=0r_k = 0. So after ⌊mln⁡f∗⌋+1\lfloor m \ln f^{*} \rfloor + 1 augmentations the flow is maximum; then GfG_f has no positive ss-tt path (otherwise Lemma 2 would give a larger flow), WIDEST-PATH returns empty, and the loop stops. If f∗=0f^{*} = 0, Gf=GG_f = G at the start has no positive ss-tt path and the loop stops at once. At the end, t∉St \notin S; every edge from SS to V∖SV \setminus S is full and every edge from V∖SV \setminus S to SS is empty, since otherwise a residual edge would leave SS. So ∣f∣=c(S)|f| = c(S), and by weak duality ff is maximum and SS is a minimum cut. ■\blacksquare

Back to Maximum-capacity augmenting path algorithm