# 基尔霍夫定理（图论）

**基尔霍夫定理**，又称**矩阵树定理**，指出有限图的生成树数目等于该图拉普拉斯矩阵（即顶点度数矩阵减去邻接矩阵，此处用于树计数）的任意一个余子式，因此只需一次行列式计算即可得到该数目。该定理以古斯塔夫·基尔霍夫（Gustav Kirchhoff）命名，其1847年对电网络的分析中以隐含形式包含了这一结果。

| 关键事实 | 详情 |
|---|---|
| 定理陈述 | 对于无自环的无向图 G，其拉普拉斯矩阵为 L，删除任意第 s 行和第 t 列得到 τ(G) = (−1)^(s+t) det(L*)；L 的每个余子式都等于生成树数目 τ(G)<sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup> |
| 起源 | 隐含于基尔霍夫1847年发表于《物理与化学年鉴》（*Annalen der Physik und Chemie*）第72卷第497–508页的论文“Ueber die Auflösung der Gleichungen...”中<sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup><sup> • </sup><sup>[2](https://zenodo.org/records/2242265)</sup> |
| 特征值形式 | 若 μ₁, ..., μ_{p−1} 是 p 个顶点的图的非零拉普拉斯特征值，则 κ(G) = μ₁μ₂···μ_{p−1}/p<sup>[3](https://ocw.mit.edu/courses/18-314-combinatorial-analysis-fall-2014/2724112ea36679f82dc04f0b2f4f355e_MIT18_314F14_mt.pdf)</sup> |
| 完全图 | τ(K_n) = n^(n−2)，即凯莱关于 n 个顶点上标号树的公式<sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup> |
| 伴随恒等式 | adj(L) = τ(G)·J，其中 J 为全一矩阵<sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup> |
| 有向版本 | 塔特（Tutte）证明了以 v_i 为根的外树（分别地，内树）数目等于有向拉普拉斯矩阵相应行（分别地，列）的余子式<sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup> |
| 加权版本 | 将边权求和纳入拉普拉斯矩阵后，行列式给出加权生成树计数式，即对所有树的边权之积求和<sup>[4](https://arxiv.org/abs/1903.03575)</sup> |

## 陈述与计算

设 G 为有限无向图，允许有多重边但无自环，τ(G) 表示其生成树数目，不考虑定向。拉普拉斯矩阵 L = Δ − A 由对角度数矩阵 Δ 和邻接矩阵 A 构成；其各行之和为零，故 L 是奇异的，必须在取行列式之前删除一行和一列。定理表明结果与删除哪一行哪一列无关：L 的每个余子式都等于 τ(G)<sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup><sup> • </sup><sup>[5](https://www.math.uwaterloo.ca/~dgwagner/Networks.pdf)</sup>。

这将树计数转化为一次行列式求值，所需算术运算次数以顶点数的多项式为界。滑铁卢大学组合数学教授大卫·G·瓦格纳（David G. Wagner）在其讲义中指出，替代的删除/收缩递推 κ(G) = κ(G∖e) + κ(G/e) 需要约 2^|E| 次运算，因此行列式公式对大图而言远为高效<sup>[5](https://www.math.uwaterloo.ca/~dgwagner/Networks.pdf)</sup>。完整的拉普拉斯矩阵因其行和为零而是奇异的；对任意图，全一向量都位于其核中<sup>[6](https://www.matpic.com/essays/a-determinant-that-counts-trees/)</sup>。

## 证明思路

任意定向每条边，构造带符号的关联矩阵 D，其元素在边指向顶点处为 +1，在边背离顶点处为 −1，其余为 0。于是 DD† = L，即拉普拉斯矩阵。一个关键的组合事实是：D 的方阵子式为零，除非对应的边集构成一个生成森林，且其每个连通分量恰好包含被删除行中的一个顶点，此时行列式为 ±1。将此代入比内–柯西（Binet–Cauchy）公式——该公式将 L 的余子式展开为 D 的子式之和——每个生成树恰好留下一个贡献，每个贡献等于 1<sup>[5](https://www.math.uwaterloo.ca/~dgwagner/Networks.pdf)</sup><sup> • </sup><sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。《数学百科全书》对经典证明的描述与此相同：余子式的比内–柯西展开，连同关联矩阵的每个非奇异 (ν−1)×(ν−1) 子式都来自一棵生成树且值为 ±1 这一事实<sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。

## 特征值形式与凯莱公式

由于拉普拉斯矩阵有一个零特征值，其非零特征值 μ₁, ..., μ_{p−1} 之积决定了余子式，给出 κ(G) = μ₁μ₂···μ_{p−1}/p。对于度数为 d 的正则图，设邻接特征值为 λ₁, ..., λ_{p−1}，则变为 κ(G) = (d−λ₁)(d−λ₂)···(d−λ_{p−1})/p<sup>[3](https://ocw.mit.edu/courses/18-314-combinatorial-analysis-fall-2014/2724112ea36679f82dc04f0b2f4f355e_MIT18_314F14_mt.pdf)</sup>。

将此应用于完全图 K_p——它是度数为 p−1 的正则图，邻接特征值为 −1（p−1 重）和 p−1（一重）——得到 κ(K_p) = p^(p−2)。这就是凯莱关于 p 个顶点上标号树数目的公式<sup>[3](https://ocw.mit.edu/courses/18-314-combinatorial-analysis-fall-2014/2724112ea36679f82dc04f0b2f4f355e_MIT18_314F14_mt.pdf)</sup><sup> • </sup><sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。理查德·P·斯坦利（Richard P. Stanley）的麻省理工学院讲义记录了归属历史：该结果常被归功于凯莱，他在1889年未加证明地陈述了它，甚至明确引用了博尔夏特（Borchardt），但西尔维斯特（Sylvester）早在1857年就已陈述，而博尔夏特于1860年发表了证明<sup>[3](https://ocw.mit.edu/courses/18-314-combinatorial-analysis-fall-2014/2724112ea36679f82dc04f0b2f4f355e_MIT18_314F14_mt.pdf)</sup>。

## 电网络起源

该定理源自基尔霍夫1847年关于伽伐尼电流线性分布的论文，他在其中运用两条电路定律来化简电阻网络的方程。爱德华·C·柯比（Edward C. Kirby）、罗杰·B·马利昂（Roger B. Mallion）及其同事在2016年发表于《克罗地亚化学学报》（*Croatica Chemica Acta*）的综述中总结道，基尔霍夫本人对计数生成树并不感兴趣，也未明确这样做；他通过提及必须从原图中移除以形成此类树的弦来援引这一概念，并在应用其电路定律时明确选择了今所谓的基本回路系<sup>[7](https://hrcak.srce.hr/172895)</sup>。尽管如此，由其线性方程产生的矩阵的行列式的模，在数值上等于表示网络连通性的图的生成树数目<sup>[7](https://hrcak.srce.hr/172895)</sup>。

这一联系比计数陈述更为深刻。基尔霍夫定理将网络中有效电导的计算归结为生成树计数，而连通加权网络中顶点 i 与 j 之间的有效电阻为 R_ij = T(G/ij)/T(G)，其中 T(G) 为所有生成树的总权重，G/ij 为将 i 与 j 等同后的图<sup>[8](https://www.mathnet.ru/eng/rm10269)</sup>。该定理的变体被用于无源电网络的拓扑分析<sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。

## 推广

该定理已在多个方向上得到推广。

**有向图与加权图。** 塔特的有向版本通过有向拉普拉斯矩阵 L⁻ 和 L⁺ 的余子式来计数以给定顶点为根的内树和外树<sup>[1](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。对于加权图，加权生成树计数式——即对所有生成树的边权之积求和——由约化加权拉普拉斯矩阵的行列式计算得出<sup>[4](https://arxiv.org/abs/1903.03575)</sup>。俄勒冈州立大学数学家帕特里克·德·林赫尔（Patrick De Leenheer）于2019年给出了有向加权推广的一个初等证明，基于将拉普拉斯矩阵分解为两个刻画图拓扑的关联矩阵<sup>[9](https://arxiv.org/abs/1904.12221)</sup>。

**森林。** 帕维尔·切博塔廖夫（Pavel Chebotarev）和埃琳娜·沙米斯（Elena Shamis）证明了矩阵森林定理，其中 I + L(G) 的 (i,j)-余子式计数的是顶点 i 和 j 位于同一棵以 i 为根的树中的生成有根森林，而 det(I + L) 等于生成有根森林的总数<sup>[10](https://arxiv.org/abs/math/0602575)</sup>。

**其他领域的应用。** 该定理将电网络理论与计数组合学和统计力学联系起来，并被用于研究阿贝尔沙堆模型中的常返态群，其中一个变体蕴含沙堆群的阶等于生成树数目<sup>[8](https://www.mathnet.ru/eng/rm10269)</sup>。在化学反应网络中，矩阵树表达式组织了复合物平衡分析中出现的生成树加权和<sup>[11](https://link.springer.com/article/10.1007/s10910-015-0498-2)</sup>。

## 算法推论

行列式公式使生成树计数成为一个多项式时间问题，可归结为单次行列式计算<sup>[12](https://www.researchgate.net/publication/398513282_Fast_exact_algorithms_via_the_Matrix_Tree_Theorem)</sup>。除精确计数外，该定理还是采样的基础：大卫·德菲（David Durfee）、拉斯穆斯·京（Rasmus Kyng）、约翰·皮布尔斯（John Peebles）、阿努普·B·拉奥（Anup B. Rao）和苏尚特·萨奇德瓦（Sushant Sachdeva）给出了一种算法，以高概率在 Õ(n^(4/3)m^(1/2) + n²) 时间内从边加权无向图中生成随机生成树，其中每棵树的概率正比于其边权之积；这改进了此前由科尔本（Colbourn）等人给出的最佳算法，其运行时间为矩阵乘法时间 O(n^ω)<sup>[13](https://arxiv.org/abs/1611.07451)</sup>。

## References

1. [Matrix tree theorem, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)
2. [G. Kirchhoff (1847), "Ueber die Auflösung der Gleichungen, auf welche man bei der Untersuchung der linearen Vertheilung galvanischer Ströme geführt wird", Zenodo record of the Annalen der Physik und Chemie article](https://zenodo.org/records/2242265)
3. [Richard P. Stanley, The Matrix Tree Theorem, MIT 18.314 Combinatorial Analysis lecture notes (Fall 2014)](https://ocw.mit.edu/courses/18-314-combinatorial-analysis-fall-2014/2724112ea36679f82dc04f0b2f4f355e_MIT18_314F14_mt.pdf)
4. [Steven Klee and Matthew T. Stamps, Linear algebraic techniques for weighted spanning tree enumeration, arXiv:1903.03575](https://arxiv.org/abs/1903.03575)
5. [David G. Wagner, Combinatorics of Electrical Networks, University of Waterloo lecture notes (2009)](https://www.math.uwaterloo.ca/~dgwagner/Networks.pdf)
6. [A determinant that counts trees, Matpic](https://www.matpic.com/essays/a-determinant-that-counts-trees/)
7. [Kirby, E.C., Mallion, R.B., Pollak, P., Skrzyński, P.J. (2016), "What Kirchhoff Actually did Concerning Spanning Trees in Electrical Networks and its Relationship to Modern Graph-Theoretical Work", Croatica Chemica Acta 89(4), 403–417](https://hrcak.srce.hr/172895)
8. [Bychkov, B.S., Kazakov, A.A., Talalaev, D.V., "Modern theory of electrical networks: from the matrix-tree theorem to the theory of cluster varieties", Russian Mathematical Surveys 81:1 (2026)](https://www.mathnet.ru/eng/rm10269)
9. [Patrick De Leenheer (2019), An elementary proof of a matrix tree theorem for directed graphs, arXiv:1904.12221](https://arxiv.org/abs/1904.12221)
10. [Pavel Chebotarev and Elena Shamis, Matrix-Forest Theorems, arXiv:math/0602575](https://arxiv.org/abs/math/0602575)
11. [Complex and detailed balancing of chemical reaction networks revisited, Journal of Mathematical Chemistry](https://link.springer.com/article/10.1007/s10910-015-0498-2)
12. [Fast exact algorithms via the Matrix Tree Theorem, ResearchGate](https://www.researchgate.net/publication/398513282_Fast_exact_algorithms_via_the_Matrix_Tree_Theorem)
13. [David Durfee, Rasmus Kyng, John Peebles, Anup B. Rao, Sushant Sachdeva (2016), Sampling Random Spanning Trees Faster than Matrix Multiplication, arXiv:1611.07451](https://arxiv.org/abs/1611.07451)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Graph theory › Graph theory subfields and named results › Named graph theory theorems

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/kirchhoffs-theorem-graph-theory

English original: https://www.edgepedia.org/kirchhoffs-theorem-graph-theory
