Does k-means always converge, and does it find the global optimum?
Unsupervised learning, Clustering
Level L2 Elementary. Length Short. Nature Th+Mat Both.
What's being asked
Whether you can give the coordinate-descent argument and know its limits.
Key idea
The k-means algorithm is coordinate descent on , where is the cluster of point and is that cluster’s centre. Coordinate descent means minimising over one group of variables at a time. Neither step increases , and there are finitely many assignments, so it stops after finitely many steps, but only at a local optimum.
Steps
- Write the objective .
- Assignment step: send each point to its nearest centre. This minimises over the assignments with fixed.
- Update step: the cluster mean minimises over with fixed.
- Since never increases and there are finitely many partitions, the algorithm terminates.
- Finding the global optimum is NP-hard in general, so no efficient exact algorithm is expected. Use k-means++ initialisation and several restarts.
Common mistakes
- Saying it converges to the global minimum.
- Forgetting that consistent tie-breaking is needed to rule out cycling.
- Not mentioning that results depend on initialisation.
How long your answer should be
4–6 sentences.
Last checked on 4 December 2026.
Read this
Previous in Unsupervised learning: What is collaborative filtering, and how do user-based and item-based neighbourhood methods differ? Which one scales better when there are far more users than items, and why?
Next in Unsupervised learning: What is k-means++ initialisation, and for the 1-D points with , if the first centre chosen is 0, what is the probability that each remaining point becomes the second centre?