Preflows, Valid Labelings, Push and Relabel #
The basic objects of the Goldberg–Tarjan push–relabel method ([GT88]; [CLRS09],
Section 26.4) on the integral networks of CslibFrontier.Algorithms.Lean.MaxFlow.Basic.
Model and source mapping #
- Preflow (
Network.Preflow): integral arc flows bounded by the capacities, with inflow at least outflow at every vertex other thanN.s([CLRS09], Section 26.4). Unlike [CLRS09], the network may have antiparallel arcs and arcs enteringN.sor leavingN.t; the condition atN.tis enforced. - Excess and residual capacity:
excess f vis inflow minus outflow (inℤ);resCap f u vis(cap u v - f u v) + f v u, as forNetwork.Flow.resCap. - Valid labeling (
Preflow.IsValidLabeling):h N.s = |V|,h N.t = 0andh u ≤ h v + 1on every residual arc ([CLRS09], Section 26.4). - Push (
Preflow.push): movesmin (excess u, resCap u v)units fromutov, first cancelling flow on(v, u)and then increasing flow on(u, v). - Relabel (
Preflow.relabel): setsh u := 1 + min {h v | resCap u v > 0}. The preconditions of push and relabel arePreflow.CanPushandPreflow.CanRelabel.
Main definitions #
Network.Preflow,Preflow.excess,Preflow.resCap,Preflow.IsActive,Preflow.ResReachable,Preflow.toFlow.Preflow.IsValidLabeling,Preflow.push,Preflow.relabel,Preflow.CanPush,Preflow.CanRelabel,Preflow.initial,Preflow.initialHeight.Preflow.gapLevel,Preflow.gapCut: the least empty level of a labeling and the vertices above it.
Main results #
Preflow.IsValidLabeling.not_resReachable: no residuals–tpath ([CLRS09], Lemma 26.17).Preflow.resReachable_source_of_excess_pos: positive excess implies a residual path toN.s([CLRS09], Lemma 26.19);Preflow.IsValidLabeling.le_of_excess_pos: such vertices have height at most2|V| - 1([CLRS09], Lemma 26.20).Preflow.IsValidLabeling.push,Preflow.IsValidLabeling.relabel: push and relabel preserve valid labelings ([CLRS09], Lemma 26.16);Preflow.CanRelabel.lt_relabelHeight: relabel raises the height ([CLRS09], Lemma 26.15);Preflow.IsValidLabeling.exists_canPush_or_canRelabel: an active vertex admits one of them ([CLRS09], Lemma 26.14).Preflow.IsValidLabeling.isMaxFlow_toFlow: a preflow with a valid labeling and no active vertex is a maximum flow ([CLRS09], Theorem 26.18);Preflow.IsValidLabeling.isMinCut_gapCut: its gap cut is then a minimum cut of the same value.
References #
An integral preflow on N: arc flows bounded by the capacities, with inflow at least outflow at
every vertex other than N.s ([CLRS09], Section 26.4).
- toFun : V → V → ℕ
Integral flow on each directed arc
(u, v). Capacity bound on every directed arc.
Outflow is at most inflow at every vertex other than the source.
Instances For
Valid labelings #
A valid labeling (height function) for f ([CLRS09], Section 26.4).
The source has height
|V|.The sink has height
0.Residual arcs descend by at most one level.
Instances For
No residual s–t path ([CLRS09], Lemma 26.17).
Excess and residual reachability #
Overflowing vertices reach the source ([CLRS09], Lemma 26.19): in a preflow, every vertex
with positive excess has a residual path to N.s.
Height bound ([CLRS09], Lemma 26.20): under a valid labeling, a vertex with positive
excess has height at most 2|V| - 1.
Push and relabel #
Precondition of a push from u to v ([CLRS09], Section 26.4): u is active and (u, v) is
a residual arc going down one level.
- active : f.IsActive u
uis active. (u, v)is a residual arc.(u, v)goes down one level.
Instances For
Precondition of a relabel of u ([CLRS09], Section 26.4): u is active and no residual arc
leaving u goes downhill.
- active : f.IsActive u
uis active. No residual arc leaving
ugoes downhill.
Instances For
Every active vertex admits a push or a relabel ([CLRS09], Lemma 26.14).
Termination and the gap cut #
Optimality at termination ([CLRS09], Theorem 26.18): a preflow with a valid labeling and no active vertex is a maximum flow.
By pigeonhole, a valid labeling leaves some level strictly between 0 and |V| empty.
Gap cut at termination: for a preflow with a valid labeling and no active vertex, the vertices above the least empty level form a minimum cut whose capacity is the flow value.
The push operation #
Arc flows after pushing δ units from u to v: first cancel up to δ units of the reverse
flow f v u, then add the remainder to f u v.
Push f.pushAmount u v units from u to v, cancelling reverse flow first ([CLRS09],
Section 26.4, procedure PUSH).
Pushes preserve valid labelings ([CLRS09], Lemma 26.16).
The relabel operation #
Relabel u: replace its height by f.relabelHeight h u ([CLRS09], Section 26.4, procedure
RELABEL).
A relabel strictly raises the height of the relabelled vertex ([CLRS09], Lemma 26.15).
Relabels preserve valid labelings ([CLRS09], Lemma 26.16).
Initialization #
The initial preflow: saturate every arc leaving the source ([CLRS09], Section 26.4, procedure
INITIALIZE-PREFLOW).
The initial heights: |V| at the source and 0 elsewhere ([CLRS09], Section 26.4).