Documentation

CslibFrontier.Algorithms.Lean.GomoryHu.Oracles

Gomory–Hu trees from push–relabel and Dinitz cut oracles #

Gusfield's construction (gusfieldWithWeights) takes any oracle returning a minimum s–t cut and its value. This module packages the construction for an arbitrary correct oracle as an Output (parent array and edge weights) and instantiates it with the generic push–relabel algorithm and with Dinitz's algorithm on dense networks, complementing the Edmonds–Karp instance gomoryHu of Construction.lean.

Main definitions #

Main results #

No running time is stated here; CslibFrontier.Algorithms.WordRAM.GomoryHu gives a Word-RAM running time for the Edmonds–Karp version.

References #

Gusfield's construction for an arbitrary cut oracle #

def Cslib.Algorithms.Lean.GomoryHu.gusfieldOutput {n : ℕ} (C : Fin n → Fin n → Finset (Fin n)) (val : Fin n → Fin n → ℕ) (r : Fin n) :

Gusfield's construction rooted at r for the cut oracle C and value oracle val, returning the parent array and the edge weights (0 at the root).

theorem Cslib.Algorithms.Lean.GomoryHu.vget_gusfieldOutput_parent {n : ℕ} (C : Fin n → Fin n → Finset (Fin n)) (val : Fin n → Fin n → ℕ) (r : Fin n) :
theorem Cslib.Algorithms.Lean.GomoryHu.vget_gusfieldOutput_weight_eq {n : ℕ} (C : Fin n → Fin n → Finset (Fin n)) (val : Fin n → Fin n → ℕ) (r : Fin n) :
theorem Cslib.Algorithms.Lean.GomoryHu.isGomoryHuTree_gusfieldOutput {n : ℕ} {W : Fin n → Fin n → ℕ} {C : Fin n → Fin n → Finset (Fin n)} {val : Fin n → Fin n → ℕ} (hW : WeightedCut.IsMultigraph W) (hC : ∀ (s t : Fin n), s ≠ t → IsMinCutBetween (WeightedCut.cutWeight W) s t (C s t)) (hval : ∀ (s t : Fin n), s ≠ t → val s t = WeightedCut.cutWeight W (C s t)) (r : Fin n) :

Correctness of Gusfield's construction ([Gus90]) for any oracle C returning minimum cuts: the parent array of gusfieldOutput is a Gomory–Hu tree.

theorem Cslib.Algorithms.Lean.GomoryHu.vget_gusfieldOutput_weight {n : ℕ} {W : Fin n → Fin n → ℕ} {C : Fin n → Fin n → Finset (Fin n)} {val : Fin n → Fin n → ℕ} (hW : WeightedCut.IsMultigraph W) (hC : ∀ (s t : Fin n), s ≠ t → IsMinCutBetween (WeightedCut.cutWeight W) s t (C s t)) (hval : ∀ (s t : Fin n), s ≠ t → val s t = WeightedCut.cutWeight W (C s t)) (r : Fin n) {u : Fin n} (hu : u ≠ r) :

For any correct oracle, the weight that gusfieldOutput records at a non-root vertex u is the minimum cut weight λ(u, parent u) ([Gus90]).

The push–relabel oracle #

def Cslib.Algorithms.Lean.GomoryHu.pushRelabelCut {n : ℕ} (W : Fin n → Fin n → ℕ) (s t : Fin n) :

The minimum s–t cut returned by the generic push–relabel algorithm.

def Cslib.Algorithms.Lean.GomoryHu.pushRelabelValue {n : ℕ} (W : Fin n → Fin n → ℕ) (s t : Fin n) :

The maximum s–t flow value returned by the generic push–relabel algorithm.

Gusfield's construction with the push–relabel minimum cut oracle.

The Dinitz oracle #

def Cslib.Algorithms.Lean.GomoryHu.dinitzCut {n : ℕ} (W : Fin n → Fin n → ℕ) (s t : Fin n) :

The minimum s–t cut returned by Dinitz's algorithm on the dense network.

def Cslib.Algorithms.Lean.GomoryHu.dinitzValue {n : ℕ} (W : Fin n → Fin n → ℕ) (s t : Fin n) :

The maximum s–t flow value returned by Dinitz's algorithm on the dense network.

theorem Cslib.Algorithms.Lean.GomoryHu.dinitzValue_eq_cutWeight {n : ℕ} {W : Fin n → Fin n → ℕ} {s t : Fin n} (hst : s ≠ t) :
def Cslib.Algorithms.Lean.GomoryHu.dinitzGomoryHu {n : ℕ} (W : Fin n → Fin n → ℕ) (r : Fin n) :

Gusfield's construction with Dinitz's minimum cut oracle.