Assign to the closest center
In k-means, one step assigns each example to its nearest center under the chosen distance. Another step updates each center to the mean of its assigned points. These steps alternate in the standard algorithm.
What the objective measures
Try moving the first center below. Each point takes the color of its nearest center; the white marks show the center positions. The sum of squared distances measures how far the points are from their assigned centers. A low sum does not by itself mean the groups are useful. Move the first center past a point and watch assignments switch to the nearest center. The second center and data stay fixed; this is only the assignment step.
INTERACTIVE EXPLORATION
Assign points to centers
Points lie at 0, 2, 8 and 10. Move the first center while the second stays at 8; then compare assignments and the sum of squared distances.
Choices matter
The number of clusters, scaling of features, initialization and distance all affect the result. Standard k-means assumes numeric vectors and is sensitive to feature scale and outliers.
Check your understanding
Does a low k-means objective automatically prove the clusters are meaningful?
No. The objective measures within-cluster distance; usefulness depends on the question and validation.