I just realized that this case is useless for this function: if the same array is provided twice, the minimum distances are necessarily zero, and argmin something like range(X.shape[0]). I'm dropping it.