{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $G$ be a finite [[multigraph|0C62PZXX02]] without loops, with vertices $v_1, \\dots, v_n$ and $n \\ge 2$.\nLet $D$ be the diagonal matrix of the vertex degrees.\nLet $A$ be the matrix with $A_{ii} = 0$ and $A_{ij}$ the number of edges between $v_i$ and $v_j$ for $i \\ne j$.\nLet $L = D - A$ be the [[Laplacian matrix|TN6M6DVZRP]] of $G$.\nFor each $i$, let $L_i$ be the matrix obtained from $L$ by deleting row $i$ and column $i$.\nThen the number of [[spanning trees|0S4ZEZM7KE]] of $G$ equals $\\det L_i$, for every $i \\in \\set{1, \\dots, n}$.\n\n## Remarks\n\nOrient each edge and let $B$ be the $n \\times m$ incidence matrix, with entries $+1$ and $-1$ at the head and tail of each edge; then $L = B B^T$.\nDelete row $i$ of $B$ to get $B_i$, so that $L_i = B_i B_i^T$.\nBy the [[Cauchy–Binet formula|08WE2W7DYS]], $\\det L_i$ is the sum of $(\\det N)^2$ over the $(n-1) \\times (n-1)$ submatrices $N$ of $B_i$.\nSuch a minor is $\\pm 1$ if its $n - 1$ edges form a spanning tree and $0$ otherwise, which gives the count.\n\nExample: for the triangle $K_3$, every vertex has degree $2$ and\n$$L_3 = \\begin{pmatrix} 2 \u0026 -1 \\\\ -1 \u0026 2 \\end{pmatrix}, \\qquad \\det L_3 = 3,$$\nwhich matches the $3$ spanning trees obtained by removing one edge.\nFor the complete graph $K_n$ the theorem gives $n^{n-2}$, which is [[Cayley's formula|0M2SSGSYPE]].\nIf $G$ is not connected, both sides are $0$.\n\n## Explanations\n\n### L1 human\n\nCounting spanning trees by hand is hard even for small graphs.\nThe theorem gives a recipe.\nWrite the degree of each vertex on the diagonal and $-1$ for each edge off the diagonal.\nCross out one row and the matching column, and take the [[determinant|00KDZRW4C0]].\nThe number you get is the number of spanning trees, whichever row you crossed out.\n\n### L2 human\n\nAn equivalent form uses the eigenvalues $0 = \\mu_1 \\le \\mu_2 \\le \\dots \\le \\mu_n$ of $L$: the number of spanning trees is $\\frac{1}{n} \\mu_2 \\cdots \\mu_n$.\nThis links spectral graph theory to enumeration.\nThe theorem goes back to Kirchhoff's study of electrical networks.\nIt has a weighted version, where each edge carries a variable and the determinant sums the weights of the spanning trees, and a version for directed graphs that counts arborescences.\n",
  "commit": "efe85cee8dbc57d85bedbacfb97b99d1b7bee843",
  "front": {
    "about": [
      "0S4ZEZM7KE",
      "TN6M6DVZRP"
    ],
    "kind": "statement",
    "msc": [
      "05C50",
      "05C05",
      "05C30"
    ],
    "name": "Kirchhoff's matrix tree theorem",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q2226691",
      "wikipedia": "Kirchhoff's theorem"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Kirchhoff%27s_theorem"
      }
    ],
    "tag": "S1PG1N2VEX",
    "uses": [
      "0C62PZXX02",
      "0S4ZEZM7KE",
      "TN6M6DVZRP",
      "0XPKR18APA",
      "00KDZRW4C0"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/S1PG1N2VEX/",
  "links": [
    {
      "field": "about",
      "target": "0S4ZEZM7KE"
    },
    {
      "field": "about",
      "target": "TN6M6DVZRP"
    },
    {
      "field": "uses",
      "target": "0C62PZXX02"
    },
    {
      "field": "uses",
      "target": "0S4ZEZM7KE"
    },
    {
      "field": "uses",
      "target": "TN6M6DVZRP"
    },
    {
      "field": "uses",
      "target": "0XPKR18APA"
    },
    {
      "field": "uses",
      "target": "00KDZRW4C0"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/S1PG1N2VEX.md",
  "msc": [
    "05C50",
    "05C05",
    "05C30"
  ],
  "name": "Kirchhoff's matrix tree theorem",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/S1P/S1PG1N2VEX.md",
  "status": null,
  "tag": "S1PG1N2VEX",
  "uri": "m2://S1PG1N2VEX",
  "url": "https://math2.tamnd.com/wiki/kirchhoffs-matrix-tree-theorem/",
  "writing": {
    "tag": "S1PG1N2VEX",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
