Algorithm to find for all points in set A the nearest neighbor in set B

后端 未结 3 464
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 00:12

Suppose we have two sets of points A, B, and we want to find for every point in set A its nearest neighbor in set B.

There are many good algorithms to find the near

3条回答
  •  轮回少年
    2020-12-15 00:32

    You may benefit from reading bentleys "writing efficient programs" where he deals with a case study of the traveling salesman program. One of the savings that he recognized was that the distince between two points involved taking a square root which was expensive. Taking the square root gives you the actual distance, not taking the square root gives you a number which can be used to compare against other relative values.

    I highly recommend reading the book. It will put your brain in the right place.

提交回复
热议问题