Documentation

CslibFrontier.Algorithms.WordRAM.EdmondsKarp.Internal

Internal subroutines, realization, frames, and distance relation for Edmonds–Karp #

Cross-submodule internal subroutines (capAddr, flowAddr, predAddr, readResCap, bfsInnerStep..cutOuterStep), exact-basis realization proofs, state-preservation lemmas, and the DistRel distance invariant for Cslib.Algorithms.WordRAM.EdmondsKarp. Imported privately by Bounds, BfsSemantics, Spec, and UniformBipartite so none of these helpers enter CslibFrontier.Algorithms.WordRAM.EdmondsKarp's public API.

Internal addresses and subroutines #

@[reducible, inline]

Address of the capacity W u v.

@[reducible, inline]

Address of the flow on the arc (u, v).

@[reducible, inline]

Address of the breadth-first-search parent of x.

Residual capacity W u v - f u v + f v u of the arc (u, v) (d = ((c, u), v)), guarded to be at most 2 * B.

Innermost step of the search (d = (((c, layer), u), v)): reach v from u at distance layer + 1 when v is unreached and (u, v) has residual capacity.

Middle step of the search (d = ((c, layer), u)): expand u if it lies in layer layer.

Layered breadth-first search from s (d = (c, s)) on the residual graph of the stored flow.

One step of the bottleneck walk (d = (c, (cur, δ))): move to the parent p of cur and take the minimum of δ and the residual capacity of (p, cur).

One step of the augmentation walk (d = ((c, δ), cur)): push δ units along the arc (p, cur) from the parent p of cur, cancelling flow on (cur, p) first.

One round (d = ((c, (s, t)), flag), flag = 0 while running): search, and if t is reached, compute the bottleneck of the found path and push it. Returns 1 once t is not reached.

Inner step of the cut sum (d = ((c, u), (v, acc))): add W u v when v is unreached.

Outer step of the cut sum (d = (c, (u, acc))): add the capacities from u to the unreached vertices when u is reached.

Client result equations #

Realization (Realizes) for internal subroutines #

State preservation and distance-monotonicity relation #

Between t and t', every distance below n either is unchanged or went from n (unreached) to layer + 1.

theorem Cslib.Algorithms.WordRAM.EdmondsKarp.Internal.DistRel.trans {c : Ctx} {layer : ℕ} {t₁ t₂ t₃ : DataStructure.Memory.State} (h₁ : DistRel c layer t₁ t₂) (h₂ : DistRel c layer t₂ t₃) :
DistRel c layer t₁ t₃