Documentation

CslibFrontier.Algorithms.WordRAM.Hungarian.Augment

Augmenting-path application and row-mate scatter (augmentCode) #

Internal O(n) subroutine flipping an augmenting path in colMate and rebuilding rowMate.

Augment matching along rj1's tree path, rebuild rowMate, and set augmented := 1.

theorem Cslib.Algorithms.WordRAM.Hungarian.exec_augmentCode {w n bC M W : ℕ} {C : Fin n × Fin n → ℕ} {r j₁ : Fin n} {s : Lean.MaxFlow.HgState n} {bestRow : Fin n → Fin n} (hSI : Lean.MaxFlow.HgStepInv (fun (p : Fin n × Fin n) => ↑(C p)) W r s bestRow) (hj₁ : Lean.MaxFlow.vget s.used j₁ = false) (hz : Lean.MaxFlow.vget s.minv j₁ = 0) (hfree : Lean.MaxFlow.vget s.mate j₁ = none) (x : WordRAM.Data 28) (hb : BaseRegs n bC M x) (hSM : StepMem bC s bestRow x.mem) (hrj1 : x.regs Reg.rj1 = ↑j₁) (hfit : WordRAM.Fits w (bC + n * n + 8 * n + 2 * W + 2)) :
∃ (y : WordRAM.Data 28), WordRAM.ExecWithin w augmentCode x y (22 * n + 10) ∧ (∀ (i : Fin 28), ↑i < 17 → y.regs i = x.regs i) ∧ y.regs Reg.augmented = 1 ∧ OuterMem bC s.y s.z (Lean.MaxFlow.hgApplyEdges s.mate (Lean.MaxFlow.vget s.path j₁)) y.mem ∧ ∀ (a : ℕ), ¬(bC + n * n + 2 * n ≤ a ∧ a < bC + n * n + 3 * n) ∧ ¬(bC + n * n + 7 * n + 1 ≤ a ∧ a < bC + n * n + 8 * n + 1) → y.mem a = x.mem a