Foundations to Frontier
Tests
D. Classical Machine Learning › D9 Dimensionality Reduction and Manifold Learning

Laplacian Eigenmaps

Laplacian eigenmaps (Belkin and Niyogi, 2003) embed data using the smoothest functions on a neighbourhood graph: the bottom eigenvectors of the graph Laplacian, which minimise Σ Wᵢⱼ(fᵢ − fⱼ)² so that neighbours get similar coordinates. As the sample grows, the graph Laplacian converges to the Laplace–Beltrami operator of the underlying manifold, so the embedding coordinates are its eigenfunctions, the manifold's vibration modes. That gives the method a solid theory, links it to spectral clustering and diffusion maps, and makes it cheap and sparse. It also explains its signature failure: eigenfunctions are ordered by frequency, so on an elongated manifold a second wave along the long direction comes before any variation across the short one, and a 2-D embedding shows a curve instead of a sheet. This page covers the heat-kernel graph, the generalised eigenproblem, the Dirichlet-energy view, convergence to the Laplace–Beltrami operator, the eigenvector-ordering problem with its exact prediction on rectangles, and links to spectral clustering. In the exercises you implement Laplacian eigenmaps on the Swiss roll; then you test the prediction that the short side appears in eigenvector ⌈aspect ratio⌉.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

The smoothest possible coordinates

Connect each data point to its nearest neighbours with springs, then look for a way to give every point a number so that connected points get similar numbers, without making them all the same. The answer is the gentlest “wave” that can run through the network. Laplacian eigenmaps use the gentlest few waves as coordinates. On a rolled-up sheet, the gentlest wave runs from one end of the roll to the other, so it unrolls the sheet.

Laplacian eigenmaps: which eigenvector holds the short side?
1234567short side r² per eigenvector (orange = predicted)
predicted eigenvector for the short side: 2 · found strongest in: 2 (r² 0.74) · eigenvalues ×1000: 3.1, 8.7, 12.7, 13.3, 17.8, 24.1, 41.8
Colour is the coordinate across the short side. Below an aspect ratio of 2, the default plot (eigenvectors 1 and 2) is a good map. Past 2, a second, faster wave along the long side, cos(2πx/L), costs less than any variation across the short side and takes eigenvector 2: the plot becomes a horseshoe curve with the colours mixed. The short side moves to eigenvector ⌈aspect⌉, exactly as the Laplacian's eigenvalues on a rectangle predict; pick that eigenvector to see the map again. With only 350 points the prediction is approximate: modes with nearly equal eigenvalues, such as cos(πx/L)·cos(πy/H) just behind, mix, so the short side can spill into the next eigenvector, especially near whole-number aspects.
Why engineers care

Graph Laplacian eigenvectors are everywhere: spectral clustering, diffusion maps, graph signal processing, mesh parameterisation, semi-supervised learning on graphs, and positional encodings for graph neural networks. Laplacian eigenmaps are the cleanest place to learn how they behave, including the ordering effect in the demo that can make the second coordinate useless.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Laplacian eigenmaps give neighbouring points…
  2. 2. The coordinates are…
  3. 3. In the demo, past aspect ratio 2, eigenvector 2 is…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

The graph and its Laplacian by hand

Weights. Connect each point to its k nearest neighbours, symmetrise, and weight edges with the heat kernel Wᵢⱼ = exp(−‖xᵢ − xⱼ‖²/t). Points 5 apart with t = 25 get weight e⁻¹ = 0.368; identical points get 1. Simple 0/1 weights also work.

Laplacian. With degrees dᵢ = Σⱼ Wᵢⱼ, the graph Laplacian is L = D − W. For a path 1 — 2 — 3 with weights 1 and 2, the middle node has degree 3 and L = [[1, −1, 0], [−1, 3, −2], [0, −2, 2]]. Rows sum to 0, so the constant vector has eigenvalue 0.

Dirichlet energy. For any f, fᵀLf = ½ Σᵢⱼ Wᵢⱼ(fᵢ − fⱼ)². On that path, f = (0, 1, 3) costs 1·1² + 2·2² = 9. Small energy means a smooth function.

Waves on a path. The Laplacian of an unweighted path of n nodes has eigenvalues 2 − 2cos(πk/n), with cosine eigenvectors. For n = 30, the first non-zero one is 0.01096. Eigenvalues grow like k², and eigenvectors are cosines of increasing frequency: the discrete vibration modes of a string.

