Like Octrees, k-d trees partition space and enable efficient queries on points. The key difference is that each node in a k-d tree partitons space across one plane per level of depth, leading to a binary tree. Each level generates two half spaces that contain its child nodes, which are recursively subdivided.
KD-trees are a specific data structure for efficiently representing our data. In particular, KD-trees helps organize and partition the data points based on specific conditions. Now, we're going to be making some axis aligned cuts, and maintaining lists of points that fall into each one of these different bins.
Advantages of using KDTree At each level of the tree, KDTree divides the range of the domain in half. Hence they are useful for performing range searches. It is an improvement of KNN as discussed earlier. The complexity lies in between O(log N) to O(N) where N is the number of nodes in the tree.
The nearest neighbour search (NN) algorithm aims to find the point in the tree that is nearest to a given input point. This search can be done efficiently by using the tree properties to quickly eliminate large portions of the search space.
I'm trying to figure out which structure would be better for doing several radius search of points, a kd-tree or an octree? It was already mentioned in this question but there was no answer. It seems to me that since octrees have fixed sizes for the leafs it can already be computed the branches that I need to visit while for kd-tree you have to iteratively visit branches until radius is covered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With