Say we have points . We want to partition them into sets such that the cost of the partition is minimised, :

Where is the mid-point of each cluster, i.e. .

Where is the squared L2 norm (squared Euclidian distance).