HomeAI & Machine LearningSpectral Clustering 2D — Laplacian Matrix & Eigengap Explorer

Spectral Clustering 2D — Laplacian Matrix & Eigengap Explorer

2D linear-algebra view of spectral clustering: watch the graph Laplacian's sparsity pattern reorder into visible blocks, read the eigenvalue spectrum's eigengap directly, and see the low-dimensional spectral embedding separate curved clusters that Euclidean k-means cannot.

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

This is a 2D-native companion to the 3D spectral-clustering point-cloud simulator: instead of watching coloured spheres in a scene, you watch the actual linear algebra the algorithm runs on. A from-scratch cyclic Jacobi eigenvalue solver diagonalises the live graph Laplacian L = D − W of a k-nearest-neighbour similarity graph, rendered as an N×N heatmap that collapses into block-diagonal structure once reordered by cluster; a sorted eigenvalue-spectrum chart exposes the "eigengap" that justifies the chosen cluster count K; and a scatter of the resulting spectral embedding (v₂ against v₃) shows the space k-means actually clusters in, next to the raw (x,y) layout for reference. Adjust the kernel bandwidth, neighbourhood size and K, and watch every one of these views update together from the same eigendecomposition.

⚙ Under the hood

A 2D linear-algebra companion to the 3D spectral-clustering point cloud: watch the graph Laplacian itself as an N×N heatmap collapse into block-diagonal structure once reordered by cluster, read the eigengap directly off the sorted eigenvalue spectrum, and see the low-dimensional spectral embedding separate non-convex clusters that a raw-coordinate view cannot — all from a from-scratch Jacobi eigensolver and k-means.

clusteringspectral-clusteringgraph-laplacianeigenvalueseigengapunsupervised-learninglinear-algebramachine-learning

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)