Assignment uses squared distance to each displayed centroid. The table keeps the starting centroid coordinates visible so every distance has a shown source.

highlighted = computed this step

Squared distance decides the assignment

For every point, the table recomputes d^2 to c1=(1, 1) and c2=(7, 7).

d2=(xcx)2+(ycy)2d^2=(x-c_x)^2+(y-c_y)^2
Assignment by squared distanceDistances and cluster assignment are recomputed.k-means assignment tabletie: equal d^2 uses lowest centroid index; empty clusters rejectpointd^2 to c1=(1,1)d^2 to c2=(7,7)assigned(0,0)298c1(2,0)274c1(0,2)274c1(6,6)502c2(6,8)742c2(8,6)742c2

Nearest centroid

The first three points have distance 2 to c1. The last three have distance 2 to c2.

assignments=[c1,c1,c1,c2,c2,c2]\text{assignments}=[c_1,c_1,c_1,c_2,c_2,c_2]
Assignment by squared distanceDistances and cluster assignment are recomputed.k-means assignment tabletie: equal d^2 uses lowest centroid index; empty clusters rejectpointd^2 to c1=(1,1)d^2 to c2=(7,7)assigned(0,0)298c1(2,0)274c1(0,2)274c1(6,6)502c2(6,8)742c2(8,6)742c2

Summary

No square root is taken. Equal squared distances would use the lowest centroid index, so the assignment rule is deterministic.

tie break=lowest centroid index\text{tie break}=\text{lowest centroid index}
Assignment by squared distanceDistances and cluster assignment are recomputed.k-means assignment tabletie: equal d^2 uses lowest centroid index; empty clusters rejectpointd^2 to c1=(1,1)d^2 to c2=(7,7)assigned(0,0)298c1(2,0)274c1(0,2)274c1(6,6)502c2(6,8)742c2(8,6)742c2