24.11  Graph Laplacians

Chapter 3 built the incidence matrix of a network, used it to solve flow problems, and then set one object aside with a promise: the matrix NN⊤, the graph Laplacian, “returns in Chapter 24”. Chapter 7 left a second debt at the same address. Its exercise Exercise (C1: Counting spanning trees) computed, for one four-vertex network, that detL0 equals the number of spanning trees, and named the general statement the matrix-tree theorem, leaving a proof “which Chapter 24 completes”. This section pays both debts. It also does something the two earlier chapters could not: with the spectral theory of Chapters 12 and 17 in hand, we can read the eigenvalues of L and find the shape of the graph in them.

Throughout, a graph means what Chapter 3 §07 called a network with its orientation forgotten: a finite set of vertices 1,…,m and a finite set of edges 1,…,k, each edge joining two distinct vertices. Two edges may join the same pair. An orientation chooses, for each edge e, a tail and a head, and turns the graph back into one of Chapter 3’s networks with an incidence matrix N∈Mm×k(R) (Definition 3.7.1).

24.11.1. The Laplacian of a graph

The matrix NN⊤ has already appeared three times without being studied: named and postponed in the closing sentence of Chapter 3 §07’s flow-network subsection; implicitly in Exercise (C3: Networks in several pieces), where the kernel of N⊤ — which, as we shall see, is the kernel of NN⊤ — turned out to be spanned by the indicator vectors of the components; and in Exercise (C1: Counting spanning trees), where its determinant counted something combinatorial. A product that keeps coming back deserves a name.

The Laplacian of a graph is the matrix that turns a labeling of the vertices into the total squared disagreement across the edges.

Definition 24.11.1 (Graph Laplacian)

Let G be a graph with vertices 1,…,m and k≥1 edges, and fix any orientation of G, with incidence matrix N∈Mm×k(R). The Laplacian of G is L:=NN⊤∈Mm(R).

In words: the (u,v)-entry of L is the dot product of row u and row v of N, that is, the sum over all edges of the product of the two incidence entries. The definition names an orientation, and the first thing to check is that the orientation leaves no trace.

Write deg⁡(v) for the number of edges meeting the vertex v, and auv for the number of edges joining u to v when u≠v, with avv=0. Let D=diag(deg⁡(1),…,deg⁡(m)) be the degree matrix and A=(auv) the adjacency matrix. Neither mentions an orientation.

Proposition 24.11.1 (First Properties of the Laplacian)

Let G be a graph on m vertices with k≥1 edges and Laplacian L. Then:

  • (a) L=D−A; in particular L is symmetric and does not depend on the orientation chosen in Definition 24.11.1.
  • (b) For every x∈Rm, x⊤Lx=∑e=1k(xue−xve)2, where ue and ve are the two ends of the edge e. Consequently L⪰0.
  • (c) L1=0, where 1=(1,…,1)∈Rm.

Idea. Everything is one line of N. Part (a) reads the product NN⊤ entry by entry, using that a column of N has exactly one 1 and one −1. Part (b) is the observation that x⊤NN⊤x is the squared length of N⊤x, and Chapter 3 already identified N⊤x as the vector of differences across the edges. Part (c) is (b) applied to a constant vector, or the fact that each column of N sums to zero.

Proof.

  • (a) By Theorem 0.9.2, (NN⊤)uv=∑eNueNve. If u=v, then Nue2 is 1 when e meets u and 0 otherwise (Definition 3.7.1), so the sum is deg⁡(u). If u≠v, then NueNve≠0 only for an edge e with one end u and the other v, and such an edge contributes 1⋅(−1)=−1 whichever way it is oriented; so the sum is −auv. Hence L=D−A. Both D and A are determined by G alone, and A is symmetric because auv=avu, so L⊤=L.

  • (b) As in the proof of Proposition 3.7.4, entry e of N⊤x is xtail(e)−xhead(e), which is ±(xue−xve). Therefore x⊤Lx=x⊤NN⊤x=(N⊤x)⊤(N⊤x)=‖N⊤x‖2, and expanding the squared length coordinate by coordinate gives the stated sum, the signs disappearing because each term is squared. For the standard real inner product, ⟨Lx,x⟩=x⊤Lx, which is a sum of squares of real numbers and hence ≥0; and L is symmetric by (a). So L⪰0 by Definition 13.1.1.

  • (c) Each column of N has exactly one 1 and one −1, so N⊤1=0, and L1=N(N⊤1)=0.

Part (b) is the whole reason the Laplacian is useful. A vector x∈Rm is a labeling of the vertices by numbers, and x⊤Lx measures how badly the labeling disagrees across the edges: it is zero exactly when the labeling is locally constant, and large when neighbors receive very different numbers. Every statement in this section is a consequence of that one reading.

Example (A Laplacian computed twice)

Let G be the four-vertex graph of Exercise (C1: Counting spanning trees): vertices 1,2,3,4 and edges e1={1,2}, e2={2,3}, e3={3,4}, e4={4,1}, e5={1,3}. Compute L from D−A and from NN⊤, and check them against each other.

Solution. The degrees are deg⁡(1)=3, deg⁡(2)=2, deg⁡(3)=3, deg⁡(4)=2, and every pair of vertices is joined by at most one edge, the missing pair being {2,4}. Hence D−A=(3000020000300002)−(0111101011011010)=(3−1−1−1−12−10−1−13−1−10−12). Orienting the edges as 1→2, 2→3, 3→4, 4→1, 1→3 gives the incidence matrix of Exercise (C1: Counting spanning trees), N=(100−11−110000−110−100−110), whose row 1 has squared length 1+1+1=3, and whose rows 1 and 2 have dot product 1⋅(−1)=−1. Continuing entry by entry reproduces the matrix above, so the two computations agree. Reversing the orientation of the edge 1→2 changes the first two rows of N in their first entry only, from 1 and −1 to −1 and 1; the diagonal entries are unchanged because they are sums of squares, and the (1,2)-entry is still (−1)⋅1=−1.

