Allow clustering using closest or closest particle algorithms.