Reputation: 135
I found lot's of discussions and articles that there is possible to find approximate nearest neighbours using Locality Sensitive Hashing (LSH) in 3d spatial coordinates. Unfortunately I was unable to find any real working example, where everything could be done in single copy-paste code.
I am using C# (more specifically Unity) and noticed that some articles stating that approximate NNS can be fast approach for game development. However, I didn't found any real C# implementations yet (or maybe C++ if C# does not exist).
So does anybody know some possible solutions for this?
Upvotes: 2
Views: 2157
Reputation: 73376
Why use LSH in 3 dimensions? I would suggest you try some tree-based approach, like KD-trees (there are many options). Here is a C# question about KD trees. You could check ALGLIB for KD-trees.
Notice that depending on your dataset, the choice of the data structure differs. You can take a look about some comparisons I had made (in higher dimensions though) here and here.
You can check this link LSH for Finding Similar Documents from a large number of Documents in C# in order to get a C# taste. An interesting question is here.
If you insist on LSH, then since you are dealing with game development, C++ could be also a choice maybe, so here is E2LSH library.
EDIT
ANN has to do with approximate NNS. It uses KD trees and BBD trees. You can check some answers of mine for ANNS here.
Upvotes: 1