The $k$-means algorithm is an iterative method for clustering a set of $N$ points (vectors) into $k$ groups or clusters of points.
Algorithm
Repeat until convergence:
Find closest centroid
Find the closest centroid to each point, and group points that share the same closest centroid.
Update centroid
Update each centroid to be the mean of the points in its group.
Find closest centroid