Documentation

CslibFrontier.Algorithms.WordRAM.TreeDecomposition.IndependentSet

Maximum-weight independent set over a tree decomposition on the Word-RAM #

This module realizes the fixed-parameter dynamic program mwisFPT (CslibFrontier.Algorithms.Lean.TreeDecomposition.IndependentSetFPT) for maximum-weight independent set over an array-encoded rooted tree decomposition on the exact-basis Word-RAM (Cslib.WordRAM.Basis.exact). Basis.exact supplies unit-cost multiplication, division, and remainder for 2-power table sizing, bit-mask extraction (m % 2, m / 2), and row-major adjacency-matrix indexing (adjPtr + u * numVerts + v) while certifying non-underflowing subtraction and non-zero divisors in the machine semantics.

Every phase of the algorithm is executed in word-addressed memory and charged by the machine:

Because every nonroot node j ≥ 1 has parents[j] < j, a telescoping prefix-sum invariant over unprocessed node tables bounds all intermediate and final table entries by (numNodes + 1) * maxBagLen * maxWeight, so logarithmic word width suffices (no 2 ^ numNodes value growth). On any rooted tree decomposition R : G.RootedTreeDecomposition n of width ≤ k, one fixed Word-RAM program computes mwisValue R wt in O((n + 1) · 2 ^ (k + 1) · (k + 1) ^ 2) instructions.

The implementation is factored under CslibFrontier.Algorithms.WordRAM.TreeDecomposition.IndependentSet into Instance (flat encoding and width-k complexity bounds), InstDP (private ℕ-indexed DP helpers), Model (MWISInstance.result and mwisFPT / mwisValue bridge; publicly re-exported alongside Instance), parallel scan modules IndepScan, MaskOps, and WeightScan, parallel DP passes ChildPass, ParentPass, RootPass, and NodeLayout, bottom-up loop ProcessNodes, and Runner (imported privately so the top-level interface stays minimal).

Main definitions #

Main results #

References #

theorem Cslib.Algorithms.WordRAM.TreeDecomposition.exists_program_mwis_treeDecomposition :
∃ (r : ℕ) (C : ℕ) (prog : WordRAM.Program WordRAM.Basis.exact r), prog.ComputesInTime (fun (x : ℕ) (inst : MWISInstance) => inst.encode) (fun (inst : MWISInstance) (x : ℕ) => C * (inst.stepBound + 1) + 1) (fun (inst : MWISInstance) (w : ℕ) => WordRAM.Fits w inst.wordBound) MWISInstance.result

One fixed exact-basis Word-RAM program computes maximum-weight independent set MWISInstance.result in ≤ C * (inst.stepBound + 1) + 1 instructions for every word width w satisfying Fits w inst.wordBound and InputFits w inst.encode.

Uniform exact-basis Word-RAM computability certificate for MWISInstance.result.

theorem Cslib.Algorithms.WordRAM.TreeDecomposition.exists_program_mwis_rooted :
∃ (r : ℕ) (C : ℕ) (prog : WordRAM.Program WordRAM.Basis.exact r), ∀ {V : Type u_1} {G : SimpleGraph V} [inst : DecidableEq V] [inst_1 : DecidableRel G.Adj] {m n k : ℕ} (e : V ≃ Fin m) (R : G.RootedTreeDecomposition n) (wt : V → ℕ) (L : Fin (n + 1) → List V), Lean.TreeDecomposition.IsBagOrder R L → R.width ≤ k → ∀ (w : ℕ), have inst_2 := MWISInstance.ofRooted e R wt L; WordRAM.Fits w inst_2.wordBound → WordRAM.InputFits w inst_2.encode → ∃ (steps : ℕ), WordRAM.Executes w prog (WordRAM.State.init inst_2.encode) (Lean.TreeDecomposition.mwisValue R wt) steps ∧ steps ≤ C * (mwisFPTBound n k + 1) + 1

FPT Word-RAM Maximum-Weight Independent Set. One fixed exact-basis Word-RAM program computes mwisValue R wt on any graph G (e : V ≃ Fin m), rooted tree decomposition R : G.RootedTreeDecomposition n of width R.width ≤ k, vertex weights wt : V → ℕ, and bag orderings L (IsBagOrder R L) within C * (mwisFPTBound n k + 1) + 1 instructions (O((n + 1) · 2 ^ (k + 1) · (k + 1) ^ 2)).