DP clustering algorithm