Evaluating the performance of clustering algorithms