Out-arborescence transpose loader and edmondsOutProg entry (internal) #
Implements matrix transposition (transposeProg) and edmondsOutProg, reusing finishArbProg
on the transposed graph and cost table, with Realizes .exact and O(n³) specifications.
Word-RAM entry program solving rooted minimum-cost spanning out-arborescence for (n, root)
by transposing the input matrices into the workspace and running finishArbProg.
def Cslib.Algorithms.WordRAM.Arborescence.Internal.EdmondsOutProgSafe (w : ℕ) (d : ℕ × ℕ) (s₀ : DataStructure.Memory.State) :
Safety precondition for edmondsOutProg.
theorem Cslib.Algorithms.WordRAM.Arborescence.Internal.edmondsOutProg_spec {w M₀ : ℕ} (I : ArborescenceInput) (hM : ∀ (u v : Fin I.n), (I.cost u v).natAbs ≤ M₀) (hwb : WordRAM.Fits w (wordBound I.n M₀)) :
have s₀ := DataStructure.Memory.State.init I.encode;
have d := (I.n, ↑I.root);
have outAddr := (DataStructure.Memory.spec 0).clientResult s₀ (edmondsOutProg d);
have s' := (DataStructure.Memory.spec 0).clientState s₀ (edmondsOutProg d);
EdmondsOutProgSafe w d s₀ ∧ (DataStructure.Memory.spec w).ValidHistory s₀ ((DataStructure.Memory.spec w).clientHistory s₀ (edmondsOutProg d)) ∧ WordRAM.Realization.memoryCost (edmondsOutProg d) s₀ ≤ 43 * I.n ^ 3 + 22 * I.n ^ 2 + 9 * I.n + 3 ∧ WordRAM.outputList s'.mem outAddr = I.expectedOutParentList ∧ WordRAM.Fits w (outAddr + I.expectedOutParentList.length)