# Finding the distance to the nearest neighbor for each point in a set of points in $R^n$

I have a list of points in $R^n$, and for each point I want to find the Euclidean distance to the nearest other point in the list. I don't need to know the coordinates of the nearest neighbor; I only need the distance. The naive approach would be to compare each point to every other, resulting in quadratic running time. Are there any better approaches?

• Have a look at metric trees for starters. – Juho Jun 2 '15 at 17:19