Spectral Graph Theory

Eigenvalues, the Laplacian, and spectral clustering

Spectral Graph Theory

Write a graph down as a matrix and its eigenvalues start to talk: they count the pieces, measure how tightly the graph holds together, and show where to cut it.

Graph Matrices Explorer

Pick a preset, click two vertices to toggle an edge, and switch between the A, D, and L tabs. Watch each matrix change with the graph.

Click a vertex to select, click two vertices to toggle edge

Adjacency Matrix A
1
2
3
4
1
0
1
0
0
2
1
0
1
0
3
0
1
0
1
4
0
0
1
0
4
Vertices (n)
3
Edges (m)
4×4
Matrix Size
Go deeper:Graph Matrices Explorer

Spectral graph theory studies the relationship between graph structure and the eigenvalues of associated matrices. By encoding a graph as a matrix, we can use powerful tools from linear algebra to uncover hidden properties.

The adjacency, degree, and Laplacian matrices each capture different aspects of a graph. Their eigenvalues reveal connectivity, expansion properties, and natural partitions that are invisible from the combinatorial perspective alone.

Every graph has associated matrices that encode its structure. The adjacency matrix A records which vertices are connected, the degree matrix D captures vertex degrees along the diagonal, and the Laplacian L = D - A combines both to encode connectivity. All three matrices are symmetric for undirected graphs, guaranteeing real eigenvalues — a prerequisite for the spectral analysis that follows.

Eigenvalue Properties

Switch between the preset graphs and watch the Laplacian spectrum. Count the zero eigenvalues on the disconnected graph, and compare lambda-2 across the connected ones.

Laplacian Spectrum
0
1
2
3
4
5
Zero (λ = 0)
λ₂ (Fiedler)
Other
Eigenvalues of L:
λ1 = 0.000
λ2 = 0.586
λ3 = 2.000
λ4 = 3.414
λ₂ = 0.586
Algebraic Connectivity
Graph is CONNECTED
1
Zero Eigenvalues
= 1 Connected Component
✓ λ₂ > 0 confirms the graph is connected!
The larger λ₂ is, the more "well-connected" the graph. K₄ has λ₂ = 4!
Go deeper:Eigenvalue Properties

The eigenvalues of the Laplacian matrix reveal graph structure. The number of zero eigenvalues equals the number of connected components, and the second-smallest eigenvalue lambda-2 (algebraic connectivity) tells us how well-connected the graph is. A graph is connected if and only if lambda-2 > 0. The larger lambda-2 is, the harder it is to disconnect the graph by removing edges — this is why it is called the algebraic connectivity.

Spectral Clustering

Pick a preset and press Run Clustering. Vertices split by the sign of their Fiedler vector entry: negative goes blue, positive goes red.

Fiedler Vector (eigenvector of λ₂)
v1
-0.47
v2
-0.26
v3
-0.47
v4
+0.47
v5
+0.47
v6
+0.26
Cluster assignment: negative → Cluster A (blue), positive → Cluster B (red)
Cluster A (negative)
Cluster B (positive)
Unclustered
Go deeper:Spectral Clustering

Spectral clustering uses the Fiedler vector (eigenvector of lambda-2) to partition graphs. Vertices are assigned to clusters based on the sign of their Fiedler vector component, naturally minimizing the number of edges cut. The Fiedler vector provides an optimal relaxation of the NP-hard minimum bisection problem — spectral methods turn a combinatorial optimization into a linear algebra computation.

Key Takeaways

  • A, D, and L = D - A turn a graph into linear algebra.
  • The zero eigenvalues of L count the connected components.
  • lambda-2 measures how well connected the graph is.
  • The signs of the Fiedler vector split a graph into two clusters.

Spot a mistake or have an idea?

Search