Warning. Take the oriented incidence matrix, not the unoriented one. If one replaces the −1 in Definition 3.7.1 by +1, obtaining the matrix M with a 1 at both ends of each edge, then MM⊤=D+A, not D−A. That matrix is also symmetric and positive semidefinite, but it is a different matrix with a different kernel: for the triangle, D−A is singular while D+A has determinant 4. The signs are what make Proposition 24.11.1 (b) a sum of differences, and the sign convention returns in Lemma 24.11.6, where it is load-bearing again.

Quick check. The graph of Example (A Laplacian computed twice) has the labeling x=(1,1,0,0). Compute x⊤Lx from the edge formula, and say which edges contribute.

Solution. By Proposition 24.11.1 (b), each edge contributes the square of the difference of the labels at its ends. The edges {1,2} and {3,4} join equal labels and contribute 0; the edges {2,3}, {4,1} and {1,3} each join a 1 to a 0 and contribute 1. So x⊤Lx=3, the number of edges crossing between {1,2} and {3,4}. Directly: Lx=(3−1,−1+2,−1−1,−1+0)=(2,1,−2,−1) and x⊤Lx=2+1=3.

24.11.2. The kernel counts the components

Chapter 3’s Exercise (C3: Networks in several pieces) computed nul(N⊤) for a network in several pieces. That was an exercise, so we prove what we need here, in the form the spectral theory will use. Recall from Exercise (C3: Networks in several pieces) the notion we need: two vertices are linked if some sequence of vertices joins them with consecutive vertices sharing an edge, and the equivalence classes of this relation are the components of G. That “linked” is an equivalence relation (Definition 0.5.2) takes one line: it is reflexive by the sequence of length zero, symmetric because a sequence reversed is again one, and transitive because two sequences may be concatenated. So the components partition the vertices (Theorem 0.5.2), which is what Step 3 below uses.

Theorem 24.11.2 (The Kernel of the Laplacian)

Let G be a graph on m vertices with k≥1 edges, with components C1,…,Cc, and let 1Cr∈Rm be the vector with entry 1 at the vertices of Cr and 0 elsewhere. Then nul(L)=span(1C1,…,1Cc), this list is a basis, and the eigenvalue 0 of L has multiplicity exactly c. In particular L is singular, and nul(L)=span(1) exactly when G is connected.

Idea. For a positive semidefinite matrix, lying in the kernel and making the quadratic form vanish are the same condition, and Proposition 24.11.1 (b) turns the second one into a statement with no linear algebra in it at all: the labeling is constant across every edge. Constant across every edge propagates along chains of edges, so it means constant on each component, which is exactly what the indicator vectors describe.

Proof. Step 1: x∈nul(L) if and only if x⊤Lx=0. If Lx=0, then x⊤Lx=0. Conversely, if x⊤Lx=0, then ‖N⊤x‖2=0 by the display in the proof of Proposition 24.11.1 (b), so N⊤x=0 and Lx=N(N⊤x)=0.

Step 2: x⊤Lx=0 if and only if x is constant on each component. By Proposition 24.11.1 (b), x⊤Lx is a sum of squares of real numbers, so it vanishes if and only if every term does, that is, if and only if xu=xv for every edge with ends u and v. Suppose this holds and let u,w lie in the same component. By the definition of linked there is a sequence u=w0,w1,…,wt=w with consecutive vertices joined by an edge, so xu=xw1=⋯=xw. Hence x is constant on each component. Conversely, if x is constant on each component, then the two ends of any edge lie in the same component and carry the same label, so every term vanishes.

Step 3: the indicators are a basis. By Steps 1 and 2, x∈nul(L) if and only if x=∑r=1cλr1Cr, where λr is the common value of x on Cr; so the list spans nul(L). It is linearly independent: if ∑rλr1Cr=0, then reading the entry at any vertex of Cr gives λr=0, since the components are disjoint and only the r-th vector is non-zero there. Hence dim⁡nul(L)=c.

Step 4: multiplicity. L is symmetric by Proposition 24.11.1 (a), so by Corollary 12.5.2 it is orthogonally diagonalizable, and the number of times 0 occurs in its eigenvalue list is the dimension of its 0-eigenspace, which is nul(L). That dimension is c≥1, so L is singular. Finally, G is connected exactly when c=1, and then C1 is the whole vertex set and 1C1=1.

This is the first of the two theorems that the Laplacian is for. Notice how little it costs: the entire combinatorial content sits in Step 2, and the only property of L used is that its quadratic form is a sum of squares over the edges.

24.11.3. The Fiedler value

Theorem 24.11.2 says that 0 is always an eigenvalue and that its multiplicity detects whether the graph falls apart. The natural next question is quantitative: if the graph is connected, how connected is it? The eigenvalue just above 0 answers this, and the reason is Proposition 24.11.1 (b) again.

Because L⪰0, all its eigenvalues are ≥0 (Theorem 13.1.4 (b)), and it is convenient here to list them increasingly, against the book’s usual convention. Write μ1(L)≤μ2(L)≤⋯≤μm(L) for the eigenvalues of L with multiplicity in increasing order, so that μj(L)=λm+1−j(L) in the decreasing notation of Chapter 17. By Theorem 24.11.2, μ1(L)=0.

Definition 24.11.2 (Fiedler value)

