Algorithm Search⌘K

Proofs: Hao-Orlin algorithm

These are the human proofs of Hao-Orlin algorithm, at full length.

The Hao-Orlin algorithm returns a minimum directed cut full

This proof shows: correctness, termination.

Let G=(V,E)G = (V, E) be directed with capacities c≥0c \ge 0, n≥2n \ge 2, and root rr. For a set YY write c(Y)=c(Y,V∖Y)c(Y) = c(Y, V \setminus Y). Arcs come in residual pairs, one per edge, and rfr_f is the residual capacity. Write e(v)e(v) for inflow minus outflow of ff at vv. Order the parts as S=D0S = D_0, then the dormant sets D1,…,DkD_1, \dots, D_k in order of creation, then WW, and call WW the last part.

Invariants (at every step of HAO-ORLIN-ROOTED):

  • (I1) 0≤f≤c0 \le f \le c and e(v)≥0e(v) \ge 0 for every v∉Sv \notin S.
  • (I2) If u∈Diu \in D_i and rf(u,v)>0r_f(u, v) > 0, then v∈D0∪⋯∪Div \in D_0 \cup \dots \cup D_i. That is, no residual arc goes from SS or a dormant set to a later part.
  • (I3) For every residual arc (v,w)(v, w) with v,w∈Wv, w \in W, d(v)≤d(w)+1d(v) \le d(w) + 1.
  • (I4) t∈Wt \in W and d(t)≤d(v)d(t) \le d(v) for every v∈Wv \in W; and the labels of WW form a set of consecutive integers.

Initialization. After lines L1 to L3, ff is full on arcs out of rr and 0 elsewhere, so (I1) holds and every arc from rr to WW is full, which is (I2); all labels in WW are 0, which gives (I3) and (I4).

Push (line L6) along x=(v,w)x = (v, w) with w∈Ww \in W moves at most e(v)e(v), so e(v)e(v) stays ≥0\ge 0 and (I1) holds. It may create the residual arc (w,v)(w, v) inside WW, with d(w)=d(v)−1≤d(v)+1d(w) = d(v) - 1 \le d(v) + 1, so (I3) holds. It creates no arc out of SS or a dormant set, so (I2) holds.

Relabel (line L9). Line L9 runs only if vv has no admissible arc, shares its label with another vertex of WW, and has a residual arc into WW. By (I3), each residual arc (v,w)(v, w) inside WW has d(w)≥d(v)−1d(w) \ge d(v) - 1, and not equal since no arc is admissible, so d(w)≥d(v)d(w) \ge d(v). The new label 1+min⁡d(w)1 + \min d(w) is thus at least d(v)+1d(v) + 1; arcs out of vv satisfy (I3) by the choice, and arcs into vv only get looser. The new label is d(w)+1d(w) + 1 for a vertex w∈Ww \in W, so by consecutiveness every value from d(t)d(t) up to the new label is used, and the old label of vv is still used by another vertex; so (I4) holds. Since v≠tv \ne t is never relabeled, d(t)d(t) stays the least.

Gap (line L7). Let R={w∈W:d(w)≥d(v)}R = \{w \in W : d(w) \ge d(v)\}, where vv alone has the label d(v)d(v). A residual arc from x∈Rx \in R to y∈W∖Ry \in W \setminus R would have, by (I3), d(x)≤d(y)+1≤d(v)d(x) \le d(y) + 1 \le d(v), so d(x)=d(v)d(x) = d(v) and d(y)=d(v)−1d(y) = d(v) - 1; then x=vx = v and the arc is admissible, which is excluded. So RR has no residual arc to the new WW, and as a new last dormant set it satisfies (I2). Since d(t)≤d(v)d(t) \le d(v) and tt would share the label of vv if equal, d(t)<d(v)d(t) < d(v) and t∉Rt \notin R. The remaining labels are those below d(v)d(v), still consecutive. (I1) and (I3) are unaffected.

Isolated vertex (line L8). vv has no residual arc into WW, so {v}\{v\} satisfies (I2) as a new last dormant set. It shares its label (else line L7 applied), so the label set of WW is unchanged, and v≠tv \ne t.

