Binary space-partitioning trees

Back to Data structures

Theory

Nodes

A node is a closed subset of . Denote the set of all nodes by and let . A node is called a descendant of a node if and . If is a descendant of , then is called an ascendant of . A node is called a child of a node if is a descendant of and there is no descendant of which would also be an ascendant of . If is a child of , then is called a parent of .

BSP-tree

A binary space-partitioning tree or a bsp-tree, is a directed graph , such that

These definitions imply that is a binary tree, explaining the name. A node which has no children is called a leaf node, while the unique node which has no parent is called the root node. A node which is not a leaf node is called a split node. Two nodes which have the same parent are called siblings.

Point BSP-tree

A point BSP-tree is a pair such that

Kd-tree

A kd-tree is a BSP-tree with the restriction that the set of all nodes is restricted to closed axis-aligned boxes. Let a split-node in a kd-tree have children and . Then there is a unique axis-aligned plane which passes through the points in , called the splitting plane of . The index of the standard basis axis which corresponds to the normal of this plane is called the splitting axis.

Point kd-tree

A point kd-tree is a point bsp-tree which is also a kd-tree.

Practice

A BSP-tree makes it possible to design efficient algorithms for several geometric problems. Such problems include ray casting, nearest neighbor searching, and range searching. The efficiency of these algorithms rely on the ability to skip exploring a large part of the space if that is known not to affect the result. The BSP-tree is effectively a multi-dimensional generalization of the binary tree. In practice, kd-trees offer the best properties of the BSP-trees, from many point of views.

Kd-tree vs BSP-tree

Restricting the splitting planes to be orthogonal with the standard basis axes has a number of advantages. Some of these are: