Documentation

CslibFrontier.Foundations.Combinatorics.SimpleGraph.OddCycleTransversal

Odd cycle transversals and the compression lemma #

An odd cycle transversal of a simple graph G is a set S of vertices whose deletion leaves a bipartite graph (SimpleGraph.IsOddCycleTransversal): the subgraph induced on Sᶜ is IsBipartite, that is, 2-colourable. Equivalently, some Boolean colouring of G is proper on the edges outside S (SimpleGraph.isOddCycleTransversal_iff_exists_bool), or every closed walk of odd length visits S (SimpleGraph.isOddCycleTransversal_iff_forall_odd_walk). The last form explains the name: a closed walk of odd length contains an odd cycle on its vertices.

The compression lemma #

Iterative compression for odd cycle transversal [RSV04] [CyganEtAl2015, Section 4.4] starts from an odd cycle transversal W with a colouring c₀ that is proper off W, and asks for an odd cycle transversal of at most k vertices. Guess the part D ⊆ W of the new solution inside W and a colouring σ of W that is proper off D. A vertex v ∉ W adjacent to w ∈ W \ D must, if it survives, receive the colour !σ w. Relative to c₀, it keeps its colour when σ w ≠ c₀ v (SimpleGraph.OddCycleTransversal.keepTerminals), and flips it when σ w = c₀ v (SimpleGraph.OddCycleTransversal.flipTerminals). The edges of G - W join vertices of opposite c₀-colours, so along a walk of G - W a vertex keeps its colour exactly when its neighbour does.

The guess extends to a solution D ∪ X with X ∩ W = ∅ exactly when X separates the keep terminals from the flip terminals in G - W, that is, when W ∪ X separates them in G (SimpleGraph.exists_isOddCycleTransversal_card_le_iff):

There are 3 ^ |W| guesses: each vertex of W is deleted or receives one of two colours. This three-way count is the analysis of [Hueffner2009, Section 3]. The case D = ∅ corresponds to [Hueffner2009, Lemma 2], which subdivides the edges at W first and phrases the guess as a valid colouring of the neighbours of W; here σ colours W directly and no subdivision is needed. The minimum separator of each guess is a minimum vertex cut, computed in Cslib.Algorithms.Lean.IterativeCompression.OddCycleTransversal. The statement here is combinatorial; W is any odd cycle transversal, and |W| = k + 1 only matters for the running time.

Main definitions #

Main results #

References #

S is an odd cycle transversal of G: the subgraph induced on the complement of S is bipartite.

theorem SimpleGraph.isOddCycleTransversal_iff_exists_bool {V : Type u_1} {G : SimpleGraph V} {S : Set V} :
G.IsOddCycleTransversal S ↔ ∃ (c : V → Bool), ∀ ⦃u v : V⦄, G.Adj u v → u ∉ S → v ∉ S → c u ≠ c v

S is an odd cycle transversal exactly when some Boolean colouring of G is proper on the edges with both endpoints outside S.

theorem SimpleGraph.isOddCycleTransversal_iff_forall_odd_walk {V : Type u_1} {G : SimpleGraph V} {S : Set V} :
G.IsOddCycleTransversal S ↔ ∀ (u : V) (p : G.Walk u u), Odd p.length → ∃ x ∈ p.support, x ∈ S

S is an odd cycle transversal exactly when every closed walk of odd length visits S.

theorem SimpleGraph.IsOddCycleTransversal.mono {V : Type u_1} {G : SimpleGraph V} {S T : Set V} (h : G.IsOddCycleTransversal S) (hST : S ⊆ T) :

∅ is an odd cycle transversal exactly when G is bipartite.

def SimpleGraph.OddCycleTransversal.keepTerminals {V : Type u_1} (G : SimpleGraph V) (W D : Set V) (σ c₀ : V → Bool) :
Set V

The vertices outside W that keep their c₀-colour under the guess (D, σ): those with a neighbour w ∈ W \ D such that σ w ≠ c₀ v.

def SimpleGraph.OddCycleTransversal.flipTerminals {V : Type u_1} (G : SimpleGraph V) (W D : Set V) (σ c₀ : V → Bool) :
Set V

The vertices outside W that flip their c₀-colour under the guess (D, σ): those with a neighbour w ∈ W \ D such that σ w = c₀ v.

