{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $G = (V, E)$ be a finite [[graph|0JD5C82QMB]].\nA tree decomposition of $G$ is a pair $(T, (X_t)_{t \\in V(T)})$ with the following properties.\nHere $T$ is a [[tree|0MJ0JS72DZ]], and each $X_t$ is a subset of $V$, called a bag.\n\n1. Every vertex of $G$ lies in some bag.\n2. For every edge $uv$ of $G$, some bag contains both $u$ and $v$.\n3. For every vertex $v$ of $G$, the nodes $t$ with $v \\in X_t$ form a connected subtree of $T$.\n\nThe width of the decomposition is $\\max_t \\abs{X_t} - 1$.\nThe treewidth $\\operatorname{tw}(G)$ is the least width of a tree decomposition of $G$.\n\n## Remarks\n\nExample: the cycle $C_4$ with vertices $1, 2, 3, 4$ in order has the tree decomposition with two adjacent nodes and bags $\\set{1, 2, 3}$ and $\\set{1, 3, 4}$.\nEach vertex is in a bag, each edge lies in a bag, and the nodes containing $1$ or $3$ form the whole tree, so the width is $2$.\nNon-example: put the bags $\\set{1, 2}, \\set{2, 3}, \\set{3, 4}, \\set{4, 1}$ in this order along a path.\nThey satisfy clauses 1 and 2 but fail clause 3, because vertex $1$ lies in the first and last bags only.\nEvery clique of $G$ lies in a single bag, so $\\operatorname{tw}(K_n) = n - 1$.\nA graph with at least one edge has treewidth $1$ exactly when it is a forest, and the $k \\times k$ grid with $k \\ge 2$ has treewidth $k$.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "CD2XB4Y1SF",
    "kind": "definition",
    "msc": [
      "05C83",
      "05C75",
      "05C85"
    ],
    "name": "Treewidth",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Treewidth"
      }
    ],
    "tag": "FJ5E6FZVRJ",
    "uses": [
      "0JD5C82QMB",
      "0MJ0JS72DZ"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/FJ5E6FZVRJ/",
  "links": [
    {
      "field": "defines",
      "target": "CD2XB4Y1SF"
    },
    {
      "field": "uses",
      "target": "0JD5C82QMB"
    },
    {
      "field": "uses",
      "target": "0MJ0JS72DZ"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/FJ5E6FZVRJ.md",
  "msc": [
    "05C83",
    "05C75",
    "05C85"
  ],
  "name": "Treewidth",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/FJ5/FJ5E6FZVRJ.md",
  "status": null,
  "tag": "FJ5E6FZVRJ",
  "uri": "m2://FJ5E6FZVRJ",
  "url": "https://math2.tamnd.com/wiki/treewidth-definition/",
  "writing": {
    "tag": "FJ5E6FZVRJ",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
