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

前端 未结 5 1985
无人及你
无人及你 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:00

    Use the data structure known as a KD-TREE. You'll need to allocate a lot of memory, but you may discover an optimization or two along the way based on your data.

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

    My friend was working on his Phd Thesis years ago when he encountered a similar problem. His work was on the order of 1M points across 10 dimensions. We built a kd-tree library to solve it. We may be able to dig-up the code if you want to contact us offline.

    Here's his published paper: http://www.elec.qmul.ac.uk/people/josh/documents/ReissSelbieSandler-WIAMIS2003.pdf

提交回复
热议问题