Why is Lloyd's algorithm guaranteed to converge?

Last updated 11 November 2026

  • Neither step increases SSE: nearest-centroid assignment minimizes each point's term, and the mean minimizes squared distances for fixed assignments.

  • SSE is bounded below by 0 and there are finitely many partitions (at most k^n). With consistent tie-breaking none repeats, so the algorithm terminates.

  • It reaches only a local optimum, and the guarantee depends on squared Euclidean distance plus the mean (hence k-medians/k-medoids for other metrics).

  • https://medium.com/sfu-cspmp/free-diving-into-k-means-ede29e1ca24d
  • https://medium.com/@atharv4study/k-means-d462eebb24b7
  • https://medium.com/@ZombieCodeKill/fundamentals-of-machine-learning-unsupervised-and-self-supervised-learning-4dd268693bdc
All Clustering interview questions