Algorithm Search⌘K

Proofs: Almost-linear-time maximum flow algorithm

These are the human proofs of Almost-linear-time maximum flow algorithm, at full length.

The exact version of the almost-linear max flow method returns a maximum flow full

This proof shows: correctness, termination.

This proof is for the version on the algorithm page, with exact min-ratio cycles and the finish of lines L7 to L9. The step bound of the real algorithm is proved by Chen and others and is not repeated here.

Setup. Variables are the original edges with ue>0u_e > 0 and u≠vu \ne v (lower bound 0, upper bound ueu_e, cost 0), the return edge (t,s)(t, s) with upper bound UsU_s and cost −1-1, and the edges at zz with upper bound 2∣b(v)∣2|b(v)| and cost 4. All upper bounds are integers: b(v)b(v) is a sum of halves of integers, so 2∣b(v)∣2|b(v)| is an integer. Write xx for the vector of variable values, and call xx a circulation if inflow equals outflow at every vertex, including zz.

Claim 1 (start). After line L2, xx is a circulation and 0<xe<uˉe0 < x_e < \bar u_e for every variable. Proof. After line L1 each variable is at half its bound, and b(v)b(v) is the inflow minus outflow at vv. The edge v→zv \to z with value b(v)>0b(v) > 0, or z→vz \to v with value −b(v)-b(v) for b(v)<0b(v) < 0, cancels it. At zz the inflow minus outflow is ∑vb(v)=0\sum_v b(v) = 0, as every variable adds to one head and subtracts from one tail. Every value is half of its bound, which is positive. □\square

Claim 2 (steps). Every step of line L6 keeps a strictly interior circulation. Proof. Δ\Delta is a cycle, so adding any multiple keeps the circulation. The room ρ\rho is the least distance to a bound along Δ\Delta, and the step is at most ρ/2\rho / 2, so every value stays strictly inside. □\square

Claim 3 (the loop ends). Line L3 allows a fixed number of steps, and line L5 is a finite procedure: each Dinkelbach round finds a cycle with a strictly lower ratio, and a graph has finitely many simple cycles. Line L6 tries finitely many η\eta. □\square

Claim 4 (rounding). Line L7 ends with an integral circulation within the bounds whose cost is at most the cost of xx. Proof. Call a variable fractional if its value is not an integer. Suppose some variable at vertex vv is fractional. The net flow at vv is 0, an integer, and the integral variables contribute an integer, so the fractional ones at vv sum (with signs) to an integer, which is impossible with only one of them. So in the multigraph of fractional variables every vertex with an edge has degree at least 2, and it contains a cycle QQ. Pushing δ\delta around QQ in one direction keeps the circulation and changes the cost by δ\delta times the signed cost of QQ; line L7 picks the direction where this is at most 0. It takes δ\delta as the least distance to the next integer in the direction of motion, so each value stays between two consecutive integers it lay between, hence within its integer bounds, and at least one variable becomes integral. Integral variables are not in QQ, so they stay integral, and there are finitely many variables, so line L7 ends. □\square

Claim 5 (removing zz). Line L8 ends with value 0 on all edges at zz, an integral circulation within bounds, and a cost not higher. Proof. If an edge out of zz has positive value, let RR be the set of vertices reachable from zz by edges of positive value. If no edge of positive value entered zz from RR, then the set R∖{z}R \setminus \{z\} would receive positive flow from zz and, since all edges of positive value leaving it stay in RR, send none to zz; the total inflow minus outflow over R∖{z}R \setminus \{z\} would be positive, which contradicts conservation. So the search finds a cycle through zz of positive values. Subtracting its least value keeps an integral circulation within bounds and sets one value to 0; the cost changes by minus the cost of the cycle, which uses two edges at zz (cost 8) and at most one return edge (cost −1-1), so it falls. Each round makes one more value 0 and never raises one, so line L8 ends. If no edge leaves zz with positive value, conservation at zz shows that none enters it either. □\square

Claim 6 (output). After line L8, the values on the original edges form an integral s-t flow ff within capacities. Conservation holds at every vertex other than ss and tt, since the only other variables there, edges at zz, are 0, and the return edge touches only ss and tt. Dropped edges (capacity 0 and self-loops) get flow 0, which is feasible. Line L9 runs Ford-Fulkerson with breadth-first paths from ff; each augmentation raises the integer value by at least 1 and the value is at most UsU_s, so it ends, and when no augmenting path is left the set reachable from ss in the residual graph is a cut whose capacity equals the flow value, so ff is a maximum flow. □\square

Claim 7 (when the interior phase suffices). Let F∗F^* be the least cost of a circulation of the extended instance. Integral circulations of the original edges plus the return edge with cost −F-F are s-t flows of value FF, so F∗≤−Fmax⁡F^* \le -F_{\max}; and any circulation decomposes into cycles, those through zz cost at least 8−1>08 - 1 > 0, so F∗=−Fmax⁡F^* = -F_{\max}, an integer. If the interior phase ends with c⊤x<F∗+1c^\top x < F^* + 1, the rounded circulation of Claim 4 is integral, its cost is an integer at least F∗F^* and less than F∗+1F^* + 1, so it equals F∗F^*. An optimal circulation with positive value at zz could drop a cycle through zz and lower the cost, by Claim 5, so its values at zz are 0 and line L8 does nothing. Its return edge carries Fmax⁡F_{\max}, so line L9 finds no augmenting path. □\square

By Claims 1 to 6 the algorithm ends and returns an integral maximum flow. ■\blacksquare

Back to Almost-linear-time maximum flow algorithm