carsonfarmer / fastpair

FastPair: Data-structure for the dynamic closest-pair problem.
MIT License
12 stars 4 forks source link

`fastpair` for points in disjoint sets? #39

Open jGaboardi opened 1 month ago

jGaboardi commented 1 month ago

I curious about the possibility of utilizing the fastpair data structure for querying nearest neighbors in disjoint sets à la cross $k$-nearest, for example. Would that even be possible with fastpair?

carsonfarmer commented 1 month ago

Well I think probably yes, and no. Yes, because you can certainly do this... however, to do it efficiently, you need to essentially add any new points to the data structure before doing the query. In fact, my implementation with _get_neighbor is unfortunately, not very safe, as it mutates the structure in place. That should probably be fixed before attempting to do cross-set queries.