RAM core of Baker's shifting: best of k masked solver runs
ProvedWilliamsonShmoys.baker_masked_best_of_runs_ramLet solver be a unit-cost RAM program (in the instruction set of the mission) that solves maximum weight independent set exactly. On every instance whose graph has tree-width at most , it halts within operations and writes an independent set of maximum weight as an output bitmap.
Then there is one RAM program and constants with the following property. For every and every instance , write for the Baker BFS level (bakerLevel) and, for , write for the graph on all vertices that keeps exactly the edges of with both ends of level . Assume every has tree-width at most . Then the program halts within operations, its output bitmap encodes an independent set of , and for every and every independent set of
This is the RAM core of Baker's shifting technique (Williamson–Shmoys, Section 10.2, pp. 270–271). For each , compute the BFS levels, mask the instance (delete the level- edges and zero the level- weights), run solver with parameter , discard the level- vertices from its answer, and keep the best of the candidates. The solver runs cost operations, and BFS, masking and copying cost .
Formalization Note. The masked graph is SimpleGraph.fromRel (fun u v => G.Adj u v ∧ L u % k ≠ j ∧ L v % k ≠ j). The weight on the left is the masked weight, which is on level- vertices.
import Definitions.Def_WilliamsonShmoys_PlanarIndependentSetRAM import Definitions.Def_WilliamsonShmoys_BakerLevel import Definitions.Def_RobertsonSeymour1986_GM5_TreewidthLE set_option autoImplicit false open scoped BigOperators
theorem WilliamsonShmoys.baker_masked_best_of_runs_ram
(solver : List WilliamsonShmoys.PlanarRAMInstruction) (C₀ d₀ : ℕ) (hC₀ : 0 < C₀) (hd₀ : 0 < d₀)
(hsolver : ∀ (w n : ℕ) (edge : Fin n → Fin n → Bool) (weight : Fin n → ℝ),
let G := SimpleGraph.fromRel (fun u v => edge u v = true)
RobertsonSeymour1986.GM5.TreewidthLE G w →
∃ t : ℕ, t + 1 ≤ C₀ * 2 ^ (d₀ * w) * (n + 1) ^ 2 ∧
let result := WilliamsonShmoys.planarRAMRun solver (WilliamsonShmoys.planarRAMInput n w edge weight) t
solver[result.pc]? = some WilliamsonShmoys.PlanarRAMInstruction.halt ∧
(∀ i : Fin n, result.natMem (2 + n * n + i.val) ≤ 1) ∧
G.IsIndepSet (WilliamsonShmoys.planarRAMOutput n result : Set (Fin n)) ∧
∀ S : Finset (Fin n), G.IsIndepSet (S : Set (Fin n)) →
∑ i ∈ S, weight i ≤ ∑ i ∈ WilliamsonShmoys.planarRAMOutput n result, weight i) :
∃ (program : List WilliamsonShmoys.PlanarRAMInstruction) (C d : ℕ),
0 < C ∧ 0 < d ∧
∀ (k : ℕ), 0 < k →
∀ (n : ℕ) (edge : Fin n → Fin n → Bool) (weight : Fin n → ℝ),
let G := SimpleGraph.fromRel (fun u v => edge u v = true)
(∀ j < k, RobertsonSeymour1986.GM5.TreewidthLE
(SimpleGraph.fromRel (fun u v => G.Adj u v ∧
WilliamsonShmoys.bakerLevel G u % k ≠ j ∧ WilliamsonShmoys.bakerLevel G v % k ≠ j))
(3 * k)) →
∃ t : ℕ, t + 1 ≤ C * 2 ^ (d * k) * (n + 1) ^ 2 ∧
let result := WilliamsonShmoys.planarRAMRun program (WilliamsonShmoys.planarRAMInput n k edge weight) t
program[result.pc]? = some WilliamsonShmoys.PlanarRAMInstruction.halt ∧
(∀ i : Fin n, result.natMem (2 + n * n + i.val) ≤ 1) ∧
G.IsIndepSet (WilliamsonShmoys.planarRAMOutput n result : Set (Fin n)) ∧
∀ j < k, ∀ S : Finset (Fin n),
(SimpleGraph.fromRel (fun u v => G.Adj u v ∧
WilliamsonShmoys.bakerLevel G u % k ≠ j ∧ WilliamsonShmoys.bakerLevel G v % k ≠ j)).IsIndepSet
(S : Set (Fin n)) →
∑ i ∈ S, (if WilliamsonShmoys.bakerLevel G i % k ≠ j then weight i else 0) ≤
∑ i ∈ WilliamsonShmoys.planarRAMOutput n result, weight i := by sorry