Documentation

CslibFrontier.Algorithms.WordRAM.TreeDecomposition.IndependentSet.InstDP

Internal ℕ-indexed dynamic-programming helpers for MWISInstance #

Internal helper definitions and bag/parent indexing lemmas consumed privately by Model and the Word-RAM pass submodules (IndepScan, ChildPass, NodeLayout, RootPass, ProcessNodes, Runner); never re-exported through IndependentSet or IndependentSet.Model.

Main definitions #

Main results #

Test whether x is non-adjacent under adj to every selected vertex of L under mask m.

Test whether the vertices of L selected by mask m are pairwise non-adjacent under adj.

def Cslib.Algorithms.WordRAM.TreeDecomposition.childPassInst (adj : ℕ → ℕ → Bool) (wt : ℕ → ℕ) (LB LP : List ℕ) (f init : Array ℕ) :

Child-to-parent projection pass over ℕ vertex indices and Boolean relation adj.

theorem Cslib.Algorithms.WordRAM.TreeDecomposition.size_childPassInst (adj : ℕ → ℕ → Bool) (wt : ℕ → ℕ) (LB LP : List ℕ) (f init : Array ℕ) (c : ℕ) :
(childPassInst adj wt LB LP f init c).size = init.size

childPassInst preserves the size of init.

Final maximization pass at the root bag over ℕ vertex indices and Boolean relation adj.

def Cslib.Algorithms.WordRAM.TreeDecomposition.tablesInst (adj : ℕ → ℕ → Bool) (wt : ℕ → ℕ) (n : ℕ) (par : Fin (n + 1) → Fin (n + 1)) (bags : Fin (n + 1) → List ℕ) :
ℕ → Vector (Array ℕ) (n + 1)

Bottom-up node table state after processing t nonroot nodes n, n - 1, …, n + 1 - t.

theorem Cslib.Algorithms.WordRAM.TreeDecomposition.tablesInst_zero (adj : ℕ → ℕ → Bool) (wt : ℕ → ℕ) (n : ℕ) (par : Fin (n + 1) → Fin (n + 1)) (bags : Fin (n + 1) → List ℕ) :
tablesInst adj wt n par bags 0 = Vector.replicate (n + 1) #[]

Initial replicate state of tablesInst before processing nonroot nodes.

theorem Cslib.Algorithms.WordRAM.TreeDecomposition.tablesInst_succ (adj : ℕ → ℕ → Bool) (wt : ℕ → ℕ) (n : ℕ) (par : Fin (n + 1) → Fin (n + 1)) (bags : Fin (n + 1) → List ℕ) (t : ℕ) :
tablesInst adj wt n par bags (t + 1) = have prev := tablesInst adj wt n par bags t; let j := Fin.ofNat (n + 1) (n - t); let p := par j; have init := Array.replicate (2 ^ (bags p).length) 0; have best := childPassInst adj wt (bags j) (bags p) prev[j] init (2 ^ (bags j).length); have tp := Lean.TreeDecomposition.parentPass (bags j) (bags p) prev[p] best (2 ^ (bags p).length); prev.set (↑p) tp ⋯

Step equation of tablesInst processing nonroot node Fin.ofNat (n + 1) (n - t).

Bounded parent node index of i (0 at the root i = 0).

Every node's bag length is at most inst.maxBagLen.

Every vertex in inst.bagAt i is < inst.numVerts.