⏳ diagonalising…

Spectral Clustering 2D — Laplacian Matrix & Eigengap Explorer

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.