Algorithm for finding nearby points?

前端 未结 7 899
独厮守ぢ
独厮守ぢ 2021-01-30 18:19

Given a set of several million points with x,y coordinates, what is the algorithm of choice for quickly finding the top 1000 nearest points from a location? \"Quickly\" here mea

7条回答
  •  醉话见心
    2021-01-30 18:28

    If the set of points rarely changes, you could also consider using a voronoi diagram. I'm not sure if that helps finding the first point faster, but it should make it a lot easier to find the next 999 points.

提交回复
热议问题