From Wikipedia, the free encyclopedia
(Redirected from
Kd-tree)
Jump to:
navigation,
searchA 3-dimensional k-d tree. The first split (red) cuts the root cell (white) into two subcells, each of which is then split (green) into two subcells. Finally, each of those four is split (blue) into two subcells. Since there is no more splitting, the final eight are called leaf cells.
In
computer science, a k-d tree (short for k-dimensional
tree) is a
space-partitioningdata structure for organizing
points in a k-dimensional
space. k-d trees are a useful data structure for several applications, such as searches involving a multidimensional search key (e.g.
range searches and
nearest neighbor searches). k-d trees are a special case of
binary space partitioning trees.
Informal description
The k-d tree is a
binary tree in which every node is a k-dimensional point. Every non-leaf node can be thought of as implicitly generating a splitting
hyperplane that divides the space into two parts, known as subspaces. Points to the left of this hyperplane represent the left sub-tree of that node and points right of the hyperplane are represented by the right sub-tree. The hyperplane direction is chosen in the following way: every node in the tree is associated with one of the k-dimensions, with the hyperplane perpendicular to that dimension's axis. So, for example, if for a particular split the "x" axis is chosen, all points in the subtree with a smaller "x" value than the node will appear in the left subtree and all points with larger "x" value will be in the right sub tree. In such a case, the hyperplane would be set by the x-value of the point, and its
normal would be the unit x-axis.
[1]
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)
點(diǎn)擊舉報(bào)。