Level Networks, Blocking Flows, and the Dinitz Phase Lemma #
Formalizes the phase analysis of Dinitz's blocking-flow algorithm ([Din70];
[Sch03], Section 10.6; see [Din06] for the history of the original version):
augmenting an integral flow by a blocking flow of the level network of its residual network
strictly increases the residual distance from N.s to N.t, so at most |V| - 1 such phases
can occur.
Mathematical overview #
- Level networks (
Flow.levelNet): for vertex labelsd : V → ℕ, the level network offkeeps the residual arcsu → vwithd v = d u + 1, with residual capacity as capacity. Ford = f.resDist(shortest residual distances fromN.s,Flow.resDist) these are exactly the residual arcs from one breadth-first layer to the next. A level network has no antiparallel arcs (Flow.levelNet_cap_eq_zero_of_pos). - Augmenting by a subnetwork flow (
Flow.augmentBy,Flow.augmentLevel): a flowgof a network with the same terminals whose capacities are bounded by the residual capacities offis added tofby first cancelling reverse flow. The value adds (Flow.value_augmentBy) and the residual capacities change by- g u v + g v u(Flow.resCap_augmentBy); compare [CLRS09], Lemma 26.1, stated there for networks without antiparallel arcs. - Blocking flows (
Flow.IsBlocking): every simples-tpath along arcs of positive capacity contains an arc saturated by the flow. - Phase lemma: augmenting by any flow of the level network of
f.resDistnever decreases a residual distance fromN.s(Flow.resDist_le_resDist_augmentLevel), and augmenting by a blocking flow strictly increases the residual distance of a reachableN.t(Flow.resDist_lt_resDist_augmentLevel): a shortest residual walk of the new flow that is no longer than before must run along unsaturated level arcs, contradicting blocking. - Phase bound (
Network.IsDinitzRun.length_le): the distance ofN.tis at least1before the first phase and at most|V|(the unreachable value ofFlow.resDist), so every run of Dinitz phases (Network.IsDinitzRun), from any initial flow, has at most|V| - 1phases. - Breadth-first layers (
Flow.resBall,Flow.bfsDist): computable residual distances, proved equal toFlow.resDist(Flow.bfsDist_eq_resDist). - Deciding blocking (
Flow.slackNet,Flow.unsatArcs):gis blocking exactly when the network of unused capacitiesL.cap - ghas no augmenting path for its zero flow (Flow.isBlocking_iff_not_exists_slackNet), which one breadth-first search decides (Flow.isBlocking_iff_bfsDist_slackNet,Decidable g.IsBlocking).
Main definitions #
Cslib.Algorithms.Lean.MaxFlow.Network.Flow.levelNet: the level network of a flow.Cslib.Algorithms.Lean.MaxFlow.Network.Flow.augmentBy,Flow.augmentLevel: augmentation by a flow of a residual subnetwork.Cslib.Algorithms.Lean.MaxFlow.Network.Flow.IsBlocking: blocking flows.Cslib.Algorithms.Lean.MaxFlow.Network.IsDinitzStep,Network.IsDinitzRun: Dinitz phases and runs of phases.Cslib.Algorithms.Lean.MaxFlow.Network.Flow.resBall,Flow.bfsDist: breadth-first layers.Cslib.Algorithms.Lean.MaxFlow.Network.Flow.slackNet,Flow.unsatArcs: unused capacities and unsaturated arcs of a flow.
Main results #
Cslib.Algorithms.Lean.MaxFlow.Network.Flow.resDist_le_resDist_augmentLevel: distance monotonicity under level augmentations.Cslib.Algorithms.Lean.MaxFlow.Network.Flow.resDist_lt_resDist_augmentLevel: the Dinitz phase lemma.Cslib.Algorithms.Lean.MaxFlow.Network.IsDinitzRun.length_le: at most|V| - 1phases.Cslib.Algorithms.Lean.MaxFlow.Network.Flow.bfsDist_eq_resDist: breadth-first layers compute residual distances.Cslib.Algorithms.Lean.MaxFlow.Network.Flow.isBlocking_iff_bfsDist_slackNet: blocking is decidable by one breadth-first search.
References #
- E. A. Dinic, Algorithm for solution of a problem of maximum flow in networks with power estimation
- Y. Dinitz, Dinitz' Algorithm: The Original Version and Even's Version
- A. Schrijver, Combinatorial Optimization: Polyhedra and Efficiency
- T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction to Algorithms
Level networks #
The level network of the residual network of f with respect to vertex labels d: it keeps
the residual arcs u → v with d v = d u + 1. With d = f.resDist these are the arcs on
shortest residual paths from N.s.
Augmenting by a flow of a residual subnetwork #
Arc flows of f augmented by the arc flows g of a subnetwork of the residual network: the
net amount g u v - g v u (if positive) first cancels reverse flow f v u, and the remainder is
added to f u v.
Augment f by a flow g of a network L with the same terminals whose capacities are
bounded by the residual capacities of f ([CLRS09], Lemma 26.1, there for networks without
antiparallel arcs).
Residual capacities after augmenting by g, as integers.
Residual capacities after augmenting by g: g u v is used up and g v u is freed.
Blocking flows #
Distance monotonicity: augmenting by any flow of the level network of shortest residual
distances never decreases a residual distance from N.s ([Din70]; [Sch03],
Section 10.6).
Dinitz phase lemma ([Din70]; [Sch03], Section 10.6): if N.t is
residually reachable and g is a blocking flow of the level network of shortest residual
distances, then augmenting by g strictly increases the residual distance of N.t.
A Dinitz phase step through any labelling equal to the residual distances.
A blocking flow exists only when N.s ≠ N.t: for N.s = N.t the one-vertex path has no
arc.
After T Dinitz phases the residual distance of N.t has grown by at least T.
Phase bound ([Din70]; [Sch03], Section 10.6): every run of Dinitz phases
has at most |V| - 1 phases, from any initial flow.
Breadth-first layers #
Vertices reachable from N.s by residual walks of at most k arcs, computed layer by
layer.
Breadth-first layer index of v: the number of balls f.resBall k, k < |V|, that miss
v. Equal to f.resDist v (bfsDist_eq_resDist), but computable.
Slack networks and deciding blocking #
If no path of unsaturated arcs joins the terminals, g is blocking.
g is blocking exactly when no path of unsaturated arcs joins the terminals.
Blocking is decided by one breadth-first search in the slack network.