You could use Point Groups or not sure if it works or not, anyway you might want to know about K-mean clustering.