Kirchhoff's matrix-tree theorem #
For a finite simple graph G and a vertex r, the determinant of the reduced Laplacian, the
submatrix of G.lapMatrix ℤ on the rows and columns of the vertices other than r, is the number
of spanning trees of G (SimpleGraph.det_lapMatrix_submatrix_eq_natCard_isTree); this is
Kirchhoff's theorem [Kir47] in its modern determinant form. A spanning tree is a subgraph
T ≤ G on all of V with T.IsTree. The same holds over any commutative ring
(SimpleGraph.det_lapMatrix_submatrix_eq_natCard_isTree').
Both are the case of all weights 1 of the weighted matrix-tree theorem
(SimpleGraph.det_laplacian_weightedAdjMatrix_submatrix_eq_finsum_isTree). For edge weights
w : Sym2 V → R in a commutative ring, the reduced Laplacian of the weighted adjacency matrix
SimpleGraph.weightedAdjMatrix G w has determinant ∑ T, ∏ e ∈ T.edgeSet, w e, the sum over the
spanning trees T ≤ G.
The proof is the standard one by the Cauchy–Binet formula. Write N' for the oriented incidence
matrix SimpleGraph.orientedIncMatrix G with the row of r deleted. Then the reduced weighted
Laplacian is N' * diagonal w * N'ᵀ
(SimpleGraph.orientedIncMatrix_map_mul_diagonal_mul_transpose), and its determinant is the sum
over the sets S of |V| - 1 edges of det (N'_S) ^ 2 * ∏ e ∈ S, w e, by
Matrix.det_mul_eq_sum_powersetCard_of_equiv. For any family g of edges indexed by the vertices
other than r (an edge g v need not be incident to v):
- if the edges chosen by
gdo not connect a vertexwtor, the indicator vector of the vertices reachable fromwis a nonzero left kernel vector ofN'_g, sodet N'_g = 0(SimpleGraph.det_orientedIncMatrix_submatrix_eq_zero); - if they form a connected spanning subgraph, give each vertex
v ≠ rthe chosen edge joining it to a neighbour closer tor. This bijection makesN'_g, up to a permutation of columns, triangular for the distance torwith diagonal entries±1, sodet N'_g ^ 2 = 1(SimpleGraph.det_orientedIncMatrix_submatrix_sq_eq_one).
A connected spanning subgraph with |V| - 1 edges is a spanning tree, and conversely.
As a corollary, the complete graph on n ≥ 1 vertices has n ^ (n - 2) spanning trees
(Cayley's formula [Cay89], SimpleGraph.natCard_isTree_eq_card_pow): its reduced
Laplacian is n • 1 minus the all-ones matrix of size n - 1, whose determinant is
n ^ (n - 1) * (1 - (n - 1) / n) by the matrix determinant lemma.
The directed analogue, Tutte's matrix-tree theorem for arborescences, is in
CslibFrontier.Foundations.Combinatorics.Digraph.MatrixTree.
Main results #
SimpleGraph.lapMatrix_submatrix_eq_mul_transpose: the reduced Laplacian isN' * N'ᵀ.SimpleGraph.det_orientedIncMatrix_submatrix_eq_zero,SimpleGraph.det_orientedIncMatrix_submatrix_sq_eq_one,SimpleGraph.det_orientedIncMatrix_submatrix_sq: the squared minors ofN'on|V| - 1columns are1on connected spanning subgraphs and0otherwise.SimpleGraph.det_laplacian_weightedAdjMatrix_submatrix_eq_finsum_isTree: the weighted matrix-tree theorem.SimpleGraph.det_lapMatrix_submatrix_eq_natCard_isTree: Kirchhoff's matrix-tree theorem.SimpleGraph.det_lapMatrix_submatrix_eq_natCard_isTree': the same over a commutative ring.SimpleGraph.natCard_isTree_eq_card_pow: Cayley's formula, there aren ^ (n - 2)trees on a type withn ≥ 1elements.
References #
- G. Kirchhoff, Ueber die Auflösung der Gleichungen, auf welche man bei der Untersuchung der linearen Vertheilung galvanischer Ströme geführt wird
- A. Cayley, A theorem on trees
- C. Godsil, G. Royle, Algebraic Graph Theory, §13.2, Theorem 13.2.1, proved there by deletion and contraction (locator from secondary sources, unverified)
Adjacency in the spanning subgraph whose edges are the values of a family g of edges.
If the edges of a family g indexed by the vertices other than r do not connect w to r,
then the minor of the oriented incidence matrix on the rows v ≠ r and the columns g vanishes.
If the edges of a family g indexed by the vertices other than r form a connected spanning
subgraph, then the square of the minor of the oriented incidence matrix on the rows v ≠ r and
the columns g is 1.
The square of the minor of the oriented incidence matrix on the rows v ≠ r and the columns
g is 1 if the edges chosen by g form a connected spanning subgraph, and 0 otherwise.
The reduced Laplacian on the vertices other than r is N' * N'ᵀ, where N' is the oriented
incidence matrix with the row of r deleted.
The weighted matrix-tree theorem [Kir47]. For edge weights w : Sym2 V → R in a
commutative ring and every vertex r of a finite simple graph G, the determinant of the reduced
weighted Laplacian, the submatrix of (G.weightedAdjMatrix w).laplacian on the vertices other
than r, is the sum over the spanning trees T ≤ G of the product of the weights of the edges
of T.
Kirchhoff's matrix-tree theorem over a commutative ring: the determinant of the reduced
Laplacian G.lapMatrix R on the vertices other than r is the number of spanning trees of G,
cast to R. This is the case of all weights 1 of
SimpleGraph.det_laplacian_weightedAdjMatrix_submatrix_eq_finsum_isTree.
Kirchhoff's matrix-tree theorem [Kir47], in its modern determinant form
([GR01b], §13.2, Theorem 13.2.1; locator from secondary sources, unverified). For
every vertex r of a finite simple graph G, the determinant of the reduced Laplacian, the
submatrix of G.lapMatrix ℤ on the vertices other than r, is the number of spanning trees
T ≤ G of G.
The Laplacian over a commutative ring is the image of the integer Laplacian.
Cayley's formula: there are n ^ (n - 2) trees on a type with n ≥ 1 elements, that is,
the complete graph on n labelled vertices has n ^ (n - 2) spanning trees [Cay89]. The
proof applies the matrix-tree theorem SimpleGraph.det_lapMatrix_submatrix_eq_natCard_isTree' to
⊤ over ℚ.