Given a set of points, what is the fastest algorithm for finding the nearest neighbor of a single point? A flat-footed algorithm would take O(n), but there has to be an algorithm that can do it in O(log n). I've searched around in google a bit, but I'm not sure what algorithm is the best. I don't need a terribly complex algorithm, just something that can achieve O(log n).
The only nearest neighbor algorithm I'm familiar with is creating Voronoi diagrams, but that's only useful if I need to find the nearest neighbor of every point.
You can assume that the data set is static (won't be adding or removing points while running the nearest neighbor search).
Thanks a bunch!
The only nearest neighbor algorithm I'm familiar with is creating Voronoi diagrams, but that's only useful if I need to find the nearest neighbor of every point.
You can assume that the data set is static (won't be adding or removing points while running the nearest neighbor search).
Thanks a bunch!