Documentation

CslibFrontier.Algorithms.WordRAM.OddCycleTransversal

Odd cycle transversal by iterative compression on the Word-RAM #

Implements the iterative-compression odd-cycle-transversal algorithm of Reed, Smith and Vetta [ReedSmithVetta2004] with Hüffner's three-way compression branching [Hueffner2009] and [CyganEtAl2015, Section 4.4] as a single uniform flat program over Cslib.WordRAM.Basis.exact. Basis.exact supplies unit-cost multiplication for the n × n adjacency matrix and (2n + 2) × (2n + 2) split-network flow matrix index arithmetic.

Overview #

Given an n-vertex simple graph G serialized in State.init (encodeInput G k) (n :: k :: encodeAdjMatrix G), the program allocates workspace up to octWorkspace n = 5 * n ^ 2 + 21 * n + 11 and maintains a 0/1 indicator of an odd cycle transversal S of prefixGraph G m (|S| ≤ k) at sepAddr n 0 .. sepAddr n (n - 1) together with a proper Boolean colouring off S at colAddr n 0 .. colAddr n (n - 1):

  1. Outer vertex-addition loop (octStep, m = 0 .. n - 1): forms W = S ∪ {m} and compacts W into wListBase. When |W| ≤ k, W is accepted directly; otherwise |W| = k + 1 and compressProg enumerates all 3 ^ |W| three-way guesses on W via a base-3 odometer.
  2. Compression leaf (leafProg) and unit-capacity vertex-split max-flow (minSepProg): checks properness on the kept part of W, marks keep and flip terminals outside W, runs n rounds of layered BFS + unit augmentation on the (2n + 2)-vertex split network, extracts the minimum vertex separator from the final residual reachable cut, and commits D ∪ X and the updated colouring when |D| + |X| ≤ k.

The implementation is factored under CslibFrontier.Algorithms.WordRAM.OddCycleTransversal into Layout (pure input encoding and workspace offsets; publicly re-exported here), Range, NetworkProg, CompressProg, parallel verification modules MinSep, Validity, Cost, and LeafSubroutines, CompressSpec, and Outer (all imported privately here so downstream callers load only the slim public API).

Main definitions #

Main results #

References #

theorem Cslib.Algorithms.WordRAM.OddCycleTransversal.exists_oct_program :
∃ (r : ℕ) (C : ℕ) (pc : ℕ), 0 < C ∧ ∃ (prog : WordRAM.Program WordRAM.Basis.exact r), ∀ {n : ℕ} (G : SimpleGraph (Fin n)) [inst : DecidableRel G.Adj] (k w : ℕ), WordRAM.Fits w (octWorkspace n) → WordRAM.Fits w k → ∃ (y : WordRAM.Data r) (steps : ℕ) (res : ℕ), WordRAM.Runs w prog (WordRAM.State.init (encodeInput G k)) { pc := pc, data := y } steps ∧ WordRAM.step w prog { pc := pc, data := y } = WordRAM.Outcome.halt res ∧ steps + 1 ≤ C * 3 ^ k * (n + 1) ^ 5 ∧ res ≤ 1 ∧ (res = 1 ↔ (Lean.IterativeCompression.oct G k).isSome = true) ∧ (res = 1 ↔ ∃ (T : Finset (Fin n)), G.IsOddCycleTransversal ↑T ∧ T.card ≤ k) ∧ (res = 1 → (∀ (v : Fin n), y.mem (sepAddr n ↑v) ≤ 1 ∧ y.mem (colAddr n ↑v) ≤ 1) ∧ have S := {v : Fin n | y.mem (sepAddr n ↑v) = 1}; G.IsOddCycleTransversal ↑S ∧ S.card ≤ k ∧ ∀ (u v : Fin n), G.Adj u v → u ∉ S → v ∉ S → (y.mem (colAddr n ↑u) == 1) ≠ (y.mem (colAddr n ↑v) == 1))

Word-RAM odd cycle transversal by iterative compression: a single uniform flat program over Basis.exact decides whether an n-vertex simple graph G has an odd cycle transversal of size at most k within C * 3 ^ k * (n + 1) ^ 5 instructions whenever Fits w (octWorkspace n) and Fits w k, agreeing with Cslib.Algorithms.Lean.IterativeCompression.oct and materializing a valid transversal at sepAddr n and a proper Boolean colouring off it at colAddr n on yes-instances.

Packaged decision problem and UniformDecidableInTime certificates #

Packaged instance of the parameterized odd-cycle-transversal decision problem: a simple graph G on Fin n with decidable adjacency together with parameter k.

The yes-instances of OctInstance: graphs admitting an odd cycle transversal of size ≤ k.

Uniform FPT Word-RAM decision for odd cycle transversal at every word width fitting octWorkspace x.n.

Uniform FPT Word-RAM decision for odd cycle transversal under the transdichotomous logarithmic word-size convention (size x = x.encode.length).