Finding the farthest point in one set from another set

前端 未结 6 1724
旧巷少年郎
旧巷少年郎 2021-02-06 12:05

My goal is a more efficient implementation of the algorithm posed in this question.

Consider two sets of points (in N-space. 3-space for the example case of RGB colorsp

6条回答
  •  离开以前
    2021-02-06 12:34

    For each point in set B, find the distance to its nearest neighbor in set A.

    To find the distance to each nearest neighbor, you can use a kd-tree as long as the number of dimensions is reasonable, there aren't too many points, and you will be doing many queries - otherwise it will be too expensive to build the tree to be worthwhile.

提交回复
热议问题