How does space partitioning algorithm for finding nearest neighbors work?

三世轮回 提交于 2019-12-05 09:14:24

Spacial partitioning is actually a family of closely related algorithms that partition space so that applications can process the points or polygons easier.

I reckon there are many ways to solve your problem. I don't know how complex you are willing to build your solution. A simple way would probably to build a binary tree cutting the space into 2. All the points divided between some middle plane. Build your tree by subdividing recursively until you run out of points.

Searching for the nearest neighbor will then be optimized, because each traversal of the tree narrows down the search area.

In some literature, they call this a kd tree

These two videos should help:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!