Ckmeans.1d.dp: Optimal k-means Clustering in One Dimension by Dynamic Programming
NP-hardness of Euclidean sum-of-squares clustering