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:
- parsing variable-length bag lists into 4-word node descriptors and zero-allocating all
n + 1node DP tables (initNodesProg), - pairwise bag independence tests via row-major adjacency-matrix reads (
noAdjScanProg,indepBagProg), - linear bag scans computing parent-bag masks, parent-mask restrictions, and forgotten-vertex
weight sums (
selMemBagProg,keyMaskProg,restrictMaskProg,forgetWeightProg), - child-pass scratch-array materialization (
Memory.alloc), in-place parent-table accumulation, bottom-up node traversaln, n - 1, …, 1, and final root maximization (childPassProg,parentPassProg,processNodesProg,rootPassProg).
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 #
Cslib.Algorithms.WordRAM.TreeDecomposition.encodeBag: length-prefixed bag word list.Cslib.Algorithms.WordRAM.TreeDecomposition.MWISInstance: flat word-serializable instance bundle withMWISInstance.encode,MWISInstance.result,MWISInstance.maxBagLen,MWISInstance.maxWeight,MWISInstance.wordBound,MWISInstance.stepBound, andMWISInstance.ofRooted.Cslib.Algorithms.WordRAM.TreeDecomposition.mwisFPTBound: closed-form width-kstep bound6 + (n + 1) * (2 ^ (k + 1) * (5 * (k + 1) ^ 2 + 6 * (k + 1) + 32)).
Main results #
Cslib.Algorithms.WordRAM.TreeDecomposition.MWISInstance.result_ofRooted:MWISInstance.ofRootedcomputesmwisValue R wt(= mwisFPT R wt L).Cslib.Algorithms.WordRAM.TreeDecomposition.exists_program_mwis_treeDecomposition: one fixedBasis.exactWord-RAM program computesMWISInstance.resultinO(inst.stepBound + 1)instructions at every word widthwsatisfyingFits w inst.wordBoundandInputFits w inst.encode.Cslib.Algorithms.WordRAM.TreeDecomposition.uniformComputableInTime_mwis_treeDecomposition:UniformComputableInTime .exactcertificate forMWISInstance.result.Cslib.Algorithms.WordRAM.TreeDecomposition.exists_program_mwis_rooted: FPT Word-RAM boundO(mwisFPTBound n k + 1)computingmwisValue R wtfor anyR : G.RootedTreeDecomposition nof widthR.width ≤ k.
References #
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.
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)).