k -d tree

from Wikipedia, the free encyclopedia

A -dimensional tree or -d-tree is an unbalanced search tree for storing points from the . Similar to the area tree, it offers the possibility of performing orthogonal area inquiries. The query complexity is higher, but the memory overhead is instead .

kd trees are special cases of CLT trees whose dividing hyperplanes are aligned along the axes of the coordinate system.

It was introduced by Jon Bentley .

definition

There are homogeneous and inhomogeneous k -d-trees. In the case of homogeneous k -d trees, each node stores a data set. In the inhomogeneous variant, the inner nodes only contain keys, the leaves contain references to data records.

For an inhomogeneous k -d tree, let the axis-parallel -dimensional hyperplane be at that point . For the root, the points are divided by the hyperplane into two point sets of as much as possible the same size and this is entered in the root; to the left of this all points that are smaller than , to the right of the root all larger ones are stored . For the left child node, the points are again divided by a new split level and this is saved in the inner node. To the left of this all points are saved whose is smaller than . This is now continued recursively across all dimensions. Then we start again with the first dimension until each point can be clearly identified by hyperplanes.

A k -d tree can be constructed in. Orthogonal range inquiries can be answered in, where denotes the size of the answer. The storage space requirement for the tree itself is in .

Example 2-D tree

A set of points with an associated inhomogeneous 2-d tree

See also

literature

Web links