theorem SimpleGraph.OddCycleTransversal.mem_keepTerminals {V : Type u_1} {G : SimpleGraph V} {W D : Set V} {σ c₀ : V → Bool} {v : V} :
v ∈ keepTerminals G W D σ c₀ ↔ v ∉ W ∧ ∃ w ∈ W, w ∉ D ∧ G.Adj w v ∧ σ w ≠ c₀ v
theorem SimpleGraph.OddCycleTransversal.mem_flipTerminals {V : Type u_1} {G : SimpleGraph V} {W D : Set V} {σ c₀ : V → Bool} {v : V} :
v ∈ flipTerminals G W D σ c₀ ↔ v ∉ W ∧ ∃ w ∈ W, w ∉ D ∧ G.Adj w v ∧ σ w = c₀ v
theorem SimpleGraph.OddCycleTransversal.isSeparator_of_proper {V : Type u_1} {G : SimpleGraph V} {S W : Set V} {c₀ c σ : V → Bool} (hc₀ : ∀ ⦃u v : V⦄, G.Adj u v → u ∉ W → v ∉ W → c₀ u ≠ c₀ v) (hc : ∀ ⦃u v : V⦄, G.Adj u v → u ∉ S → v ∉ S → c u ≠ c v) (hσ : ∀ w ∈ W, w ∉ S → σ w = c w) :
G.IsSeparator (keepTerminals G W (S ∩ W) σ c₀) (flipTerminals G W (S ∩ W) σ c₀) (W ∪ S)

Compression lemma, solution to separator. Let c₀ be proper off W and c proper off S. Take D = S ∩ W and any σ agreeing with c on W \ S. Then W ∪ S separates the keep terminals from the flip terminals of (D, σ): along a walk of G - (W ∪ S) both colourings are proper, so c v = c₀ v holds at one end exactly when it holds at the other.

theorem SimpleGraph.OddCycleTransversal.proper_of_side {V : Type u_1} {G : SimpleGraph V} {W D X : Set V} {c₀ σ side c : V → Bool} (hc₀ : ∀ ⦃u v : V⦄, G.Adj u v → u ∉ W → v ∉ W → c₀ u ≠ c₀ v) (hσ : ∀ ⦃u v : V⦄, G.Adj u v → u ∈ W → v ∈ W → u ∉ D → v ∉ D → σ u ≠ σ v) (hside : ∀ ⦃u v : V⦄, G.Adj u v → u ∉ W → v ∉ W → u ∉ X → v ∉ X → side u = side v) (hkeep : ∀ v ∈ keepTerminals G W D σ c₀, v ∉ X → side v = true) (hflip : ∀ v ∈ flipTerminals G W D σ c₀, v ∉ X → side v = false) (hcW : ∀ v ∈ W, c v = σ v) (hcW' : ∀ v ∉ W, c v = (c₀ v == side v)) ⦃u v : V⦄ :
G.Adj u v → u ∉ D ∪ X → v ∉ D ∪ X → c u ≠ c v

Compression lemma, separator to solution. Let c₀ be proper off W, let σ be proper on W \ D, and let side be constant along the edges of G - (W ∪ X), true on the keep terminals outside X and false on the flip terminals outside X. Then any colouring c that follows σ on W and keeps (side v = true) or flips (side v = false) the colour c₀ v outside W is proper off D ∪ X.

theorem SimpleGraph.exists_isOddCycleTransversal_card_le_iff {V : Type u_1} {G : SimpleGraph V} {W : Finset V} {c₀ : V → Bool} (hc₀ : ∀ ⦃u v : V⦄, G.Adj u v → u ∉ W → v ∉ W → c₀ u ≠ c₀ v) (k : ℕ) :
(∃ (S : Finset V), G.IsOddCycleTransversal ↑S ∧ S.card ≤ k) ↔ ∃ (D : Finset V) (X : Finset V) (σ : V → Bool), D ⊆ W ∧ Disjoint X W ∧ (∀ ⦃u v : V⦄, G.Adj u v → u ∈ W → v ∈ W → u ∉ D → v ∉ D → σ u ≠ σ v) ∧ G.IsSeparator (OddCycleTransversal.keepTerminals G (↑W) (↑D) σ c₀) (OddCycleTransversal.flipTerminals G (↑W) (↑D) σ c₀) (↑W ∪ ↑X) ∧ D.card + X.card ≤ k

Compression lemma [RSV04] [Hueffner2009, Lemma 2] [CyganEtAl2015, Section 4.4]. Let W be a set with a colouring c₀ that is proper off W. Then G has an odd cycle transversal of at most k vertices exactly when there are D ⊆ W, a colouring σ proper on W \ D, and X disjoint from W such that W ∪ X separates the keep terminals from the flip terminals of (D, σ) and |D| + |X| ≤ k. [Hueffner2009, Lemma 2] is the disjoint case D = ∅, after subdividing the edges at W.