A clustering algorithm.