Nice Tree Decompositions of Small Width Are Found in Fixed-Parameter Time
Lax689794.Bodlaender · concepts/Lax689794/Bodlaender.lean · lax-689794
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
Bodlaender's theorem. For every constant one can decide in linear time whether a graph has treewidth at most , and if so construct a tree decomposition of width at most ; the dependence on is . Kloks' construction turns a tree decomposition into a nice one of the same width in time linear in its size, so the same holds for nice decompositions.
H. L. Bodlaender, "A linear-time algorithm for finding tree-decompositions of small treewidth", SIAM Journal on Computing 25 (1996) 1305–1317; T. Kloks, "Treewidth: Computations and Approximations", Lecture Notes in Computer Science 842, Springer 1994. A simplified presentation of the whole algorithm is E. Althaus and S. Ziegler, "Optimal tree decompositions revisited: a simpler linear-time FPT algorithm", arXiv:1912.09144 (2020).
The formalized algorithm inserts vertices one at a time, adding each new vertex to every bag of the preceding decomposition and applying the characteristic dynamic program to recover width at most . Compression controls the size of intermediate decompositions. This gives a polynomial dependence on the encoded graph length. The exported improvement theorem is derived from this graph algorithm.
Concept map
Evidence
Each proof establishes this claim relative to its assumptions.
In the paper
- page 2 of this submission's paper
Lean source view on GitHub
| 1 | import Lax689794.GraphWords |
| 2 | import Lax808846.Ram |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Nice Tree Decompositions of Small Width Are Found in Fixed-Parameter Time |
| 7 | type: theorem |
| 8 | --- |
| 9 | **Bodlaender's theorem.** For every constant one can decide in linear time whether a graph |
| 10 | has treewidth at most , and if so construct a tree decomposition of width at most ; the |
| 11 | dependence on is . Kloks' construction turns a tree decomposition into a nice |
| 12 | one of the same width in time linear in its size, so the same holds for nice decompositions. |
| 13 | |
| 14 | H. L. Bodlaender, *"A linear-time algorithm for finding tree-decompositions of small |
| 15 | treewidth"*, SIAM Journal on Computing 25 (1996) 1305–1317; T. Kloks, *"Treewidth: Computations |
| 16 | and Approximations"*, Lecture Notes in Computer Science 842, Springer 1994. A simplified |
| 17 | presentation of the whole algorithm is E. Althaus and S. Ziegler, *"Optimal tree decompositions |
| 18 | revisited: a simpler linear-time FPT algorithm"*, arXiv:1912.09144 (2020). |
| 19 | |
| 20 | The formalized algorithm inserts vertices one at a time, adding each new vertex to every bag |
| 21 | of the preceding decomposition and applying the characteristic dynamic program to recover |
| 22 | width at most `k`. Compression controls the size of intermediate decompositions. This gives |
| 23 | a polynomial dependence on the encoded graph length. The exported improvement theorem is |
| 24 | derived from this graph algorithm. |
| 25 | |
| 26 | # Formalization Notes |
| 27 | |
| 28 | The input is the word of the graph (see `GraphWords`) followed by the bound `k`. The output is |
| 29 | either `[0]`, admissible only when the graph has no tree decomposition of width at most `k` (in |
| 30 | the archive's sense), or `1` followed by the word of a nice tree decomposition of width at most |
| 31 | `k`. The output is a relation and not a function, since a graph has many decompositions: the |
| 32 | program may produce any one of them. |
| 33 | |
| 34 | The bound is `c * 2 ^ (c * k ^ 3) * (|g| + 2) ^ c`: the paper's is linear in the number of |
| 35 | vertices, while the input has length quadratic in it, and the statement is polynomial in the |
| 36 | length of the word, which is what a consumer needs. The guard on the word length is what makes |
| 37 | the statement true: the program's tables have size `2 ^ (c * k ^ 3)` times a polynomial in the |
| 38 | length of the word, so a machine of too small a word length cannot hold them; the hypothesis is |
| 39 | an explicit inequality against `2 ^ W`, checkable from the input alone, and it ranges over the |
| 40 | entries of the word so that every entry, and every number the output contains (node numbers are |
| 41 | bounded by the running time), is a word. Nothing is claimed for word lengths that violate it. |
| 42 | |
| 43 | The program and the constant are quantified before the word length, the graph and the bound, |
| 44 | so one program serves them all. |
| 45 | -/ |
| 46 | |
| 47 | namespace Lax689794.Bodlaender |
| 48 | |
| 49 | open Lax808846.Ram Lax689794.GraphWords |
| 50 | |
| 51 | open Classical in |
| 52 | /-- **Bodlaender's theorem with Kloks' niceness, on a word RAM.** One program and one constant |
| 53 | serve every word length `W`, every graph `G` on `n` vertices and every bound `k`, provided the |
| 54 | word — the graph followed by `k` — fits with room for `c * 2 ^ (c * k ^ 3)` times a polynomial |
| 55 | in its length. On such a word the program halts within `c * 2 ^ (c * k ^ 3) * (|g| + 2) ^ c` |
| 56 | instructions, writing `[0]` if the graph has no tree decomposition of width at most `k`, and `1` |
| 57 | followed by the word of a nice tree decomposition of width at most `k` otherwise. -/ |
| 58 | axiom niceDecomposition_computable : |
| 59 | ∃ (prog : Program) (c : ℕ), ∀ (W k n : ℕ) (G : SimpleGraph (Fin n)) (g : List ℕ), |
| 60 | EncodesGraph g G → |
| 61 | (∀ v ∈ g ++ [k], c * 2 ^ (c * k ^ 3) * ((g ++ [k]).length + v + 1) ^ c ≤ 2 ^ W) → |
| 62 | ∃ (out : List ℕ) (t : ℕ), t ≤ c * 2 ^ (c * k ^ 3) * (g.length + 2) ^ c ∧ |
| 63 | RunsTo W prog (g ++ [k]) out t ∧ |
| 64 | (out = [0] ∧ ¬ Lax228581.Treewidth.HasTreewidthAtMost G k ∨ |
| 65 | ∃ D, out = 1 :: D ∧ NiceDecomposition G k D) |
| 66 | |
| 67 | end Lax689794.Bodlaender |
| 68 |
Formalization Notes
The input is the word of the graph (see ) followed by the bound . The output is either , admissible only when the graph has no tree decomposition of width at most (in the archive's sense), or followed by the word of a nice tree decomposition of width at most . The output is a relation and not a function, since a graph has many decompositions: the program may produce any one of them.
The bound is : the paper's is linear in the number of vertices, while the input has length quadratic in it, and the statement is polynomial in the length of the word, which is what a consumer needs. The guard on the word length is what makes the statement true: the program's tables have size times a polynomial in the length of the word, so a machine of too small a word length cannot hold them; the hypothesis is an explicit inequality against , checkable from the input alone, and it ranges over the entries of the word so that every entry, and every number the output contains (node numbers are bounded by the running time), is a word. Nothing is claimed for word lengths that violate it.
The program and the constant are quantified before the word length, the graph and the bound, so one program serves them all.
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments