Folioby Interconnected
Log InSign Up

Introduction to Algebraic Graph Theory

The adjacency matrix, the Laplacian $L = D - A$, the matrix tree theorem, eigenvalues and connectivity, and a proof that the $(i,j)$-entry of $A^k$ counts the number of walks of length $k$.

FO
Folio Official
March 1, 2026

1. The Adjacency Matrix

Definition 1 (Adjacency matrix).
For a simple graph G=(V,E) on n vertices V={v1​,…,vn​}, the adjacency matrixA=A(G) is the n×n matrix defined by
Aij​={10​{vi​,vj​}∈E,otherwise.​
When G is undirected, A is a real symmetric matrix.
Example 2.
The path graph P3​ on vertices v1​−v2​−v3​ has adjacency matrix
A=​010​101​010​​.

v1​
v2​
v3​

2. Powers of the Adjacency Matrix and Walk Counting

The triangle K3​ on three vertices:

v1​
v2​
v3​

Theorem 3 (Combinatorial interpretation ofAk).
Let A be the adjacency matrix of a graph G. The (i,j)-entry of Ak equals the number of walks of length k from vi​ to vj​.
Proof.
We proceed by induction on k.

Base case (k=1).(A)ij​=1 if and only if vi​ and vj​ are adjacent, which corresponds to a single walk of length 1. If (A)ij​=0, there is no such walk.

Inductive step. Assume (Ak−1)iℓ​ counts the walks of length k−1 from vi​ to vℓ​ for every ℓ. Then
(Ak)ij​=ℓ=1∑n​(Ak−1)iℓ​⋅Aℓj​.
The term (Ak−1)iℓ​⋅Aℓj​ is nonzero only when vℓ​ and vj​ are adjacent (Aℓj​=1), in which case it counts the walks of length k−1 from vi​ to vℓ​, each of which extends to a walk of length k from vi​ to vj​ by appending the edge {vℓ​,vj​}. Summing over all possible intermediate vertices vℓ​ gives the total number of walks of length k from vi​ to vj​. □
Example 4.
The triangle K3​ has adjacency matrix A=​011​101​110​​ and A2=​211​121​112​​. The entry (A2)11​=2 reflects the two walks of length 2 from v1​ to itself: v1​v2​v1​ and v1​v3​v1​.

3. The Laplacian Matrix

Definition 5 (Degree matrix and Laplacian).
The degree matrixD of G is the diagonal matrix with Dii​=deg(vi​). The Laplacian of G is
L=L(G)=D−A.

Each row of L sums to zero (∑j​Lij​=Dii​−∑j​Aij​=deg(vi​)−deg(vi​)=0), so L1=0: the all-ones vector 1 is an eigenvector of L with eigenvalue 0.

Theorem 6 (Positive semidefiniteness of the Laplacian).
L(G) is positive semidefinite: xTLx≥0 for every x∈Rn.
Proof.
xTLx=i∑​Dii​xi2​−i,j∑​Aij​xi​xj​={vi​,vj​}∈E∑​(xi​−xj​)2≥0.
The last equality is obtained by expanding the contributions of each edge {vi​,vj​} to both the diagonal (D) and off-diagonal (A) terms. □

4. Eigenvalues and Connectivity

Since L is real symmetric and positive semidefinite, its eigenvalues can be arranged as 0=λ1​≤λ2​≤⋯≤λn​.

Theorem 7 (Connected components and the multiplicity of eigenvalue0).
The number of connected components of G equals the multiplicity of 0 as an eigenvalue of L(G).
Proof.
If G has c connected components G1​,…,Gc​, reordering the vertices by component makes L block-diagonal: L=L(G1​)⊕⋯⊕L(Gc​). Each L(Gk​) is positive semidefinite with L(Gk​)1k​=0, so each has eigenvalue 0 with multiplicity at least 1.

To see that the multiplicity is exactly 1 for each block: if L(Gk​)x=0, then xTL(Gk​)x=∑{vi​,vj​}∈E(Gk​)​(xi​−xj​)2=0, forcing xi​=xj​ for all adjacent pairs. Since Gk​ is connected, all components of x are equal, so kerL(Gk​) is one-dimensional.

Therefore the total multiplicity of eigenvalue 0 is c. □
Definition 8 (Algebraic connectivity).
For a connected graph G, the second-smallest eigenvalue λ2​(L(G)) is called the algebraic connectivity (or Fiedler value) of G.
Remark 9.
λ2​>0 is equivalent to G being connected. A larger λ2​ indicates stronger connectivity, making algebraic connectivity an important measure in spectral graph partitioning and clustering.

5. The Matrix Tree Theorem

Theorem 10 (Matrix tree theorem (Kirchhoff, 1847)).
Let G be a connected graph on n vertices with Laplacian L=L(G). Let Lii​ denote any cofactor of L obtained by deleting row i and column i. Then the number τ(G) of spanning trees of G is
τ(G)=Lii​=n1​λ2​λ3​⋯λn​,
where λ1​=0<λ2​≤⋯≤λn​ are the eigenvalues of L.
Proof.
We outline the argument. Let L^ be the (n−1)×(n−1) matrix obtained by deleting row i and column i from L. By the Cauchy–Binet formula,
detL^=∣S∣=n−1∑​(detBS​)2,
where B is the oriented incidence matrix of G with row i deleted, and S ranges over all (n−1)-element subsets of the edge set. One shows that detBS​=0 if and only if S forms a spanning tree, in which case detBS​=±1. Thus the sum counts spanning trees.

The eigenvalue formula detL^=n1​∏k=2n​λk​ follows from analysis of the characteristic polynomial of L. □
Example 11.
The Laplacian of K4​ has eigenvalues 0,4,4,4, giving τ(K4​)=41​⋅43=16. More generally, τ(Kn​)=nn−2, recovering Cayley's formula.

The following graph has τ(G)=8 spanning trees, which can be verified via any cofactor of its Laplacian:

v1​
v2​
v3​
v4​

Graph TheoryDiscrete MathematicsTextbookAdjacency MatrixLaplacianMatrix Tree Theorem
FO
Folio Official

Mathematics "between the lines" — exploring the intuition textbooks leave out, written in LaTeX on Folio.

1 followers·107 articles
Graph Theory TextbookPart 12 of 13
Previous
Graph Coloring
Next
Matroids and the Greedy Algorithm

Share your expertise with the world

Write articles with LaTeX support, build your audience, and earn from your knowledge.

Start Writing — It's Free

More from Folio Official

Folio Official·March 1, 2026

Paths and Connectivity

We formalize the notions of walks, paths, and cycles, then develop the theory of connected components, vertex and edge connectivity, cut vertices and bridges, the characterization of bipartite graphs, and Menger's theorem.

Graph TheoryDiscrete MathematicsTextbook
3
Folio Official·March 1, 2026

Eulerian and Hamiltonian Graphs: Two Classical Traversal Problems

From the Bridges of Königsberg to Euler's theorem on Eulerian circuits, directed Eulerian graphs, Hamiltonian cycles, the theorems of Ore and Dirac, and the NP-completeness of the Hamiltonian cycle problem.

Graph TheoryDiscrete MathematicsTextbook
1
Folio Official·March 1, 2026

Network Flows

Flow networks, the max-flow min-cut theorem, the Ford--Fulkerson method, the Edmonds--Karp algorithm, Dinic's algorithm, and the reduction of bipartite matching to maximum flow.

Graph TheoryDiscrete MathematicsTextbook
Folio Official·March 1, 2026

Recurrence Relations and Counting: Solving Linear Recurrences

We present the method of characteristic equations for solving linear recurrences with constant coefficients, treat the case of repeated roots, discuss nonhomogeneous recurrences, establish the equivalence with generating functions, and introduce matrix exponentiation and the Kitamasa method.

CombinatoricsDiscrete MathematicsTextbook