Cluster estimation algorithm.