home




k=

This applet demonstrates the k-means clustering algorithm.

Enter 'k' (2-6). Pressing 'reset' generates 20 random points and 'k' random means. Each mean shares the same color as the points to which it is closest. When 'next' is pressed, each mean is recalculated and points are reassigned to the closest mean. After a sufficient repetition, the system will converge.