How to find the closest 2 points in a 100 dimensional space with 500,000 points?

前端 未结 5 1987
无人及你
无人及你 2021-01-31 11:26

I have a database with 500,000 points in a 100 dimensional space, and I want to find the closest 2 points. How do I do it?

Update: Space is Euclidean, Sorry. And thanks

5条回答
  •  臣服心动
    2021-01-31 12:06

    Use a kd tree. You're looking at a nearest neighbor problem and there are highly optimized data structures for handling this exact class of problems.

    http://en.wikipedia.org/wiki/Kd-tree

    P.S. Fun problem!

提交回复
热议问题