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):
- Outer vertex-addition loop (
octStep,m = 0 .. n - 1): formsW = S ∪ {m}and compactsWintowListBase. When|W| ≤ k,Wis accepted directly; otherwise|W| = k + 1andcompressProgenumerates all3 ^ |W|three-way guesses onWvia a base-3 odometer. - Compression leaf (
leafProg) and unit-capacity vertex-split max-flow (minSepProg): checks properness on the kept part ofW, marks keep and flip terminals outsideW, runsnrounds of layered BFS + unit augmentation on the(2n + 2)-vertex split network, extracts the minimum vertex separator from the final residual reachable cut, and commitsD ∪ Xand 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 #
Cslib.Algorithms.WordRAM.OddCycleTransversal.encodeAdjMatrix,Cslib.Algorithms.WordRAM.OddCycleTransversal.encodeInput: row-major0/1adjacency matrix and prefixed input word listn :: k :: encodeAdjMatrix G, with the layout lemmaslength_encodeAdjMatrix,length_encodeInputandgetElem_encodeAdjMatrix.Cslib.Algorithms.WordRAM.OddCycleTransversal.sepAddr,Cslib.Algorithms.WordRAM.OddCycleTransversal.colAddr,Cslib.Algorithms.WordRAM.OddCycleTransversal.octWorkspace: output transversal/colouring cell addresses and total memory frontier5 * n ^ 2 + 21 * n + 11.Cslib.Algorithms.WordRAM.OddCycleTransversal.OctInstance,Cslib.Algorithms.WordRAM.OddCycleTransversal.OctInstance.encode,Cslib.Algorithms.WordRAM.OddCycleTransversal.OctInstance.Yes: packaged decision instances, encoding, and yes-set forUniformDecidableInTime.
Main results #
Cslib.Algorithms.WordRAM.OddCycleTransversal.exists_oct_program: a single uniform flat program overBasis.exactdecides whetherGhas an odd cycle transversal of size at mostkwithinC * 3 ^ k * (n + 1) ^ 5instructions wheneverFits w (octWorkspace n)andFits w k, and on yes-instances materializes a valid transversal of size≤ kand a proper2-colouring off it in final machine memory.Cslib.Algorithms.WordRAM.OddCycleTransversal.uniformDecidableInTime_oct,Cslib.Algorithms.WordRAM.OddCycleTransversal.uniformDecidableInTimeLogWord_oct: uniform FPTO(3 ^ k · n ^ 5)decision certificates under explicit workspace fit and under the transdichotomous logarithmic word-size convention.
References #
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 #
Word-RAM encoding of an OctInstance as encodeInput x.G x.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).