Let G be a graph on m≥2 vertices with at least one edge. The Fiedler value, or algebraic connectivity, of G is the second smallest eigenvalue μ2(L) of its Laplacian, counted with multiplicity.

For the complete graph Km, in which every pair of distinct vertices is joined by one edge, Proposition 24.11.1 (a) gives L=mI−J, where J is the all-ones matrix. Every row of J equals 1⊤, so rankJ=1 and 0 is an eigenvalue of J of multiplicity m−1 by Theorem 3.5.7; and J1=m1 supplies the last eigenvalue m. Hence L has eigenvalues 0 once and m with multiplicity m−1, and the Fiedler value of Km is m. For a graph in two or more pieces it is 0, by Theorem 24.11.2. A single edge on two vertices has Laplacian (1−1−11) and Fiedler value 2. The degenerate case m=1 is excluded because there is no second eigenvalue.

Proposition 24.11.3 (Positive Fiedler Value Means Connected)

Let G be a graph on m≥2 vertices with at least one edge. Then μ2(L)>0 if and only if G is connected.

Proof. The eigenvalues of L are ≥0, so μ2(L)=0 if and only if the eigenvalue 0 occurs at least twice in the list, that is, if and only if its multiplicity c is at least 2 (Theorem 24.11.2). That happens exactly when G has two or more components, that is, exactly when G is not connected.

The number μ2(L) is therefore a graded version of connectedness, and the grading has a meaning that can be read off directly.

Proposition 24.11.4 (The Fiedler Value as a Minimum)

Let G be a graph on m≥2 vertices with at least one edge. Then μ2(L)=min{x⊤Lxx⊤x : x∈Rm, x≠0, x⊤1=0}, and the minimum is attained at an eigenvector for μ2(L).

Idea. The quantity being minimized is the Rayleigh quotient RL of Chapter 17. Over all of Rm its minimum is μ1(L)=0, attained at 1, so the constraint x⊥1 exactly removes the direction that achieves 0. What makes this work is that an orthonormal eigenbasis can be chosen with 1/m as its first member; after that the computation is the weighted-average argument of Chapter 17, run once.

Proof. Since L is symmetric, Corollary 12.5.2 supplies an orthonormal basis (q1,…,qm) of Rm with Lqj=μj(L)qj, the eigenvalues in the prescribed increasing order; moreover the basis may be chosen so that q1=1/m. Indeed, let E0=nul(L), of dimension c≥1 by Theorem 24.11.2, and note 1∈E0 and 1≠0. Applying Gram–Schmidt (Theorem 11.2.2) to a basis of E0 beginning with 1 gives an orthonormal basis of E0 whose first member is 1/m; joining it to orthonormal bases of the other eigenspaces gives the required basis, because μ1(L)=⋯=μc(L)=0 are the eigenvalues attached to E0.

Now let x≠0 with x⊤1=0, and write cj=⟨x,qj⟩, so that x=∑jcjqj by Theorem 11.2.1 (a). The constraint says c1=⟨x,1⟩/m=0. Hence, by Theorem 11.2.1 (b), (c), x⊤Lxx⊤x=∑j≥2μj(L)cj2∑j≥2cj2 ≥ μ2(L), a weighted average of μ2(L),…,μm(L) with non-negative weights, not all zero, being at least the smallest of them. Taking x=q2, which satisfies q2⊥q1=1/m and is non-zero, gives the value μ2(L). So the set has minimum μ2(L), attained at q2.

Remark. This is the k=m−1 case of the max–min half of Theorem 17.2.3, read in the increasing indexing: there λm−1(L)=μ2(L) is the largest value that any (m−1)-dimensional subspace can guarantee for RL, and the proposition says that the particular subspace 1⊥ already guarantees it.

A vector achieving the minimum is called a Fiedler vector. It must have entries of both signs, since it is orthogonal to 1, and Proposition 24.11.1 (b) says it is a labeling that keeps neighbors as close together as it can while being spread out overall. Splitting the vertices by the sign of a Fiedler vector is therefore a reasonable guess at a partition that cuts few edges.

Example (Two triangles and a bridge)

Let G have vertices 1,…,6 and edges {1,2}, {1,3}, {2,3}, {3,4}, {4,5}, {4,6}, {5,6}: two triangles joined by a single edge.

Diagram: Two triangles and a bridge. Labels: 1, 2, 3, 4, 5, 6

Find the Fiedler value and a Fiedler vector, and read off the partition.

Solution. The degrees are 2,2,3,3,2,2, so L=(2−1−1000−12−1000−1−13−10000−13−1−1000−12−1000−1−12). Rather than expand a 6×6 characteristic polynomial, guess the shape of the answer from the symmetry: the graph is carried to itself by the reflection 1↔6, 2↔5, 3↔4, and by the swap 1↔2. Look for an eigenvector reversed by the reflection and fixed by the swap, that is, of the form x=(1,1,b,−b,−1,−1). Rows 1 and 3 of Lx=μx read 1−b=μ,−2+4b=μb, the other four rows repeating these by symmetry. Substituting μ=1−b into the second gives −2+4b=b−b2, that is b2+3b−2=0, whose positive root is b=(17−3)/2. Then μ=1−b=5−172≈0.4384. The vector x satisfies x⊤1=2+b−b−2=0, so by Proposition 24.11.4 its Rayleigh quotient, which is μ, is at least μ2(L); and μ>0, so μ≠μ1(L)=0. To see that μ really is the second smallest, note that x and 1 are eigenvectors for the distinct eigenvalues μ and 0, and check that the remaining four eigenvalues are larger: the vectors (1,−1,0,0,0,0), (0,0,0,0,1,−1) and (1,1,−2,−2,1,1) are eigenvectors for the eigenvalue 3, as one verifies row by row, and they are visibly independent, so together with 1 and x they account for five of the six. For the third of them, for instance, row 3 of L gives −1−1−6+2=−6=3⋅(−2) and row 1 gives 2−1+2=3=3⋅1. The trace of L is 2+2+3+3+2+2=14, so the sixth eigenvalue is 14−(0+μ+3+3+3)=5−μ=(5+17)/2, also larger than μ. Hence μ2(L)=5−172,x=(1,1,17−32,−17−32,−1,−1) is a Fiedler vector, and the signs of its entries split the vertices as {1,2,3}∣{4,5,6}: exactly the two triangles, cut along the bridge.

