Building a Balanced k-d Tree in O(kn log n) Time
Russell A. Brown

TL;DR
This paper presents an efficient method for building balanced k-d trees by presorting data in all dimensions beforehand, avoiding recursive median finding, and enabling parallel construction, with performance benefits in low dimensions.
Contribution
It introduces a presorting algorithm for balanced k-d tree construction that improves efficiency and supports parallel execution, outperforming median-finding methods in low dimensions.
Findings
Comparable performance to median-based methods in four dimensions
Better performance than median-based methods in three or fewer dimensions
Supports parallel tree construction
Abstract
The original description of the k-d tree recognized that rebalancing techniques, such as are used to build an AVL tree or a red-black tree, are not applicable to a k-d tree. Hence, in order to build a balanced k-d tree, it is necessary to find the median of the data for each recursive subdivision of those data. The sort or selection that is used to find the median for each subdivision strongly influences the computational complexity of building a k-d tree. This paper discusses an alternative algorithm that builds a balanced k-d tree by presorting the data in each of k dimensions prior to building the tree. It then preserves the order of these k sorts during tree construction and thereby avoids the requirement for any further sorting. Moreover, this algorithm is amenable to parallel execution via multiple threads. Compared to an algorithm that finds the median for each recursive…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · Data Management and Algorithms · Image Processing and 3D Reconstruction
