Algorithm implementation that estimates k for k-means clustering.