Compare the Fiedler value 0.4384… of this graph with the value 6 for K6. Small means “nearly disconnected”, and the bridge is what makes it small. One general fact in that direction is immediate from Chapter 17.

Proposition 24.11.5 (Adding an Edge Raises No Eigenvalue) Optional: nothing later depends on this.

Let G be a graph on m vertices with at least one edge, and let G′ be G with one extra edge joining u≠v. Then L′=L+ww⊤ with w=eu−ev, and μj(L′) ≥ μj(L)(j=1,…,m). In particular the Fiedler value does not decrease when an edge is added.

Proof. The extra edge adds 1 to deg⁡(u) and to deg⁡(v) and 1 to auv and avu, so by Proposition 24.11.1 (a), L′−L has entries 1 at (u,u) and (v,v), −1 at (u,v) and (v,u), and 0 elsewhere; that matrix is ww⊤. Now ww⊤ is symmetric, and x⊤ww⊤x=(w⊤x)2≥0 for every x, so ww⊤⪰0 and L′⪰L in the Loewner order (Definition 13.5.1). By Corollary 17.2.4, λi(L′)≥λi(L) for every i, and rewriting the decreasing index i=m+1−j as the increasing index j gives the claim.

24.11.4. Counting spanning trees

Now the second theorem, and the one Chapter 7 promised. Two more words are needed, and both are about the graph alone.

A cycle is a set of edges {f1,…,ft} with t≥2 that can be listed together with distinct vertices w0,w1,…,wt−1 so that, setting wt=w0, the edge fi joins wi−1 to wi for each i. Two edges joining the same pair of vertices form a cycle with t=2. A spanning tree of G is a set T of edges such that the graph with all m vertices and only the edges of T is connected and contains no cycle. In Exercise (C1: Counting spanning trees) the phrase was “a set of 3 edges that connects all four vertices”, and the proposition below reconciles the two descriptions.

The bridge from graphs to determinants is the following lemma. It is where such proofs usually go wrong, so read the third part carefully: it is a statement about (m−1)×(m−1) submatrices of N with one row deleted, not about arbitrary square submatrices, and the “exactly when” is an equivalence in both directions.

Lemma 24.11.6 (Unimodularity of Incidence Minors)

