2

I want an algorithm for Nearest Neighbor Search(NNS) Problem. The problem is related to Computational Geometry field. I searched a lot, but i did not find an algorithm for that. I think locality sensitive hash(LSH) algorithm will be good for this problem, but unfortunately i didn't find an algorithm for this. Exactly i want an article to learn LSH. Can any one help me?

Thanks

Seyed Morteza Mousavi
  • 6,855
  • 8
  • 43
  • 69

3 Answers3

1

IMHO LSH are quite hard to implement correctly.

Great articles about NNS is at wiki. I'm using kd-tree for NNS for solving nearest neighbor problem when merge two triangle meshes together and it works quite well and pretty fast. It's also not that hard to implement (some implementations might be found by google easily).

Sorceror
  • 4,835
  • 2
  • 21
  • 35
  • I am not going to implement it. I just want an algorithm for LSH in psoudocode. Also i want to know: how much is complextity this algorithm? – Seyed Morteza Mousavi Dec 16 '12 at 08:10
  • @SeyedMortezaMousavi this great article [Multi-Probe LSH: Efficient Indexing for High-Dimensional Similarity Search](http://www.csd.uoc.gr/~hy561/Data/Papers/p950-lv.pdf) should answer your question. But, due the fact, that we are talking about "hash maps", then time complexity for search is O(1).. – Sorceror Dec 16 '12 at 20:09
0

If you are looking for a C++ library, you can have a look at this CGAL package. There is also the ANN library.

sloriot
  • 6,070
  • 18
  • 27
0

Do you need nearest neighbour or approximate nearest neighbour? In how many dimensions?

I would also recommend trying kd-tree search before LSH.

Toby Sharp
  • 2,029
  • 3
  • 19
  • 21