Skip to content
StackDecode
AI & ML Atlas
Machine LearningalgorithmAnimated walkthrough

Spectral Clustering

Clusters by cutting a similarity graph, using eigenvectors of its Laplacian.

The idea

Build a graph connecting similar points, compute the graph Laplacian and take its smallest eigenvectors. In that eigenvector space, points from the same well-connected group lie close together, so a simple method such as k-means separates them. It handles shapes k-means cannot, like two interlocked rings.

Watch it run

The pipeline lights up one step at a time. Use the controls to pause or step through it.

  1. 1Build a similarity graph of the points.
  2. 2Form the graph Laplacian L = D − W.
  3. 3Compute its k smallest eigenvectors.
  4. 4Treat each point's eigenvector entries as new coordinates.
  5. 5Run k-means on them.
1/5

Step by step

  1. 1Build a similarity graph of the points.
  2. 2Form the graph Laplacian L = D − W.
  3. 3Compute its k smallest eigenvectors.
  4. 4Treat each point's eigenvector entries as new coordinates.
  5. 5Run k-means on them.

Where it is used

Image segmentation, community detection.

Watch out for

Eigen-decomposition is costly for big graphs; results depend on the similarity scale.

Related