Maximum-weight independent set over a tree decomposition #
Given a graph G with a rooted tree decomposition R : G.RootedTreeDecomposition n and vertex
weights w : V → ℕ, the dynamic program mwisValue R w is the maximum total weight of an
independent set of G. This module is the specification: it defines the program with Finset
tables and proves it correct. The executable program mwisFPT of
CslibFrontier.Algorithms.Lean.TreeDecomposition.IndependentSetFPT materializes the tables as
bit-mask-indexed arrays and computes mwisValue R w (mwisFPT_eq_mwisValue);
CslibFrontier.Algorithms.WordRAM.TreeDecomposition.IndependentSet realizes the algorithm on the
Word-RAM with an explicit FPT instruction bound.
The program processes the nodes in decreasing order, so every child is handled before its
parent. Node i keeps a table indexed by the subsets S of its bag. Once all children of i
are processed, the entry for an independent S is the largest weight of a set J of vertices
below i and outside the bag of i such that J ∪ S is independent. Processing a child j
with parent p adds to the table of p, at S, the best value over the subsets T of the bag
of j that are independent and agree with S on the shared vertices. The answer is the best
value over the independent subsets of the root bag. Because every child table is indexed by its
intersection with the parent bag, the program works on arbitrary rooted decompositions: it needs
no nice decomposition and no separate join nodes.
Main definitions #
Cslib.Algorithms.Lean.TreeDecomposition.mwisValue: the value computed by the program.
Main results #
Cslib.Algorithms.Lean.TreeDecomposition.isGreatest_mwisValue:mwisValue R wis the maximum of∑ v ∈ I, w vover the independent finite setsI.Cslib.Algorithms.Lean.TreeDecomposition.mwisValue_one_eq_indepNum: with unit weights it is the independence number.
Implementation notes #
The tables of forget, step and tables are closures and are never materialized, so forget
re-evaluates the child closures, and evaluating mwisValue as written takes time exponential in
the depth of the decomposition. These functions are a specification, not an algorithm; the
executable program is mwisFPT. The decomposition is supplied by the caller, and its node count
n + 1 is not bounded in terms of card V here. The definitions and theorems are universe
polymorphic.
References #
The dynamic program #
The message from a child with bag B and table f to its parent with bag P, at a subset
S of P: the best value of (∑ v ∈ T \ P, w v) + f T over the independent subsets T ⊆ B
that agree with S on B ∩ P.
Process node j: add its message to the table of its parent.
The tables after processing the nodes n, n - 1, …, n - t + 1.
The value of the dynamic program: the best value of (∑ v ∈ S, w v) + table S over the
independent subsets S of the root bag, after processing every nonroot node.
Correctness #
Correctness. The value of the dynamic program is the maximum weight of an independent set: it is attained by an independent set and bounds the weight of every independent set.
With unit weights the dynamic program computes the independence number.