Nearest-neighbour tools for clustering