Optimal Tree Decompositions from a Given One

Lax689794.BodlaenderKloks · concepts/Lax689794/BodlaenderKloks.lean · lax-689794

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Theorem

    The theorem of Bodlaender and Kloks. For all kk and ℓ\ell there is a linear-time algorithm that, given a graph together with a tree decomposition of width at most ℓ\ell, decides whether the treewidth of the graph is at most kk and, if so, finds a tree decomposition of width at most kk. The dependence on ℓ\ell is 2O(ℓ3)2^{O(\ell^3)}.

    H. L. Bodlaender and T. Kloks, "Efficient and constructive algorithms for the pathwidth and treewidth of graphs", Journal of Algorithms 21 (1996) 358–402. A simpler presentation, which this module follows, is E. Althaus and S. Ziegler, "Optimal tree decompositions revisited: a simpler linear-time FPT algorithm", arXiv:1912.09144 (2020), §3; the statement is Theorem 2.10 of H. L. Bodlaender, "A linear-time algorithm for finding tree-decompositions of small treewidth", SIAM Journal on Computing 25 (1996) 1305–1317, where it is used as a black box.

    The formalized improvement result is derived from the exact graph algorithm. When l≤kl ≤ k, the program returns the supplied decomposition; otherwise it runs the graph algorithm with bound kk. Since k<lk < l in the latter case, its parameter-dependent bound is also bounded in terms of ll. The underlying characteristic dynamic program is used within the graph algorithm's vertex-by-vertex construction.

    Concept map
    4 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A
    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

    1import Lax689794.GraphWords
    2import Lax808846.Ram
    3
    4/-!
    5---
    6title: Optimal Tree Decompositions from a Given One
    7type: theorem
    8---
    9**The theorem of Bodlaender and Kloks.** For all kk and ℓ\ell there is a linear-time
    10algorithm that, given a graph together with a tree decomposition of width at most ℓ\ell,
    11decides whether the treewidth of the graph is at most kk and, if so, finds a tree
    12decomposition of width at most kk. The dependence on ℓ\ell is 2O(ℓ3)2^{O(\ell^3)}.
    13
    14H. L. Bodlaender and T. Kloks, *"Efficient and constructive algorithms for the pathwidth and
    15treewidth of graphs"*, Journal of Algorithms 21 (1996) 358–402. A simpler presentation, which
    16this module follows, is E. Althaus and S. Ziegler, *"Optimal tree decompositions revisited:
    17a simpler linear-time FPT algorithm"*, arXiv:1912.09144 (2020), §3; the statement is Theorem
    182.10 of H. L. Bodlaender, *"A linear-time algorithm for finding tree-decompositions of small
    19treewidth"*, SIAM Journal on Computing 25 (1996) 1305–1317, where it is used as a black box.
    20
    21The formalized improvement result is derived from the exact graph algorithm. When `l ≤ k`,
    22the program returns the supplied decomposition; otherwise it runs the graph algorithm with
    23bound `k`. Since `k < l` in the latter case, its parameter-dependent bound is also bounded
    24in terms of `l`. The underlying characteristic dynamic program is used within the graph
    25algorithm's vertex-by-vertex construction.
    26
    27# Formalization Notes
    28
    29The input is one word: the graph (see `GraphWords`), the two numbers `k` and `l`, and the word
    30of a nice tree decomposition of width at most `l`. The graph word states its own length, so the
    31three parts are told apart. The given decomposition is nice; Althaus and Ziegler assume it and
    32the conversion of an arbitrary decomposition into a nice one of the same width takes time
    33O(ℓ2(∣V(T)∣+∣V∣))O(\ell^2(|V(T)| + |V|)) (Kloks), so nothing is lost.
    34
    35The output is either `[0]`, admissible only when the graph has no tree decomposition of width
    36at most `k`, or `1` followed by the word of a nice tree decomposition of width at most `k`. It
    37is a relation rather than a function: a graph has many decompositions, and the program may
    38produce any one of them. The output is nice, where the theorem produces an arbitrary
    39decomposition, because the conversion is one more linear-time pass and every consumer wants
    40the nice form.
    41
    42The bound is `c * 2 ^ (c * l ^ 3) * (|input| + 2) ^ c`. The polynomial factor uses the full encoded input length, including the supplied decomposition.
    43Only the graph portion has length quadratic in the number of vertices; no size bound on the
    44supplied decomposition is assumed. The
    45condition on the word length is an explicit inequality against `2 ^ W`, on every entry of the
    46input: the tables of the algorithm have size `2 ^ (c * l ^ 3)` times a polynomial in the length,
    47so a machine of too small a word length cannot hold them.
    48
    49The program and the constant are quantified before the word length, the graph and the two
    50bounds, so one program serves all of them.
    51-/
    52
    53namespace Lax689794.BodlaenderKloks
    54
    55open Lax808846.Ram Lax689794.GraphWords
    56
    57open Classical in
    58/-- **The theorem of Bodlaender and Kloks, on a word RAM.** One program and one constant serve
    59every word length `W`, every graph `G`, every bound `k` and every nice tree decomposition `D` of
    60`G` of width at most `l`, provided the input `g ++ [k, l] ++ D` fits with room for
    61`c * 2 ^ (c * l ^ 3)` times a polynomial in its length. On such an input the program halts
    62within `c * 2 ^ (c * l ^ 3) * (|input| + 2) ^ c` instructions, writing `[0]` if the graph has no
    63tree decomposition of width at most `k`, and `1` followed by the word of a nice tree
    64decomposition of width at most `k` otherwise. -/
    65axiom improveDecomposition :
    66 ∃ (prog : Program) (c : ℕ), ∀ (W k l : ℕ) (n : ℕ) (G : SimpleGraph (Fin n)) (g D : List ℕ),
    67 EncodesGraph g G → NiceDecomposition G l D →
    68 (∀ v ∈ g ++ [k, l] ++ D,
    69 c * 2 ^ (c * l ^ 3) * ((g ++ [k, l] ++ D).length + v + 1) ^ c ≤ 2 ^ W) →
    70 ∃ (out : List ℕ) (t : ℕ), t ≤ c * 2 ^ (c * l ^ 3) * ((g ++ [k, l] ++ D).length + 2) ^ c ∧
    71 RunsTo W prog (g ++ [k, l] ++ D) out t ∧
    72 (out = [0] ∧ ¬ Lax228581.Treewidth.HasTreewidthAtMost G k ∨
    73 ∃ D', out = 1 :: D' ∧ NiceDecomposition G k D')
    74
    75end Lax689794.BodlaenderKloks
    76
    Show Proof
    Formalization Notes

    The input is one word: the graph (see GraphWordsGraphWords), the two numbers kk and ll, and the word of a nice tree decomposition of width at most ll. The graph word states its own length, so the three parts are told apart. The given decomposition is nice; Althaus and Ziegler assume it and the conversion of an arbitrary decomposition into a nice one of the same width takes time O(ℓ2(∣V(T)∣+∣V∣))O(\ell^2(|V(T)| + |V|)) (Kloks), so nothing is lost.

    The output is either [0][0], admissible only when the graph has no tree decomposition of width at most kk, or 11 followed by the word of a nice tree decomposition of width at most kk. It is a relation rather than a function: a graph has many decompositions, and the program may produce any one of them. The output is nice, where the theorem produces an arbitrary decomposition, because the conversion is one more linear-time pass and every consumer wants the nice form.

    The bound is c∗2(c∗l3)∗(∣input∣+2)cc * 2 ^ (c * l ^ 3) * (|input| + 2) ^ c. The polynomial factor uses the full encoded input length, including the supplied decomposition. Only the graph portion has length quadratic in the number of vertices; no size bound on the supplied decomposition is assumed. The condition on the word length is an explicit inequality against 2W2 ^ W, on every entry of the input: the tables of the algorithm have size 2(c∗l3)2 ^ (c * l ^ 3) times a polynomial in the length, so a machine of too small a word length cannot hold them.

    The program and the constant are quantified before the word length, the graph and the two bounds, so one program serves all of them.

    Builds on
    Used by

    none

    From Mathlib

    none

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…