TL;DR
This paper presents the first practical, work-efficient parallel batch-dynamic data structure for the metric closest pair problem. By extending Golin et al.’s sparse partition framework and introducing a novel parallel batch-dynamic binary heap, the system handles batches of $m$ updates across $n$ points in near-optimal work and polylogarithmic depth. Across 48-core benchmark runs, the algorithm achieves up to 38.57x parallel speedup and outperforms recomputing from scratch with static parallel algorithms for update batches containing up to 20% of the entire dataset.
What Problem Does This Paper Address?
Finding the closest pair of points in a multi-dimensional metric space is a cornerstone problem in computational geometry, with widespread applications in collision detection, robot motion planning, and hierarchical clustering. In many real-time applications, point sets change dynamically.
While static algorithms find the closest pair from scratch and theoretical serial dynamic algorithms can update it in $O(\log n)$ time, existing dynamic approaches had never been implemented in practice, nor could they process batches of updates concurrently. When updates arrive in streams or large batches, re-running a static algorithm is computationally wasteful, yet sequential updates cannot leverage modern multicore processors. The authors tackle the challenge of designing and engineering a batch-dynamic closest pair data structure that is both theoretically work-efficient and fast in practice on shared-memory multicore machines.
Methods
The algorithm builds upon the sparse partition framework of Golin et al., which organizes points across $O(\log n)$ hierarchical grid levels with geometrically decreasing grid-cell sizes dictated by distances to randomly sampled pivot points.
To make this structure batch-parallel and practical, the authors introduce several key innovations:
- Parallel Batch-Dynamic Binary Heap: A novel binary heap capable of processing batches of insertions, deletions, and key updates in $O(m \log((n+m)/m))$ work and $O(\log(n+m))$ depth. To avoid data races and maintain work efficiency, heap operations are pipelined across tree levels (e.g., triggering child swaps on level $i-1$ as soon as the first swap on level $i$ completes).
- Simplified Single-Heap Implementation: While the theoretical model maintains a heap of "restricted distances" per grid level, the authors prove that maintaining a single heap $H^*$ at a critical deep level ($j = L - \lceil \log_3 2\sqrt{k} \rceil$) suffices in practice, dramatically cutting constant-factor overheads.
- Dynamic $k$-d Trees for Higher Dimensions: Because grid-box neighborhood checking incurs an exponential $3^k$ cell-inspection overhead, the authors switch to a parallel batch-dynamic spatial-median $k$-d tree for dimensions $k \ge 5$, turning grid lookups into efficient range queries over populated regions.
- Static Baselines: The authors also parallelized and evaluated four classic static closest-pair algorithms: divide-and-conquer, Rabin's randomized grid algorithm, the Khuller–Matias sieve, and a randomized incremental algorithm.
Datasets
The authors evaluated their implementations on an AWS r5.24xlarge instance (48 physical cores with 2-way hyper-threading, 768 GB RAM) across synthetic and real-world benchmarks:
- Synthetic (10M points each, dimensions $k \in \{2, 3, 5, 7\}$):
- Uniform: Points placed uniformly at random in a bounding hypercube of side length $\sqrt{n}$.
- Seed Spreader (SS / SS-varden): Points generated by local random walks with occasional random jumps, including versions with variable-density clusters.
- Real-World:
7D-Household-2M: 2,049,280 7D points from household electric sensors.16D-Chem-4M: 4,208,261 16D points from a gas/chemical sensor array.3D-Cosmo-298M: 298,246,465 3D points from an astronomical $N$-body cosmological simulation.
Key Insights and Ideas
- Pipelined Heapify Prevents Bottlenecks: Rather than dispatching unstructured parallel updates that collide or serialize at the heap root, pipelining Up-Heap and Down-Heap level-by-level synchronizes data access and bounds both work and depth.
- Dynamic Beats Static up to Large Batch Sizes: Because sparse partitions restrict updates mostly to localized grid cells and deeper levels, dynamic batching is faster than recomputing from scratch via the fastest static algorithms for batches up to 20% of the active dataset.
- Dimensionality Adaptation: Spatial grids excel in low dimensions ($k \le 3$), but their empty-cell scanning quickly dominates runtime; transitioning to dynamic $k$-d trees preserves practicality in higher dimensions.
Key Results
- Dynamic Throughput and Speedup: On 48 cores with hyper-threading, the batch-dynamic algorithm achieved up to 38.57x parallel speedup (15.10x on average) and throughputs of up to $1.35 \times 10^7$ updates/sec for insertions and $1.06 \times 10^7$ updates/sec for deletions.
- Negligible Parallelism Overhead: Running the parallel batch code on a single thread was only 1.13x slower on average than a dedicated sequential implementation.
- Static Algorithm Bake-off: Rabin's randomized algorithm was the fastest static baseline on average (7.63x faster than the rest). While divide-and-conquer was fastest on 7 of 11 datasets in low dimensions, its performance degraded sharply on higher-dimensional sets (e.g., taking 202 seconds on
16D-Chem-4Mvs. 1.38 seconds for Rabin's algorithm).
Limitations and Future Work
- Curse of Dimensionality: Although the $k$-d tree mitigates empty grid cells, both work bounds and tree search times remain sensitive to higher dimensions ($k > 16$).
- Oblivious Adversary Assumption: The theoretical bounds assume update sequences are independent of internal random pivot choices.
- Rebuilding Latency: If an inserted point forces a pivot update at high levels, the subsequent levels must be reconstructed, introducing occasional latency variations despite $O(m)$ expected amortized work.
Summary updated