Clustering algorithm basis