What are the main steps of the spectral clustering algorithm?

Last updated 11 November 2026

  • Build an affinity matrix W (Gaussian kernel, k-NN, or ε-neighbourhood) and compute the Laplacian L = D - W or a normalized variant like L_sym.

  • Take the eigenvectors of the k smallest eigenvalues as columns of an n × k matrix U (the eigengap heuristic suggests k). Row-normalise it for L_sym.

  • Run k-means on the rows of U. Point i gets row i's label.

  • https://dev.to/rajaniraiyn/spectral-clustering-algorithm-demystified-d8i
  • https://www.geeksforgeeks.org/machine-learning/spectral-clustering-using-r/
  • https://mcpanalytics.ai/articles/spectral-clustering-practical-guide-for-data-driven-decisions
All Clustering interview questions