Documentation

CslibFrontier.Algorithms.Lean.MaxFlow.Decomposition

Path Decomposition of Integral Flows #

Decomposes a feasible integral s-t flow on a Cslib.Algorithms.Lean.MaxFlow.Network into simple s-t paths along positive-flow arcs: a flow of value k contains k simple s-t paths such that each arc (u, v) lies on at most f u v of them. The remaining flow is a circulation and is not recorded; this is the path half of the classical flow decomposition. Also provides cancellation of antiparallel flow, which keeps the value and leaves positive flow on at most one arc of each antiparallel pair. These are the ingredients for deriving Menger's theorem from the integral max-flow/min-cut theorem (CslibFrontier.Algorithms.Lean.MaxFlow.Menger).

Main definitions #

Main results #

p is a simple s-t path of N along arcs carrying positive flow f.

theorem Cslib.Algorithms.Lean.MaxFlow.Network.Flow.exists_isFlowPath {V : Type u_1} [Fintype V] {N : Network V} (f : N.Flow) (hpos : 0 < f.value) :
∃ (p : List V), f.IsFlowPath p

A flow of positive value has a flow path. If f.value > 0, some simple s-t path uses only arcs with positive flow.

theorem Cslib.Algorithms.Lean.MaxFlow.Network.Flow.exists_flowPaths {V : Type u_1} [Fintype V] {N : Network V} [DecidableEq V] (f : N.Flow) :
∃ (P : Fin f.value.toNat → List V), (∀ (i : Fin f.value.toNat), f.IsFlowPath (P i)) ∧ ∀ (u v : V), {i : Fin f.value.toNat | (u, v) ∈ (P i).consecutivePairs}.card ≤ f.toFun u v

Flow decomposition into paths (path part of the classical flow decomposition): a feasible integral flow f of value k contains k simple s-t paths along positive-flow arcs such that every arc (u, v) lies on at most f u v of them. (The remaining flow consists of circulations, which are not recorded. If N.s = N.t, then k = 0.)

Cancel antiparallel flow: subtract min (f u v) (f v u) from both f u v and f v u.

theorem Cslib.Algorithms.Lean.MaxFlow.Network.Flow.cancel_apply {V : Type u_1} [Fintype V] {N : Network V} (f : N.Flow) (u v : V) :
f.cancel.toFun u v = f.toFun u v - min (f.toFun u v) (f.toFun v u)
theorem Cslib.Algorithms.Lean.MaxFlow.Network.Flow.cancel_le {V : Type u_1} [Fintype V] {N : Network V} (f : N.Flow) (u v : V) :
f.cancel.toFun u v ≤ f.toFun u v