Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Neighbor Pairs Searching #107

Open
zhujunmian opened this issue May 26, 2020 · 3 comments
Open

Support for Neighbor Pairs Searching #107

zhujunmian opened this issue May 26, 2020 · 3 comments

Comments

@zhujunmian
Copy link

The scipy KDTree package provides a method query_pairs (in this link) which returns all the pairs within a distance for the given tree. This package seems only to provide nearest neighbor searching for a given point by the inrange function, rather than for pairs.

Such feature could also be implemented in this Julia package and should be helpful for users.

@ali-ramadhan
Copy link

What would be a good algorithm for doing this?

I imagine a naive solution might be to loop over all data points and for each data point, call inrange to get a list of nearby data points then append them to a set storing (i, j) index pairs where i < j.

@KristofferC
Copy link
Owner

I think you can do better by basically searching and pruning two trees against each other. I think I had an implementation of that but don't recall why I didn't put it in, maybe it didn't improve performance much over the naive version.

@KristofferC
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants