Documentation

CslibFrontier.Algorithms.WordRAM.EdmondsKarp.UniformVertexSeparator

Uniform Word-RAM program for minimum vertex separators #

Uniform Basis.exact flat program and O((n + 1) ^ 5) runtime bound for minimum vertex separators with side-labelling certificates (exists_minSeparator_program) by vertex splitting and reduction to ekProg.

Main definitions #

Main results #

References #

Uniform minimum vertex separator by vertex splitting #

Encode a Boolean vector of length n as n words (1 for true, 0 for false).

Word-RAM input for minimum vertex separator: n :: (encodeBoolVec Z ++ encodeBoolVec A ++ encodeBoolVec B ++ flattenMatrix (fun u v => if G.Adj u v then 1 else 0)). Address 1 stores n; 2 + v stores Z[v]; 2 + n + v stores A[v]; 2 + 2 * n + v stores B[v]; and 2 + 3 * n + u * n + v stores G.Adj u v.

Output address of the separator indicator for v (1 iff v ∈ out.sep).

Output address of the side-labelling indicator for v (1 iff vget out.side v = true).

theorem Cslib.Algorithms.WordRAM.EdmondsKarp.exists_minSeparator_program :
∃ (R : ℕ) (C : ℕ) (pc : ℕ), 0 < C ∧ ∃ (prog : WordRAM.Program WordRAM.Basis.exact R), ∀ {n w : ℕ} (G : SimpleGraph (Fin n)) [inst : DecidableRel G.Adj] (Z A B : Vector Bool n), WordRAM.Fits w (ekBound (n + n + 2) (n + 1)) → ∃ (y : WordRAM.Data R) (steps : ℕ) (res : ℕ) (out : Lean.MaxFlow.SeparatorOutput n), WordRAM.Runs w prog (WordRAM.State.init (encodeSepInput G Z A B)) { pc := pc, data := y } steps ∧ WordRAM.step w prog { pc := pc, data := y } = WordRAM.Outcome.halt res ∧ steps + 1 ≤ C * (n + 1) ^ 5 ∧ out.sep.Nodup ∧ (∀ v ∈ out.sep, Lean.MaxFlow.vget Z v = false) ∧ G.IsSeparator {v : Fin n | Lean.MaxFlow.vget A v = true} {v : Fin n | Lean.MaxFlow.vget B v = true} ({v : Fin n | Lean.MaxFlow.vget Z v = true} ∪ {v : Fin n | v ∈ out.sep}) ∧ (∀ (Y : Finset (Fin n)), G.IsSeparator {v : Fin n | Lean.MaxFlow.vget A v = true} {v : Fin n | Lean.MaxFlow.vget B v = true} ({v : Fin n | Lean.MaxFlow.vget Z v = true} ∪ ↑Y) → out.sep.length ≤ Y.card) ∧ (∀ {u v : Fin n}, G.Adj u v → Lean.MaxFlow.vget Z u = false → Lean.MaxFlow.vget Z v = false → u ∉ out.sep → v ∉ out.sep → Lean.MaxFlow.vget out.side u = Lean.MaxFlow.vget out.side v) ∧ (∀ {v : Fin n}, Lean.MaxFlow.vget A v = true → Lean.MaxFlow.vget Z v = false → v ∉ out.sep → Lean.MaxFlow.vget out.side v = true) ∧ (∀ {v : Fin n}, Lean.MaxFlow.vget B v = true → Lean.MaxFlow.vget out.side v = false) ∧ res = out.sep.length ∧ (∀ (v : Fin n), y.mem (sepOutAddr n ↑v) = if v ∈ out.sep then 1 else 0) ∧ ∀ (v : Fin n), y.mem (sepSideAddr n ↑v) = if Lean.MaxFlow.vget out.side v = true then 1 else 0

Minimum vertex separator by vertex splitting on the Word-RAM: one uniform flat program over Basis.exact that, on encodeSepInput G Z A B for any G : SimpleGraph (Fin n) and Z A B : Vector Bool n, halts within C * (n + 1) ^ 5 instructions at every word width fitting ekBound (n + n + 2) (n + 1). It returns the minimum separator size out.sep.length, stores the 0/1 separator indicator at sepOutAddr, and stores the side labelling certificate out.side at sepSideAddr.