All k nearest neighbors in 2D, C++

前端 未结 2 910
离开以前
离开以前 2020-12-05 22:04

I need to find for each point of the data set all its nearest neighbors. The data set contains approx. 10 million 2D points. The data are close to the grid, but do not form

2条回答
  •  佛祖请我去吃肉
    2020-12-05 22:27

    I have used a library called ANN (Approximate Nearest Neighbour) with great success. It does use a Kd-tree approach, although there was more than one algorithm to try. I used it for point location on a triangulated surface. You might have some luck with it. It is minimal and was easy to include in my library just by dropping in its source.

    Good luck with this interesting task!

提交回复
热议问题