Priority Search Trees for Orthogonal Queries
- Priority Search Trees are binary data structures that combine a y-coordinate heap-order with an in-order x arrangement to efficiently support 3D orthogonal range queries.
- The construction algorithm recursively partitions points using medians and maximum y selections, achieving O(n log n) build time with minimal extra space.
- Applications include the fast enumeration of maximal empty axis-parallel rectangles, making them vital for computational geometry and spatial analytics such as VLSI design.
A priority search tree (@@@@1@@@@) is a binary data structure that organizes a set of planar points , each , to efficiently support three-dimensional orthogonal range queries of the form: “report (or optimize) over all points such that and .” PSTs are characterized by simultaneously maintaining a heap-order property with respect to the -coordinate and an in-order property with respect to the -coordinate. PSTs are foundational in computational geometry and pivotal for applications such as the efficient computation of maximal empty rectangles in two dimensions (De et al., 2011).
1. Definition and Invariants
A PST is recursively defined as follows. Given a non-empty point set :
- Let . Make the root of the tree.
- Remove from to form .
- Compute the median of the -coordinates in . Partition into and .
- Recursively build the left and right subtrees on and .
The following invariants uniquely characterize a PST (De et al., 2011):
- Heap-order in : For every node and each child of , .
- In-order in : An in-order traversal yields the points in non-decreasing order of .
Each node maintains only the coordinates of its point; child-pointers or equivalent indices determine the structure.
2. Construction Algorithms and Complexity Analysis
The classical recursive build process involves, at each node, finding the max- element, computing the median -coordinate, and partitioning accordingly. Each of these requires time at each level, yielding the recurrence
with . Via the Master Theorem, this gives for total construction time.
Space consumption is words for the nodes and pointers.
An in-place BFS-level construction is also possible. This layout stores the tree in the input array in heap-like BFS order and uses a $2$-bit array to encode child-nulling at each level. The process, BuildInPlacePST, operates as follows:
- For each level from highest to lowest:
- Nodes of level occupy with .
- In this subarray, the root is extracted as the max- element, the remaining entries are in-place median-partitioned by , and children/grouping is determined with assistance from .
- Only bits are used for the array and indexing, and the entire structure is stored in-place within .
Total construction time remains ; extra workspace is confined to bits (De et al., 2011).
3. Array Layout and Indexing Formulas
After in-place construction, the layout has these properties:
- BFS Shape: Level nodes occupy .
- Heap-order in and In-order in : As in the pointer-based PST, maintained via construction.
- Child indexing: For a node at index in level , the left and right children are located as:
This implicit formalism avoids explicit pointers and additional memory overhead.
4. Query Algorithms and Time Complexity
PSTs support classical three-dimensional orthogonal queries—e.g., find the minimum among —in time using only additional workspace. The algorithm proceeds as:
- Descend from the root to the discriminant node where “splits.”
- At each node, determine traversal direction by comparing -predecessor and -successor found by subtree walks (each ).
- At , check ; if so, recurse in the left/right subtrees, pruning any where root drops below or -range is invalid.
- The recursion for a subtree of height satisfies , yielding .
Similar analysis holds for MaxXInRectangle and MaxYInXRange. Enumerative queries add an term (De et al., 2011).
Table: Time/Space Complexity of Priority Search Trees
| Operation | Complexity | Extra Workspace |
|---|---|---|
| Build | bits | |
| Query | ||
| Application (MERs) | bits |
5. Applications: Largest Empty Axis-Parallel Rectangle
A principal application of PSTs is in enumerating all maximal empty rectangles (MERs) within a bounding box given planar points. This is fundamental in VLSI design and spatial analysis.
The solution proceeds as:
- Build the In-Place PST.
- Top–down and Bottom–up Sweeps: For each pass (fixing the top/bottom on current PST maxima), two double-ended queues of size maintain side candidates.
- At each step, the action is:
- Pop the highest from or .
- Report the found MER.
- Use PST queries (e.g.,
MinXInRectangleon lower ) to discover next side point.
- After each pass, re-heapify in deletes the root.
- The total per pass is , where is the number of MERs found in that pass.
- Total complexity sums to , where is the number of MERs, and workspace remains bits (De et al., 2011).
This establishes the PST as a space-efficient core structure for optimal enumeration of maximal empty axis-parallel rectangles.
6. Summary and Significance
Priority search trees implement an efficient mechanism for three-dimensional orthogonal range searching in planar point sets. Key contributions include:
- A recursive/data-driven structure balancing -heap and -order for optimal query resolution.
- In-place BFS-level construction in time and extra bits, maintaining all invariants and enabling pointerless layouts.
- query time with workspace.
- Immediate applications in computational geometry, notably the complexity for maximal empty axis-parallel rectangle enumeration, with in-place spatial efficiency.
A plausible implication is that PSTs, due to their low workspace requirements and optimal query times, are well suited for embedded, memory-constrained, and high-performance spatial analytics workflows. These results are foundational for both theory and practice in computational geometry (De et al., 2011).