The Graph Laplacian: Spectral Graph Theory Explained Simply
Published:
What Is the Laplacian?
Given a graph on \(N\) nodes with adjacency matrix \(A\) (where \(A_{ij} = 1\) if \((i,j)\) is an edge) and degree matrix \(D = \mathrm{diag}(d_1,\dots,d_N)\) with \(d_i = \sum_j A_{ij}\), the Graph Laplacian is:
That’s it. For a 4-node graph where node 1 has degree 3, node 2 has degree 2, node 3 has degree 3, node 4 has degree 2:
[3 0 0 0] [0 1 1 1] [ 3 -1 -1 -1]
L = [0 2 0 0] - [1 0 1 0] = [-1 2 -1 0]
[0 0 3 0] [1 1 0 1] [-1 -1 3 -1]
[0 0 0 2] [1 0 1 0] [-1 0 -1 2]
That is, \(L_{ij} = d_i\) if \(i = j\), \(-1\) if \((i,j)\) is an edge, and \(0\) otherwise.
Why Does This Matter?
The Laplacian is the discrete analogue of the second derivative (or more precisely, the negative of the Laplace operator \(\nabla^2\)). In continuous space, the Laplacian of a function \(f\) measures how much \(f\) at a point differs from \(f\) at nearby points.
On a graph, for a signal \(f \in \mathbb{R}^N\),
where \(\mathcal{N}(i)\) is the set of neighbours of node \(i\). It measures how much node \(i\)’s value differs from its neighbours’ values. If all neighbours have the same value as \(i\), then \((Lf)[i] = 0\).
Concrete Numerical Example
For the 4-node graph above, let’s verify the Laplacian formula entry by entry:
L[1][1] = deg(1) = 3, L[1][2] = -A[1][2] = -1 (edge exists)
L[1][3] = -A[1][3] = -1 (edge exists), L[1][4] = -A[1][4] = -1 (edge exists)
Check the "row sum = 0" property:
Row 1: 3 + (-1) + (-1) + (-1) = 0 ✓
This zero row-sum is crucial: it means the all-ones vector \(\mathbf{1} = [1,1,1,1]^{\top}\) satisfies \(L\mathbf{1} = 0\) — confirming \(\lambda_1 = 0\).
The Eigendecomposition: Graph Fourier Transform
The Laplacian \(L\) is symmetric — hence orthogonally diagonalisable — and positive semi-definite, since \(f^{\top} L f = \sum_{(u,v)\in E}(f[u]-f[v])^2 \ge 0\) for every \(f\). It can therefore be decomposed as:
where \(U = [u_1, u_2, \ldots, u_N]\) holds the orthonormal eigenvectors and \(\Lambda = \mathrm{diag}(\lambda_1 \le \lambda_2 \le \cdots \le \lambda_N)\) the eigenvalues.
This is exactly analogous to the Fourier transform:
- Eigenvectors \(u_k\): the “basis functions” — the graph’s Fourier modes.
- Eigenvalues \(\lambda_k\): the “frequencies”. Indeed \(\lambda_k = u_k^{\top} L u_k = \sum_{(u,v)\in E}(u_k[u]-u_k[v])^2\), so a small \(\lambda_k\) literally means a smooth, slowly varying mode and a large \(\lambda_k\) a rapidly oscillating one.
Projecting a signal \(f\) onto \(U\) gives its frequency content, \(\hat{f} = U^{\top}f\) — the Graph Fourier Transform.
What Eigenvalues Tell You
- \(\lambda_1 = 0\) always, with eigenvector \(\mathbf{1}\) (this holds for any graph, connected or not).
- The multiplicity of eigenvalue \(0\) = the number of connected components. A graph with 3 disconnected clusters has exactly 3 zero eigenvalues.
- \(\lambda_2\) (the algebraic connectivity or Fiedler value): zero when the graph is disconnected; close to \(0\) means barely connected; large means well-connected and hard to cut.
- The eigenvector \(u_2\) for \(\lambda_2\) (the Fiedler vector) suggests a partition of the graph into two communities by the sign of its entries — the basis of spectral clustering. It is a relaxation of the NP-hard minimum-ratio-cut problem, so it is a good heuristic rather than a guaranteed optimum.
Animated Heat Diffusion
From Laplacian to GCN
Spectral graph convolution convolves a signal with a filter in the Laplacian eigenspace:
where \(g_\theta(\Lambda) = \mathrm{diag}\bigl(g_\theta(\lambda_1),\ldots,g_\theta(\lambda_N)\bigr)\) reweights each frequency.
This is computationally expensive (the eigendecomposition costs \(O(N^3)\)). GCN (Kipf & Welling, 2017) made two simplifications:
- Restrict \(g_\theta\) to a low-order polynomial in \(L_{\mathrm{sym}}\), so that \(U g_\theta(\Lambda) U^{\top} = g_\theta(L_{\mathrm{sym}})\) and no eigendecomposition is needed. Truncating the Chebyshev expansion at first order gives \(g_\theta(L_{\mathrm{sym}}) \approx \theta_0 I + \theta_1 L_{\mathrm{sym}}\).
- Tie the two coefficients (\(\theta = \theta_0 = -\theta_1\)) and apply the renormalisation trick: replace \(I + D^{-1/2}AD^{-1/2}\), whose spectrum lies in \([0,2]\), with
whose spectrum lies in \((-1, 1]\) — bounded, so repeated application does not blow up.
Result: the GCN layer \(H^{(k+1)} = \sigma\bigl(\hat{A} H^{(k)} W^{(k)}\bigr)\) — neighbourhood averaging with symmetric normalisation. (See the GCN post for details.)
The Normalised Laplacian
For a graph with no isolated vertices, the symmetric normalised Laplacian is:
Its eigenvalues lie in \([0, 2]\) — bounded regardless of graph size or degree, which is what makes it convenient for filter design. The upper bound \(\lambda_N = 2\) is attained if and only if at least one connected component is bipartite; adding self-loops (as GCN does) destroys bipartiteness and pushes \(\lambda_N\) strictly below \(2\).
Note that the \(\lambda = 0\) eigenvector of \(L_{\mathrm{sym}}\) is \(D^{1/2}\mathbf{1}\), not \(\mathbf{1}\): the two agree only when every node has the same degree. Its multiplicity still equals the number of connected components.
✅ Key Takeaways
- \(L = D - A\) is the Graph Laplacian: it measures local "imbalance" at each node.
- Eigenvalues \(\lambda_i\) = graph frequencies; eigenvectors \(u_i\) = graph Fourier modes. Small eigenvalues = smooth signals.
- The multiplicity of eigenvalue \(0\) = the number of connected components; \(\lambda_2\) measures overall connectivity.
- \(L_{\mathrm{sym}} = I - D^{-1/2}AD^{-1/2}\) has spectrum in \([0,2]\), with \(2\) attained only for bipartite components.
- GCN is a simplified spectral convolution: truncate the Laplacian filter to first order and renormalise, giving \(\hat{A}H\) with \(\hat{A} = \tilde{D}^{-1/2}\tilde{A}\tilde{D}^{-1/2}\).
References
- Hamilton, W. L. (2020). Graph Representation Learning. Synthesis Lectures on Artificial Intelligence and Machine Learning.
- Kipf, T. N., & Welling, M. (2017). Semi-Supervised Classification with Graph Convolutional Networks. ICLR 2017.
