Odd cycle transversal by iterative compression #
Cslib.Algorithms.Lean.IterativeCompression.oct G k decides whether a simple graph G on Fin n
has an odd cycle transversal (SimpleGraph.IsOddCycleTransversal) of at most k vertices. When
one exists it returns one, together with a Boolean colouring that is proper on the edges outside
it. This is the iterative compression algorithm of Reed, Smith and Vetta [RSV04], with
the three-way guess of [Hueffner2009, Section 3] and [CyganEtAl2015, Section 4.4].
Algorithm #
Iteration (Cslib.Algorithms.Lean.IterativeCompression.loop). The vertices are added one at a
time. The state after i vertices is an odd cycle transversal S, |S| ≤ k, of the subgraph
prefixGraph G i spanned by the first i vertices, with a colouring proper off S. Adding
vertex i to S gives an odd cycle transversal W of prefixGraph G (i + 1). If |W| ≤ k, it
is the new state. Otherwise |W| = k + 1 and the compression step either shrinks W to at most
k vertices or proves that prefixGraph G (i + 1) has no odd cycle transversal of at most k
vertices. Then neither has G, and the algorithm stops.
Compression (Cslib.Algorithms.Lean.IterativeCompression.compress). Given W and a colouring
c₀ proper off W, enumerate the 3 ^ |W| guesses g : Fin n → Option Bool that are none
off W (Cslib.Algorithms.Lean.IterativeCompression.guesses). A vertex w ∈ W with
g w = none is deleted, and g w = some b colours it b. For a guess that is proper on the kept
part of W, compute a minimum separator X of the keep terminals from the flip terminals in
G - W. Accept if the deleted part of W and X together have at most k vertices. Correctness
is the compression lemma SimpleGraph.exists_isOddCycleTransversal_card_le_iff and its two
directions.
This module defines the pure mathematical algorithm and proves its soundness and completeness; the
Word-RAM running-time theorem lives in CslibFrontier.Algorithms.WordRAM.OddCycleTransversal.
Main definitions #
Cslib.Algorithms.Lean.IterativeCompression.prefixGraph: the subgraph on the firstmvertices.Cslib.Algorithms.Lean.IterativeCompression.IsProperOff: a colouring vector is proper on the edges outside a list of vertices.Cslib.Algorithms.Lean.IterativeCompression.guesses: the3 ^ |W|guesses onW.Cslib.Algorithms.Lean.IterativeCompression.leaf: one guess, solved by a minimum separator.Cslib.Algorithms.Lean.IterativeCompression.compress: the compression step.Cslib.Algorithms.Lean.IterativeCompression.step,Cslib.Algorithms.Lean.IterativeCompression.loop: one step of the iteration, and the iteration.Cslib.Algorithms.Lean.IterativeCompression.oct: odd cycle transversal of size at mostk.
Main results #
Cslib.Algorithms.Lean.IterativeCompression.length_guesses,Cslib.Algorithms.Lean.IterativeCompression.mem_guesses: the guesses are exactly theOption Boollabellings that arenoneoffW, and there are3 ^ |W|of them.Cslib.Algorithms.Lean.IterativeCompression.compress_sound,Cslib.Algorithms.Lean.IterativeCompression.compress_complete: the compression step.Cslib.Algorithms.Lean.IterativeCompression.oct_sound,Cslib.Algorithms.Lean.IterativeCompression.oct_isOddCycleTransversal,Cslib.Algorithms.Lean.IterativeCompression.oct_eq_none,Cslib.Algorithms.Lean.IterativeCompression.oct_isSome_iff: correctness.
References #
Prefix subgraphs #
The subgraph of G spanned by the vertices 0, …, m - 1. The other vertices are isolated.
Guesses #
Terminal tables #
The keep terminals of a guess g relative to the colouring c₀: the vertices v ∉ W with a
neighbour w ∈ W such that g w = some b and b ≠ c₀ v.
The flip terminals of a guess g relative to the colouring c₀: the vertices v ∉ W with a
neighbour w ∈ W such that g w = some b and b = c₀ v.
The compression step #
A colouring c is proper on the edges of G with both endpoints outside S.
One leaf of the compression step: the guess g on W. If g is proper on the kept part of
W, compute a minimum separator of its keep terminals from its flip terminals in G - W, and
accept if the deleted part of W and the separator have at most k vertices together.
Compression step. Given an odd cycle transversal W of G with a colouring c₀ proper
off W, look for an odd cycle transversal of at most k vertices: run leaf on the
3 ^ |W| guesses on W.
Compression step, soundness. An output of compress is an odd cycle transversal of at most
k vertices, without repetitions, with a colouring proper off it.
Compression step, completeness. If compress finds nothing, then every odd cycle
transversal of G has more than k vertices.
The iteration #
One step of the iteration: add vertex i to the odd cycle transversal S of
prefixGraph G i, and compress if the result has k + 1 vertices.
The first i steps of the iteration, starting from ∅ and the all-false colouring.
Odd cycle transversal by iterative compression [RSV04] [Huf09]: an odd
cycle transversal of G with at most k vertices and a colouring proper off it, or none if
there is no such transversal.
Soundness. An output (S, c) of oct has no repetitions, at most k vertices, and c
is proper on the edges of G outside S.
Completeness. If oct returns none, every odd cycle transversal of G has more than
k vertices.
Correctness. oct G k succeeds exactly when G has an odd cycle transversal of at most
k vertices.