Reputation: 28774
I looked at the definition of KD-tree and R-tree. It seems to me that they are almost the same.
What's the difference between a KD-tree and an R-tree?
Upvotes: 105
Views: 34948
Reputation: 65854
R-trees and kd-trees are based on similar ideas (space partitioning based on axis-aligned regions), but the key differences are:
(There are lots of similar kinds of tree structures for partitioning space: quadtrees, BSP-trees, R*-trees, etc. etc.)
Upvotes: 79
Reputation: 77454
They are actually quite different. They serve similar purpose (region queries on spatial data), and they both are trees (and both belong to the family of bounding volume hierarchy indexes), but that is about all they have in common.
Upvotes: 145
Reputation: 156148
A major difference between the two not mentioned in this answer is that KD-trees are only efficient in bulk-loading situations. Once built, modifying or rebalancing a KD-tree is non-trivial. R-trees do not suffer from this.
Upvotes: 53