Termination of a phase. By (I4) the labels in WW lie in [d(t),d(t)+n−1][d(t), d(t) + n - 1], and d(t)d(t) is fixed during a phase. Each relabel raises a label by at least 1, so a phase has at most n2n^2 relabels. Between relabels, each vertex scans its arcs with a current-arc pointer; a push saturates an arc or empties vv. Saturated arcs (v,w)(v, w) become residual again only after a push along (w,v)(w, v), which needs d(w)=d(v)+1d(w) = d(v) + 1, so ww must have been relabeled; hence there are finitely many saturating pushes. Each non-saturating push empties its vertex; with the potential ∑v actived(v)\sum_{v \text{ active}} d(v), which each such push lowers by at least 1 and each relabel or saturating push raises by at most 2n2n, there are finitely many. Dormant moves shrink WW. So the loop of line L5 stops, and then no vertex of W∖{t}W \setminus \{t\} is active.

The recorded cut is a minimum SS-tt cut. At line L10 let X=V∖WX = V \setminus W, the union of SS and the dormant sets, so S⊆XS \subseteq X and t∉Xt \notin X. By (I2), no arc from XX to WW is residual: arcs from XX to WW are full, and arcs from WW to XX carry no flow, since flow on (w,x)(w, x) would make (x,w)(x, w) residual. So the net flow into WW is c(X)c(X). Every vertex of WW other than tt has excess 0, so e(t)=c(X)e(t) = c(X). Now let YY be any set with S⊆YS \subseteq Y and t∉Yt \notin Y. The net flow into V∖YV \setminus Y is at most c(Y)c(Y), and it equals ∑v∉Ye(v)\sum_{v \notin Y} e(v), which by (I1) is at least e(t)e(t), as V∖YV \setminus Y contains no vertex of SS. So c(Y)≥e(t)=c(X)c(Y) \ge e(t) = c(X).

Changing the sink (lines L11 to L14). Moving tt into SS and pushing the full residual capacity of every arc from tt to a vertex outside SS keeps (I1) (the excess of tt may become negative, which is allowed in SS, and the receivers gain excess) and makes every arc from tt to a later part full, so (I2) holds for SS. Pushes from SS into a dormant set create residual arcs into SS only, which (I2) allows. Removing tt, the least label, from WW keeps the labels consecutive. If WW becomes empty and a dormant set is left, the most recent one DkD_k becomes WW. Since its creation, no flow moved on arcs between two of its vertices, as only WW vertices push and line L12 pushes from SS; so its labels still satisfy (I3), and they were consecutive when it was created, by the two cases above. By (I2) no older part has a residual arc into it, so (I2) still holds with DkD_k as the last part. Line L14 then picks a least label, which gives (I4).

Every vertex other than rr is a sink once. Each phase moves one vertex from WW to SS, and WW is nonempty at the start of each phase: at line L13 it is refilled while a dormant set remains, and when none remains every vertex is in SS. After n−1n - 1 phases S=VS = V. So the sinks t1,…,tn−1t_1, \dots, t_{n-1} are exactly the vertices other than rr.

Rooted optimality. Every recorded cut XX contains rr and not the current sink, so it is a nonempty proper set containing rr. Let X∗X^* be a proper set containing rr of least c(X∗)c(X^*). Since X∗≠VX^* \ne V, some sink lies outside it; let tit_i be the first. At phase ii, S={r,t1,…,ti−1}⊆X∗S = \{r, t_1, \dots, t_{i-1}\} \subseteq X^* and ti∉X∗t_i \notin X^*, so the cut recorded in phase ii has capacity at most c(X∗)c(X^*). Hence the least recorded cut is optimal among sets containing rr.

Global optimality (line L15). Take r=0r = 0. A nonempty proper set XX either contains 0, and is covered by the forward run, or does not, and then V∖XV \setminus X contains 0 and c(X)=crev(V∖X)c(X) = c^{\mathrm{rev}}(V \setminus X), the capacity of the edges leaving V∖XV \setminus X in the reversed graph, covered by the reverse run. Line L15 returns the better of the two, complementing the side found by the reverse run. So it returns a minimum directed cut. ■\blacksquare

Back to Hao-Orlin algorithm