HomeAI & Machine LearningSpectral Clustering — Graph Laplacian Explorer

Spectral Clustering — Graph Laplacian Explorer

Interactive spectral clustering simulator: build a k-nearest-neighbour similarity graph over non-convex point clouds, compute the graph Laplacian's eigenvectors with a live Jacobi solver, and watch k-means run in the spectral embedding to separate clusters that ordinary k-means cannot.

AI & Machine Learning3DAdvanced60 FPS📱 Mobile-adapted⇄ 2D version
ds-topic-37 ↗ Open standalone

Spectral clustering separates data by connectivity on a similarity graph rather than by straight-line distance, which lets it correctly untangle non-convex shapes — interleaving moons, nested rings — that defeat centroid-based methods like k-means. This simulator builds a real k-nearest-neighbour similarity graph with a Gaussian kernel, forms the graph Laplacian L = D − W, and diagonalises it live with a from-scratch cyclic Jacobi eigenvalue solver to obtain the low-dimensional spectral embedding, then runs k-means inside that embedding. Adjust the kernel bandwidth, neighbourhood size and cluster count, toggle the raw similarity graph on or off, and compare directly against plain k-means running on the same points to see exactly why the spectral approach wins on curved cluster boundaries.

⚙ Under the hood

Build a k-nearest-neighbour similarity graph over non-convex point clouds, diagonalise the graph Laplacian live with a from-scratch Jacobi eigensolver, and watch k-means run in the spectral embedding to separate clusters that ordinary k-means cannot.

clusteringspectral-clusteringgraph-laplacianunsupervised-learningeigenvectorsmachine-learning

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)