Fastest way to find the closest point to a given point in 3D, in Python

后端 未结 3 1436
长情又很酷
长情又很酷 2021-02-14 13:19

So lets say I have 10,000 points in A and 10,000 points in B and want to find out the closest point in A for every B point.

Currently, I simply loop through every point

3条回答
  •  太阳男子
    2021-02-14 13:58

    I typically use a kd-tree in such situations.

    There is a C++ implementation wrapped with SWIG and bundled with BioPython that's easy to use.

提交回复
热议问题