The Graph Laplacian and Spectral Clustering
A matrix built from a network's connections whose eigenvectors reveal natural clusters — used to group assets by how tightly they co-move without assuming clusters are round or evenly sized.
Prerequisites: Eigenvalues & Eigenvectors, Quadratic Forms
Grouping stocks into clusters by how similarly they behave — sector-like groupings discovered from the data itself, not from an official sector label — is hard for standard clustering methods when the natural groups aren't neat round blobs but instead form chains, rings, or oddly shaped clusters in similarity space. K-means and similar methods struggle here because they assume clusters look like circles around a center. The graph Laplacian sidesteps that assumption entirely, turning clustering into an eigenvalue problem on a matrix built from pairwise similarities.
An analogy: a spring network settling into its natural groups
Imagine every pair of assets connected by a spring, whose stiffness is proportional to how correlated they are — tightly co-moving assets get a stiff spring, unrelated ones get a weak or absent spring. If you let this whole spring network vibrate, its natural, lowest-energy vibration patterns will tend to move tightly-connected clusters together as a block, with looser connections between blocks bending more easily. The graph Laplacian is the matrix that governs exactly this spring network's vibration, and its lowest eigenvectors are precisely those natural, cluster-revealing vibration patterns.
The math, one symbol at a time
Given a similarity (weighted adjacency) matrix where measures how strongly nodes and are connected, define the degree matrix (diagonal, with , the total connection strength of node ), and the graph Laplacian
In words: 's diagonal holds each node's total connectivity, and its off-diagonal entries subtract off the specific pairwise strengths. The Laplacian's key property, via the quadratic form (see Quadratic Forms): — a sum that's small exactly when strongly-connected nodes are assigned similar values . Spectral clustering finds the eigenvectors of with the smallest eigenvalues (excluding the trivial all-ones eigenvector with eigenvalue 0) and uses their entries as coordinates to cluster nodes — nodes that the low-energy eigenvectors treat similarly end up grouped together.
Worked example 1: two tightly connected pairs, weakly linked
Four assets: 1–2 strongly correlated (weight 5), 3–4 strongly correlated (weight 5), and only a weak link 2–3 (weight 0.1). , and has this near-block structure. Its eigenvalues come out approximately — the second-smallest eigenvalue (0.1, not counting the trivial 0) is tiny precisely because the graph is almost two disconnected pieces joined by one weak link; the corresponding eigenvector takes one sign on nodes {1,2} and the opposite sign on {3,4}, directly revealing the two clusters by the sign pattern alone.
Worked example 2: reading off clusters from eigenvector signs
Continuing the example, the second-smallest eigenvector might come out approximately . Thresholding at zero: nodes 1 and 2 (positive) form one cluster, nodes 3 and 4 (negative) form the other — recovering exactly the intended grouping, using nothing but an eigenvector, with no assumption that clusters are round or evenly sized. If a third, genuinely separate cluster existed, the third-smallest eigenvector would typically reveal it, which is why spectral clustering with clusters generally uses the smallest nontrivial eigenvectors together as coordinates, then runs a simple clustering step (like k-means) on those coordinates instead of on the raw data.
What this means in practice
Spectral clustering via the graph Laplacian is used to discover data-driven groupings of assets from a correlation or similarity network — clusters that don't need to be predefined by industry classification and can capture co-movement patterns that cut across official sectors. It's related to hierarchical clustering methods used in portfolio construction (see Nested Clustered Optimization) and, more broadly, to any method that treats a correlation matrix as a graph rather than just a table of numbers.
The graph Laplacian turns clustering into an eigenvalue problem: its smallest nontrivial eigenvectors assign similar values to strongly-connected nodes, and thresholding those values directly reveals natural clusters, even ones with irregular shapes that distance-based clustering methods miss.
Spectral clustering requires choosing how many eigenvectors (equivalently, how many clusters) to use, and this choice isn't automatic — picking too few merges genuinely distinct clusters, too many splits a real cluster apart. A common mistake is trusting the eigenvector sign pattern blindly without checking the eigenvalue gap: a small gap between the -th and -th smallest eigenvalues signals that the " clusters" structure is not sharply defined in the data, and the resulting groups should be treated as tentative rather than a firm ground truth.
Related concepts
Practice in interviews
Further reading
- Von Luxburg (2007), A Tutorial on Spectral Clustering