0

Please anyone tell me how to construct dual kd-tree and how to traverse it?

And at least tell me the algorithm for finding nearest neighbor using this dual tree concept in java. This will help full for my project.

Thank you.

Compass
  • 5,867
  • 4
  • 30
  • 42
Kiran
  • 1
  • 2

1 Answers1

0

If you can read Python, look at the clear source for query_ball_tree described in scipy.spatial.KDTree,
"Find all pairs of points whose distance is at most r". (Is that what you want to do ?)

denis
  • 21,378
  • 10
  • 65
  • 88
  • Thank you for replay and also please help me finding balanced kd-tree java code. Present code i have is not balanced. Also comment is any tree which is efficient than kdtree – Kiran May 10 '11 at 07:51
  • Sorry, can't help on java; did you find the python query_ball_tree (65 lines) understandable ? Re other trees / kdtree variants, you'll have to be more specific. See also [nearest-neighbors-in-high-dimensional-data](http://stackoverflow.com/questions/5751114/nearest-neighbors-in-high-dimensional-data). – denis May 10 '11 at 08:46