Taking advantage of the KDtree to build a fast greedy clustering algorithm.