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

Quick Overview

A machine learning interview question on why Lloyd's k-means algorithm can stop at a local optimum of the within-cluster sum of squares. It tests understanding of the non-convex objective, the greedy alternating steps, termination, sensitivity to initialization, and what k-means++ seeding and restarts can and cannot fix.

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

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why is standard k-means only guaranteed to converge to a local optimum rather than a global optimum? ```hint Look at the objective Ask whether the within-cluster sum of squares is convex once the discrete cluster assignments count as variables. ``` ```hint Look at the stopping rule Consider what each step of Lloyd's algorithm can see, and what kind of configuration leaves both steps with nothing to change. ``` ### What a Strong Answer Covers - Why the objective is non-convex once discrete assignments are included, and how hard the global problem is - Why each Lloyd step is optimal given the other set of variables, yet alternating them only reaches a fixed point - Why the algorithm always terminates, and a concrete configuration where it gets stuck - How initialization drives the result, and what seeding and restarts do and do not guarantee ### Follow-up Questions - Why does Lloyd's algorithm always terminate after a finite number of iterations? - What does k-means++ seeding do, and what guarantee does it give? - On real data, how would you tell whether a run has landed in a poor local optimum?

Overview: A machine learning interview question on why Lloyd's k-means algorithm can stop at a local optimum of the within-cluster sum of squares. It tests understanding of the non-convex objective, the greedy alternating steps, termination, sensitivity to initialization, and what k-means++ seeding and restarts can and cannot fix.

Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

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

What a Strong Answer Covers Guidance

  • Why the objective is non-convex once discrete assignments are included, and how hard the global problem is
  • Why each Lloyd step is optimal given the other set of variables, yet alternating them only reaches a fixed point
  • Why the algorithm always terminates, and a concrete configuration where it gets stuck
  • How initialization drives the result, and what seeding and restarts do and do not guarantee

Follow-up Questions Guidance

  • Why does Lloyd's algorithm always terminate after a finite number of iterations?
  • What does k-means++ seeding do, and what guarantee does it give?
  • On real data, how would you tell whether a run has landed in a poor local optimum?