The K-means algorithm is based on the use of squared Euclidean distance as the measure of
dissimilarity between a data point and a prototype vector. We can then define an objective function,
sometimes called a distortion measure, given by
J=Σn=1Σk=1rnk||xn-μk||2,where n=1,...N, k=1,...,K, N is observations of a random D-dimensional
Euclidean variable x, K is number of clusters. J represents the sum of the squares of the distances of
each data point to its assigned vector μk.