Why is standard k-means only guaranteed to converge to a local optimum rather than a global optimum?

Last updated 11 November 2026

  • The k-means objective (within-cluster sum of squares) is non-convex with many local minima, and finding the global optimum is NP-hard.

  • Lloyd's algorithm alternates greedy assignment and mean-update steps that never raise cost, so it stops at the first fixed point it reaches. Which one depends on initialization.

  • Use k-means++ seeding and multiple restarts (n_init) to improve odds, but neither guarantees the global optimum.

  • https://scikit-learn.org/stable/modules/clustering.html
  • https://kawsar34.medium.com/last-minute-interview-prep-k-means-clustering-615433095021
  • https://www.geeksforgeeks.org/machine-learning/ml-k-means-algorithm/
All Clustering interview questions