The steps in plain English:

  1. Build a symmetric k-NN (or ε-ball) graph with heat-kernel weights; a common bandwidth is the median squared neighbour distance.
  2. Solve Lf = λDf for the smallest eigenvalues, equivalently the normalised Laplacian I − D^(−½)WD^(−½).
  3. Drop the constant eigenvector (λ = 0); use the next d eigenvectors as coordinates.
  4. Compute a few extra eigenvectors and check which ones carry new information rather than harmonics of earlier ones.
📝 Quick check (Level 1)
0/3 answered
  1. 1. fᵀLf equals…
  2. 2. The smallest eigenvalue of a connected graph's Laplacian is…
  3. 3. Eigenvalues of a path Laplacian grow like…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 30 minUndergraduate students and practising engineers.

Why it unrolls, and why eigenvector 2 can be useless

Optimisation view. Minimise Σᵢⱼ Wᵢⱼ‖yᵢ − yⱼ‖² = 2 tr(YᵀLY) subject to YᵀDY = I, which prevents collapse, and YᵀD1 = 0, which removes the constant. The solution is the generalised eigenvectors of Lf = λDf with the smallest non-zero λ. Close points are pulled together, while the constraint keeps the overall scale fixed.

Continuum limit. As n → ∞ with a shrinking bandwidth, the graph Laplacian converges to the Laplace–Beltrami operator Δ of the manifold, so the embedding coordinates approach its eigenfunctions. On a rectangle [0, L] × [0, H], with zero normal derivative at the edges, those are cos(mπx/L) · cos(nπy/H), with eigenvalues (mπ/L)² + (nπ/H)².

The ordering prediction. The first short-side mode (m, n) = (0, 1) has eigenvalue (π/H)². Every long-side mode (m, 0) with m < L/H is cheaper and comes first. So the short side appears in eigenvector ⌈L/H⌉: for aspect 2.5, eigenvector 3. Below aspect 2, eigenvectors 1 and 2 are cos(πx/L) and cos(πy/H): a good, if nonlinearly warped, map.

Exercise 1 (600-point Swiss roll, k = 10). The unrolled roll is 89.4 × 21, an aspect ratio of 4.26.

  • The first coordinate tracked arc length with rank correlation 0.998. Its linear R² was 0.976, but its R² with cos(π · arc) was 0.990: it is the cosine mode, not arc length itself.
  • The second coordinate was the wave cos(2π · arc), with r² 0.939.
  • Height did not appear in coordinates 1–4 at all (r² ≤ 0.03); it surfaced, mixed, in 5–7 (r² 0.34, 0.16, 0.34).
  • Eigenvalue ratios λⱼ/λ₁ were 1, 3.7, 8.3, 13.2, 18.5, 19.1, 23.7, close to the m² pattern of 1, 4, 9, 16. The height mode was predicted at (aspect)² = 18.3, in the cluster at 18.5–19.1 where it actually appeared.

The ratios are not exactly m², because the roll is sampled more densely on its inner turns.

from sklearn.manifold import SpectralEmbedding
Y = SpectralEmbedding(n_components=6, affinity="nearest_neighbors", n_neighbors=10).fit_transform(X)   # inspect all 6
🐍 Exercise 1: Laplacian eigenmaps on the Swiss roll
Build a heat-kernel k-NN graph, solve the normalised Laplacian eigenproblem, and check the first coordinate against arc length (rank, linear and cosine fits), the second against a wave cos(2π·arc), and where the height appears among the first seven.
📝 Quick check (Level 2)
0/3 answered
  1. 1. The constraint YᵀDY = I prevents…
  2. 2. On a 3 × 1 rectangle, the short side appears in eigenvector…
  3. 3. Laplacian eigenmaps' first coordinate on a strip is closer to…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Convergence. Belkin and Niyogi (2005, 2008) proved pointwise and then spectral convergence of graph Laplacians to the Laplace–Beltrami operator for uniform sampling. With non-uniform density p, the unnormalised, random-walk and symmetric normalisations converge to different operators, weighted by powers of p. Coifman and Lafon’s diffusion maps use a density renormalisation (α = 1) to remove the density’s influence; see the next topic.

Relation to spectral clustering. If the graph has c well-separated clusters, the bottom c eigenvectors are nearly indicator functions of the clusters. Laplacian eigenmaps followed by k-means is spectral clustering: the eigenvectors that are useful for clustering a disconnected graph become smooth coordinates on a connected manifold.

Fixing the ordering problem. Choose eigenvectors that are not functions of earlier ones: the non-redundant eigenvector selection of Dsilva et al. (2018) regresses each eigenvector on the earlier ones with local linear regression and keeps those with large residuals. Alternatively, use methods with different normalisations (LTSA, Hessian eigenmaps) or an embedding dimension larger than the intrinsic one.

