Assignment step
Each point takes the label of its nearest current centroid.
Alternate assignments and centroid updates
K-means partitions data into k groups by alternating between the nearest-center assignment and the centroid update.
The essential idea: each iteration can only decrease the within-cluster squared-distance objective.
Each point takes the label of its nearest current centroid.
Each centroid moves to the mean of the points carrying its label.
Step through assignment and update phases, or restart from a new initialization.
K-means turns clustering into repeated nearest-center assignment and centroid recomputation.