Efficient Nearest Neighbor Search Using Dynamic Programming
Pengfei Wang,Jiantao Song,Shiqing Xin,Shuangmin Chen,Changhe Tu,Wenping Wang,Jiaye Wang
2024-10-21
Abstract:Given a collection of points in R^3, KD-Tree and R-Tree are well-known nearest neighbor search (NNS) algorithms that rely on space partitioning and spatial indexing techniques. However, when the query point is far from the data points or the data points inherently represent a 2-manifold surface, their query performance may degrade. To address this, we propose a novel dynamic programming technique that precomputes a Directed Acyclic Graph (DAG) to encode the proximity structure between data points. More specifically, the DAG captures how the proximity structure evolves during the incremental construction of the Voronoi diagram of the data points. Experimental results demonstrate that our method achieves a 1x-10x speedup. Additionally, our algorithm offers several valuable features. For instance, it naturally supports an O(k \log n) algorithm for farthest point sampling, where k is the desired number of sample points. Moreover, density peak clustering, which involves finding the nearest point among the top K points, is typically considered to have a time complexity of O(n^2). With our algorithm, this can be reduced to O(n \log n). We believe this work will inspire further research on the NNS problem.
Computational Geometry,Graphics