Interview questions.

  • Why is the second spectral coordinate sometimes a function of the first? It is a higher harmonic along the dominant direction, cheaper than any variation in the short direction once the aspect ratio exceeds 2. Inspect more eigenvectors and drop redundant ones.
  • What does the heat-kernel bandwidth do? Too small disconnects the graph and makes eigenvectors indicators of fragments; too large adds short-circuits and blurs. The median squared neighbour distance is a robust default.
📝 Quick check (Level 3)
0/3 answered
  1. 1. With non-uniform sampling, different Laplacian normalisations converge to…
  2. 2. On a graph with c disconnected clusters, the bottom c eigenvectors are…
  3. 3. Non-redundant eigenvector selection keeps eigenvectors that…

Level 4: Expert

★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.

Testing the ordering prediction

History.

  • M. Belkin and P. Niyogi (2001, 2003) introduced Laplacian eigenmaps.
  • R. Coifman and S. Lafon (2006) introduced diffusion maps.
  • Y. Goldberg et al. (2008) and later C. Dsilva, R. Talmon, R. Coifman and I. Kevrekidis (2018) analysed and corrected repeated eigendirections.
  • Graph Laplacian positional encodings (Dwivedi et al., 2020) brought the same eigenvectors into graph neural networks.

Exercise 2. 600 points uniform on rectangles of area 1 with aspect ratios 0.7–4.5, k = 10, 3 datasets. For each aspect ratio, the table shows the R² of a linear fit of the short and long side coordinates from the first two eigenvectors, then the eigenvector most correlated with the short side (averaged) against the prediction ⌈max(aspect, 1/aspect)⌉, with its r².

aspect short side, 2-D long side, 2-D short side’s eigenvector predicted its r²
0.7 0.932 0.971 2 2 0.93
1.5 0.925 0.968 2 2 0.92
2.5 0.042 0.976 3 3 0.78
3.5 0.010 0.978 4 4 0.60
4.5 0.007 0.979 6.33 5 0.38
  • The prediction held exactly for aspects 0.7–3.5: the short side sat in eigenvector ⌈aspect⌉, and a 2-D embedding lost it entirely as soon as the aspect passed 2.
  • The long side was always captured (R² ≈ 0.97, below 1 because cos(πx/L) is a warped version of x).
  • At aspect 4.5 the prediction slipped (eigenvector 6.33 on average, r² 0.38). With 600 points, the strip is only about 0.47 units tall, roughly six neighbourhood radii, so mixed modes such as cos(πx/L)·cos(πy/H) have eigenvalues close to the pure short-side mode, and finite-sample noise reorders them.
  • Practical lesson: with an elongated manifold, a 2-D spectral embedding is a curve, not a map. Look further down the spectrum, or select non-redundant eigenvectors.
🐍 Exercise 2 (research): where does the short side go?
For uniform rectangles of area 1 with aspect ratios 0.7–4.5, compute eight Laplacian-eigenmap coordinates, measure how well the first two recover each side, and find which eigenvector carries the short side; compare with the prediction ⌈max(aspect, 1/aspect)⌉.

Laplacian eigenmaps in AI, robotics and aerospace

  • Graph positional encodings: Laplacian eigenvectors give nodes coordinates in graph transformers, with the same sign and ordering ambiguities.
  • Mesh and shape processing: Laplace–Beltrami eigenfunctions of aircraft or robot part meshes serve as shape descriptors and smooth bases for deformation.
  • Semi-supervised labelling: spreading a few labelled telemetry snapshots across a similarity graph uses the same smooth eigenvectors.

References

  1. M. Belkin, P. Niyogi (2003). “Laplacian eigenmaps for dimensionality reduction and data representation.” Neural Computation 15(6).
  2. M. Belkin, P. Niyogi (2008). “Towards a theoretical foundation for Laplacian-based manifold methods.” Journal of Computer and System Sciences 74(8).
  3. U. von Luxburg (2007). “A tutorial on spectral clustering.” Statistics and Computing 17(4).
  4. C. J. Dsilva, R. Talmon, R. R. Coifman, I. G. Kevrekidis (2018). “Parsimonious representation of nonlinear dynamical systems through manifold learning: a chemotaxis case study.” Applied and Computational Harmonic Analysis 44(3).
  5. Y. Goldberg, A. Zakai, D. Kushnir, Y. Ritov (2008). “Manifold learning: the price of normalization.” Journal of Machine Learning Research 9.