Let N∈Mm×k(R) be the incidence matrix of an oriented graph G with m vertices and k≥1 edges. Write ne∈Rm for the column of N belonging to the edge e.

  • (a) Every square submatrix of N has determinant 0, 1 or −1.
  • (b) For a set S of edges, the list (ne)e∈S is linearly independent if and only if S contains no cycle.
  • (c) Fix a vertex r and put I=[m]∖{r}. For a set S of exactly m−1 edges, S is a spanning tree of G if and only if it contains no cycle, and detNI,S={±1if S is a spanning tree of G,0otherwise.

Idea. ① For (a), induct on the size of the square submatrix and look at its columns. A column of N restricted to a subset of the rows keeps at most the one 1 and the one −1. If some column of the submatrix is zero, the determinant is 0; if some column has a single non-zero entry, expand along it and the size drops; and if every column has both, then the rows of the submatrix add up to zero, so they are dependent. ② For (b), a cycle gives an explicit dependence — walk around it and the telescoping sum collapses. Conversely a dependence, restricted to the edges with non-zero coefficient, forces every vertex to meet either none or at least two of them, and a finite graph with that property contains a cycle. ③ Part (c) combines the two, once one knows that deleting the row r costs no rank, which it does not, because the rows of N already sum to zero.

Proof. (a) We induct on t, the common number of rows and columns of the square submatrix B=NI′,S′. For t=1, B is a single entry of N, which is 0, 1 or −1 by Definition 3.7.1. Let t≥2 and assume the claim for t−1. Each column of N has exactly one 1 and one −1, so each column of B has at most one 1 and at most one −1 and no other non-zero entries. Three cases.

Case 1: some column of B is zero. Then detB=0 by Theorem 7.2.1.

Case 2: some column of B has exactly one non-zero entry ε=±1, in row p say. Expanding along that column (Theorem 7.6.1) gives detB=±εdetB′, where B′ is B with that row and column deleted. But B′ is again a square submatrix of N, of size t−1, so detB′∈{0,1,−1} by the induction hypothesis, and hence so is detB.

Case 3: every column of B has both a 1 and a −1. Then every column sums to 0, so the sum of all t rows of B is the zero row; the rows are linearly dependent, and detB=0 by Theorem 7.2.1 and Theorem 7.4.5.

These three cases are exhaustive, which completes the induction.

(b) (⇐) We prove the contrapositive: suppose ∑e∈Saene=0 with some ae≠0, and let S′={e∈S:ae≠0}, a non-empty subset of S. Fix a vertex v. Entry v of the sum is ∑e∈S′aeNve, and Nve=±1 exactly for the edges of S′ meeting v, and 0 otherwise. If exactly one edge e0∈S′ met v, that entry would be ±ae0≠0, contradicting the sum being 0. So every vertex meets either no edge of S′ or at least two.

Now build a walk. Pick any f1∈S′, with ends w0 and w1. Having reached wi along fi, the vertex wi meets at least two edges of S′, so we may choose fi+1∈S′ with fi+1≠fi meeting wi, and let wi+1 be its other end. Since there are only m vertices, some vertex repeats; let i be the smallest index with wi∈{w0,…,wi−1}, and let j<i be the index with wj=wi. Then wj,wj+1,…,wi−1 are distinct, by the minimality of i, and fj+1,…,fi join them in a closed chain. Put t=i−j. First, t≥2: t=1 would mean that fj+1 joins wj to itself, and an edge joins two distinct vertices. Second, the t edges are distinct: for t=2 that is the construction, fj+2≠fj+1; and for t≥3 the pairs {wa−1,wa} for j+1≤a≤i are pairwise different pairs of the distinct vertices wj,…,wi−1, so the edges joining them differ. So {fj+1,…,fi} is a cycle, and it lies in S′⊆S.

(⇒) Again by contraposition. Let {f1,…,ft}⊆S be a cycle with vertices w0,…,wt−1 and wt=w0 as in the definition. For each i set εi=1 if fi is oriented from wi−1 to wi, and εi=−1 otherwise. By Definition 3.7.1 the column of an edge oriented from a to b is ea−eb, so in either case εinfi=ewi−1−ewi. Summing telescopes: ∑i=1tεinfi=ew0−ewt=0, a dependence with all coefficients ±1, so the list (ne)e∈S is dependent.

(c) Write NS=N[m],S∈Mm×(m−1)(R) for the full columns and NI,S∈Mm−1(R) for the same columns with row r deleted. Every column of N sums to 0, so row r of NS is minus the sum of the other rows; deleting it therefore does not change the row space, and by Theorem 3.5.5 rankNI,S=rankNS. Hence detNI,S≠0 if and only if rankNS=m−1 (Theorem 3.4.4 and Theorem 7.5.2), that is, if and only if the m−1 columns (ne)e∈S are linearly independent, which by (b) holds if and only if S contains no cycle. When it does not vanish, detNI,S=±1 by (a).

It remains to check the equivalence in the statement: for a set S of m−1 edges, “no cycle” and “spanning tree” agree. A spanning tree contains no cycle by definition. Conversely, suppose S has m−1 edges and no cycle; we must show that the graph H with all m vertices and the edges of S is connected. By (b) the columns of NS are independent, so rankNS=m−1 and dim⁡col(NS)=m−1. Each column of NS lies in W={z∈Rm:z1+⋯+zm=0}, which has dimension m−1 as computed in the proof of Corollary 3.7.5, so col(NS)=W by Theorem 1.6.8. Suppose H were disconnected, and let C be the vertex set of one of its components, so ∅≠C≠[m]. Every edge of S has both ends in C or both ends outside C, so 1C⊤ne=0 for every e∈S, and hence 1C⊤z=0 for every z∈col(NS)=W. But choosing u∈C and v∉C gives z=eu−ev∈W with 1C⊤z=1≠0, a contradiction. So H is connected, and S is a spanning tree.

Remark. Part (a) says that N is totally unimodular, the standard name for a matrix every square submatrix of which has determinant 0, 1 or −1. The orientation is essential: for the triangle with edges {1,2},{2,3},{3,1}, the unoriented matrix of the warning above is (101110011), whose determinant is 2. Case 3 of the proof is exactly where the −1 is spent.

One consequence of the last paragraph of the proof is worth recording separately, since it is what makes the sum in the theorem below a sum over spanning trees rather than over sets of every size.

Proposition 24.11.7 (A Spanning Tree Has m−1 Edges)

Let G be a graph on m≥2 vertices. Every spanning tree of G has exactly m−1 edges. Conversely, if a set S of exactly m−1 edges is such that the graph on all m vertices with edge set S is connected, then S is a spanning tree.

Proof. Let T be a spanning tree and let H be the graph on all m vertices with edge set T. Then H is connected, so T≠∅ (for m≥2) and Proposition 3.7.4 applied to H gives rankNT=m−1, where NT is the incidence matrix of H with some orientation, that is, the columns of N indexed by T. Also T contains no cycle, so those columns are linearly independent by Lemma 24.11.6 (b), and therefore |T|=rankNT=m−1.

Conversely, let S have exactly m−1 edges and let H be the graph on all m vertices with edge set S, assumed connected. By Proposition 3.7.4 applied to H, rankNS=m−1, where NS is the incidence matrix of H, that is, the columns of N indexed by S; it has m−1 columns, so Theorem 3.5.7 gives nul(NS)={0}; since NSa=∑e∈Saene by Theorem 0.9.3, the columns (ne)e∈S are linearly independent. By Lemma 24.11.6 (b), S contains no cycle, and H is connected, so S is a spanning tree. In particular the sets counted here are exactly the “sets of 3 edges that connect all four vertices” of Exercise (C1: Counting spanning trees).

Theorem 24.11.8 (Matrix-Tree Theorem)

Let G be a graph on m≥2 vertices with k≥1 edges and Laplacian L. Fix a vertex r, and let L0=LI,I∈Mm−1(R) be L with the row and the column of r deleted, where I=[m]∖{r}. Then detL0=#{spanning trees of G}. In particular the answer does not depend on which vertex r is deleted, and detL0=0 exactly when G is disconnected.

Idea. The determinant of L0 is the determinant of a Gram matrix, because L0=N0N0⊤ for the reduced incidence matrix N0. Corollary 7.7.3 writes such a determinant as a sum of squares of (m−1)×(m−1) minors, one for each set of m−1 edges. Lemma 24.11.6 says that each of those squares is 1 for a spanning tree and 0 for anything else. So the sum counts spanning trees, one apiece. Every step has already been proved; the theorem is the three of them placed in a row.

Proof. Fix an orientation of G, with incidence matrix N, and put N0=NI,[k]∈M(m−1)×k(R), the matrix N with the row of r deleted.

Step 1: L0=N0N0⊤. By Theorem 0.9.2, the (u,v)-entry of NN⊤ is row u of N dotted with row v of N. Deleting the row and the column of r from NN⊤ therefore leaves exactly the dot products of the rows indexed by I, which is N0N0⊤.

Step 2: Cauchy–Binet. Applying Corollary 7.7.3 to N0∈M(m−1)×k(R), detL0=∑S⊆[k]|S|=m−1(det(N0)[m−1],S)2, one term for each set S of exactly m−1 edges. The submatrix (N0)[m−1],S keeps all rows of N0 and the columns S, so it is the submatrix of N on rows I and columns S, namely NI,S.

Step 3: identify the terms. By Lemma 24.11.6 (c), detNI,S=±1 when S is a spanning tree and 0 otherwise, so each term of the sum is 1 for a spanning tree and 0 otherwise. By Proposition 24.11.7 every spanning tree has exactly m−1 edges, so every spanning tree occurs as one of the sets S, and it occurs once. Hence the sum is the number of spanning trees.

The left-hand side of Step 2 was computed from a particular r, and the right-hand side does not mention r, so the value is the same for every choice. Finally, a disconnected graph has no spanning tree, since a spanning tree is connected on all m vertices, so the sum is empty and detL0=0. A connected graph has at least one: by Proposition 3.7.4, rankN=m−1, and deleting the row of r does not change the row space, since every column of N sums to 0, so rankN0=m−1 by Theorem 3.5.5. As N0 has m−1 rows, Theorem 7.7.1 (a) gives a non-zero (m−1)×(m−1) minor of N0, which uses all its rows and some set S of m−1 columns; that minor is detNI,S≠0, so S is a spanning tree by Lemma 24.11.6 (c). Hence detL0=0 exactly when G is disconnected.

Example (The four-vertex graph, counted both ways)

For the graph of Example (A Laplacian computed twice), compute detL0 with r=4, and list the spanning trees.

Solution. Deleting the row and column of vertex 4 from the Laplacian computed in Example (A Laplacian computed twice) leaves the 3×3 matrix whose determinant Exercise (C1: Counting spanning trees) (a) expands along its first row: detL0=8.

Now count directly. A spanning tree has 4−1=3 edges by Proposition 24.11.7, and there are (53)=10 sets of three edges. By Lemma 24.11.6 (c) such a set fails to be a spanning tree exactly when it contains a cycle, and the only cycles with three or fewer edges are the triangles {e1,e2,e5} on vertices 1,2,3 and {e3,e4,e5} on vertices 1,3,4, in the edge numbering of Example (A Laplacian computed twice). So 10−2=8 of the sets are spanning trees, matching detL0=8.

As a check on one term of the sum in the proof, the tree {e1,e2,e3} gives, on rows I={1,2,3}, NI,{1,2,3}=(100−1100−11), lower triangular with determinant 1 (Theorem 7.4.6). The matching computation for a non-tree, whose minor is 0, is Exercise (C1: Counting spanning trees) (d).

Warning. Delete one row and the matching column, and no more. The Laplacian itself is always singular by Theorem 24.11.2, so detL=0 says nothing. Deleting two vertices does not count anything either: for the four-cycle with edges {1,2},{2,3},{3,4},{4,1}, striking out the rows and columns of 3 and 4 leaves (2−1−12), of determinant 3, while the graph has 4 spanning trees. And the proof needs the deleted row and the deleted column to belong to the same vertex, since Step 1 produces a Gram matrix N0N0⊤ only then; that is a constraint on this route, and nothing above claims that a mismatched pair of deletions counts nothing. Note also that the theorem counts sets of edges, so parallel edges count as different trees: two vertices joined by three parallel edges have L=(3−3−33), L0=(3) and three spanning trees, one per edge.

Two theorems, both proved from the single identity x⊤Lx=∑e(xue−xve)2 and the single factorization L=NN⊤. The first reads the graph’s components off the spectrum of L; the second reads the number of its spanning trees off one determinant, replacing a search over all (km−1) edge sets by one O(m3) elimination (Proposition 24.2.3 (a)). Both are statements about a graph that no purely combinatorial argument delivers as cheaply.

24.11.5. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define the Laplacian of a graph, and say why it does not depend on the orientation used to define it.
  • (b) Write down the formula for x⊤Lx as a sum over edges, and deduce that L⪰0.
  • (c) State the matrix-tree theorem, including all its hypotheses.
  • (d) True or false: a graph on m vertices is connected if and only if rankL=m−1. Justify your answer.
  • (e) True or false: if L has eigenvalue 0 with multiplicity 1, then detL0>0. Justify your answer.

Solution.

  • (a) With N the incidence matrix of any orientation, L=NN⊤ (Definition 24.11.1). By Proposition 24.11.1 (a), L=D−A, and the degree matrix and the adjacency matrix are determined by the graph alone.

  • (b) x⊤Lx=∑e(xue−xve)2, where ue,ve are the ends of e (Proposition 24.11.1 (b)). This is a sum of squares of real numbers, hence ≥0, and L is symmetric, so L⪰0 by Definition 13.1.1.

  • (c) For a graph on m≥2 vertices with at least one edge, and any vertex r, the matrix L0 obtained from L by deleting the row and the column of r satisfies detL0= the number of spanning trees (Theorem 24.11.8). Multiple edges are allowed; loops are not, since edges join distinct vertices.

  • (d) True. By Theorem 24.11.2, dim⁡nul(L)=c, the number of components, so Theorem 3.5.7 gives rankL=m−c; and c=1 is connectedness.

  • (e) True. Multiplicity 1 means c=1 by Theorem 24.11.2, so the graph is connected and has at least one spanning tree, and detL0≥1 by Theorem 24.11.8.

B. Practice

Exercise (B1: The four-cycle)

Let C4 be the graph on vertices 1,2,3,4 with edges {1,2},{2,3},{3,4},{4,1}.

  • (a) Write down L and explain why it is a circulant in the sense of Definition 12.9.1.
  • (b) Find all eigenvalues of L, the Fiedler value, and a Fiedler vector.
  • (c) Compute detL0 and list the spanning trees.

Solution.

  • (a) Every vertex has degree 2, and the vertices u,v are joined exactly when v−u≡±1(mod4). So, numbering rows and columns 0,1,2,3 as in Chapter 12 §09, the (j,k)-entry depends only on k−j modulo 4, which is Definition 12.9.1; the first row is c=(2,−1,0,−1) and L=(2−10−1−12−100−12−1−10−12).

  • (b) By Theorem 12.9.4 the eigenvalues are pc(ωj) for ω=i, with pc(x)=2−x−x3. These were computed in Exercise (B1: Eigenvalues of small circulants) (c): pc(1)=0, pc(i)=2, pc(−1)=4, pc(−i)=2. In increasing order the eigenvalues are 0,2,2,4, so the Fiedler value is μ2(L)=2. A real eigenvector for 2 is twice the real part of the Fourier vector f1=12(1,i,−1,−i), namely (1,0,−1,0); it is orthogonal to 1, and L(1,0,−1,0)=(2,0,−2,0), confirming the eigenvalue. So (1,0,−1,0) is a Fiedler vector, splitting the cycle as {1}∣{3} with 2 and 4 undecided.

  • (c) Deleting the row and column of vertex 4, detL0=det(2−10−12−10−12)=2(4−1)+1(−2−0)=4. Directly: a spanning tree has 3 edges, and the only 3-edge subsets that are not spanning trees would have to contain a cycle; the only cycle is all four edges, so every one of the (43)=4 three-edge subsets is a spanning tree. Both counts give 4.

Exercise (B2: Counting trees in a bowtie)

Let G have vertices 1,…,5 and edges {1,2},{1,3},{2,3},{3,4},{3,5},{4,5}: two triangles sharing the vertex 3.

  • (a) Write down L and compute detL0 with r=1.
  • (b) Count the spanning trees directly, and check that the two answers agree.
  • (c) Verify that x=(1,1,0,−1,−1) is an eigenvector of L, and say what its eigenvalue tells you.

Solution.

  • (a) The degrees are 2,2,4,2,2, so L=(2−1−100−12−100−1−14−1−100−12−100−1−12),L0=(2−100−14−1−10−12−10−1−12). Expanding detL0 along the first row: 2det(4−1−1−12−1−1−12)+1⋅det(−1−1−102−10−12). The first 3×3 determinant is 4(4−1)+1(−2−1)−1(1+2)=12−3−3=6, and the second is −1(4−1)=−3. So detL0=12−3=9.

  • (b) Removing the vertex 3 separates the graph into the two triangles, and a set of edges is a spanning tree exactly when it meets each triangle in a spanning tree of that triangle: the two triangles share only the vertex 3, so no cycle can use edges from both, and connectedness of the whole is connectedness of each half through 3. Each triangle has 3 spanning trees, namely its 3 pairs of edges. Hence there are 3×3=9 spanning trees, agreeing with (a).

  • (c) Lx has entries 2−1−0=1, −1+2−0=1, −1−1+0+1+1=0, 0−2+1=−1, 0+1−2=−1, so Lx=x and the eigenvalue is 1. Since x⊤1=0, Proposition 24.11.4 gives μ2(L)≤RL(x)=1. The Fiedler value is therefore at most 1, much smaller than the value 5 for the complete graph K5, computed after Definition 24.11.2, and the sign pattern of x proposes the partition {1,2}∣{4,5} with the shared vertex 3 sitting on the fence: the graph is nearly two pieces.

Exercise (B3: Which minors are ±1?)

Let G be the graph on vertices 1,2,3 with edges e1={1,2}, e2={2,3}, e3={1,3}, e4={1,2} (so e1 and e4 are parallel). Orient every edge from the smaller vertex to the larger, let r=3 and I={1,2}.

  • (a) Write down N and N0=NI,[4].
  • (b) Compute detNI,S for all six sets S of two edges, and say in each case whether S is a spanning tree.
  • (c) Hence find the number of spanning trees, and check it against detL0.

Solution.

  • (a) Column e has 1 at the tail and −1 at the head: N=(1011−110−10−1−10),N0=(1011−110−1).

  • (b) Taking the two columns in increasing order each time, {e1,e2}:det(10−11)=1,{e1,e3}:det(11−10)=1,{e1,e4}:det(11−1−1)=0,{e2,e3}:det(0110)=−1,{e2,e4}:det(011−1)=−1,{e3,e4}:det(110−1)=−1. Five of the six are ±1 and those five sets are spanning trees: each is a pair of edges covering all three vertices with no cycle. The exception is {e1,e4}, a cycle of length 2 formed by the parallel pair, which misses the vertex 3 entirely; its minor is 0, as Lemma 24.11.6 (c) predicts.

  • (c) So there are 5 spanning trees. The degrees are deg⁡(1)=3, deg⁡(2)=3, deg⁡(3)=2, and a12=2, a13=a23=1, so L=(3−2−1−23−1−1−12),detL0=det(3−2−23)=9−4=5. The two answers agree.

C. Going deeper

Exercise (C1: Cayley’s formula)

Let Km be the complete graph on m≥2 vertices, in which every pair of distinct vertices is joined by exactly one edge, and let Jt∈Mt(R) be the all-ones matrix.

  • (a) Show that the Laplacian of Km is mIm−Jm, and that L0=mIm−1−Jm−1 for every choice of deleted vertex.
  • (b) Prove that det(mIm−1−Jm−1)=mm−2.
  • (c) Deduce Cayley’s formula: Km has exactly mm−2 spanning trees. Check it for m=2,3,4 against a direct count.

Hint for (b): the eigenvalues of Jt are visible from its rank and its row sums.

Solution.

  • (a) Every vertex of Km has degree m−1 and auv=1 for u≠v, so by Proposition 24.11.1 (a), L=(m−1)Im−(Jm−Im)=mIm−Jm. Deleting the row and column of any one vertex from mIm−Jm leaves mIm−1−Jm−1, since the pattern of entries is the same at every vertex.

  • (b) Put t=m−1. The matrix Jt is symmetric with every row equal to 1⊤, so rankJt=1 and dim⁡nul(Jt)=t−1 by Theorem 3.5.7; hence 0 is an eigenvalue of multiplicity at least t−1. Also Jt1=t1, so t is an eigenvalue. That accounts for t eigenvalues, so the eigenvalue list of Jt is t,0,…,0. Therefore mIt−Jt has eigenvalues m−t=1 once and m with multiplicity t−1, and since Jt is symmetric it is diagonalizable (Corollary 12.5.2), so det(mIt−Jt)=1⋅mt−1=mm−2.

  • (c) By Theorem 24.11.8 and parts (a), (b), the number of spanning trees of Km is detL0=mm−2. For m=2: 20=1, and indeed the single edge is the only spanning tree. For m=3: 31=3, and the triangle’s spanning trees are its three pairs of edges. For m=4: 42=16; directly, K4 has (63)=20 sets of three edges, of which the 4 triangles are the only ones containing a cycle, leaving 20−4=16.

Exercise (C2: Weighted graphs)

Give each edge e of a graph G on m≥2 vertices a weight we>0, let W=diag(w1,…,wk), and define the weighted Laplacian Lw:=NWN⊤, with N the incidence matrix of any orientation.

  • (a) Prove that x⊤Lwx=∑ewe(xue−xve)2, and deduce that Lw⪰0 with the same kernel as L.
  • (b) Prove the weighted matrix-tree theorem: for any vertex r, detL0w=∑T ∏e∈Twe, the sum running over all spanning trees T of G.
  • (c) Check (b) on the graph of Example (A Laplacian computed twice) by comparing the coefficient of w1w2w3 on both sides, and confirm that setting every we=1 recovers Theorem 24.11.8.

Hint for (b): NWN⊤=(NW1/2)(NW1/2)⊤.

Solution.

  • (a) Let W1/2=diag(w1,…,wk), so W=W1/2W1/2 and W1/2 is symmetric. Put M=NW1/2. Then Lw=MM⊤ and, as in Proposition 24.11.1 (b), x⊤Lwx=‖M⊤x‖2=∑ewe(xue−xve)2, since entry e of M⊤x=W1/2N⊤x is we times entry e of N⊤x. The matrix is symmetric because (MM⊤)⊤=MM⊤, and the sum is ≥0, so Lw⪰0. As in Steps 1 and 2 of the proof of Theorem 24.11.2, x∈nul(Lw) if and only if this sum vanishes; every we is strictly positive, so the sum vanishes exactly when every difference xue−xve does, which is the same condition as for L. Hence the kernels agree.

  • (b) With M=NW1/2 as above and I=[m]∖{r}, the argument of Step 1 of Theorem 24.11.8 gives L0w=M0M0⊤ with M0=MI,[k]. By Corollary 7.7.3, detL0w=∑|S|=m−1(detMI,S)2. Multiplying N on the right by the diagonal matrix W1/2 scales column e by we, so MI,S=NI,SWS,S1/2 and, by Theorem 7.5.4 and Theorem 7.4.6, (detMI,S)2=(detNI,S)2∏e∈Swe. By Lemma 24.11.6 (c) the first factor is 1 when S is a spanning tree and 0 otherwise, and by Proposition 24.11.7 every spanning tree has m−1 edges and so occurs among the sets S, once. This gives the formula.

  • (c) For that graph, with r=4 and the edge numbering e1={1,2}, e2={2,3}, e3={3,4}, e4={4,1}, e5={1,3}, L0w=(w1+w4+w5−w1−w5−w1w1+w2−w2−w5−w2w2+w3+w5). The weight w3 occurs only in the (3,3)-entry, so in the Leibniz expansion (Definition 7.4.1) only the two permutations fixing 3 can produce a term containing w3: the identity, contributing (w1+w4+w5)(w1+w2)(w2+w3+w5), and the transposition of 1 and 2, contributing −(−w1)(−w1)(w2+w3+w5), every term of which carries a factor w12. So the coefficient of w1w2w3 comes from the diagonal product alone, and there it is 1. On the right, a spanning tree T contributes the single monomial ∏e∈Twe, and T is recovered from that monomial, so the coefficient of w1w2w3 is 1 if {e1,e2,e3} is a spanning tree and 0 otherwise; it is one, as Example (The four-vertex graph, counted both ways) records. Setting every we=1 gives W=I, hence Lw=L, and the right-hand side becomes the number of spanning trees: Theorem 24.11.8.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.