k-nearest neighbor (k-NN) search is a fundamental primitive in geometry processing and computer graphics. While spatial partitioning structures such as kd-trees are standard, they are often manifold-blind, failing to exploit the intrinsic low-dimensional structure of points sampled from 2-manifolds. Recent advances in dynamic programming-based nearest neighbor search (DP-NNS) leverage incrementally constructed Voronoi diagrams to accelerate queries, where each site p maintains a list of successors that progressively refine its Voronoi cell. However, DP-NNS is restricted to single nearest neighbor (k=1) searches, precluding their adoption in applications that require local neighborhood statistics. In this paper, we generalize the DP-NNS framework to support arbitrary k-NN queries for manifold-aligned data. Our approach is founded on the geometric observation that if p_i is the nearest neighbor of a query q in P, then the second nearest neighbor of q must reside either within the prefix set P_{1:i-1} = {p_1, \dots, p_{i-1}} or within p_i's successor list. By recursively extending this principle, we introduce Manifold k-NN, a recursive algorithmic scheme that significantly outperforms conventional kd-trees for manifold-aligned data. Our method achieves a 1\times--10\times speedup in volume-to-surface query scenarios and inherently supports dynamic prefix queries -- enabling k-NN searches within any subset P_{1:m} (m \leq n) with zero overhead. Furthermore, we extend the framework to support point deletion via local Delaunay updates, providing a complete suite of dynamic operations for point set modification. Comprehensive experiments on diverse geometric datasets demonstrate the efficiency and broad applicability of our approach for modern graphics pipelines. Source code is available at https://github.com/sssomeone/manifold-knn.
翻译:k近邻搜索是几何处理与计算机图形学中的基本操作。尽管kd树等空间划分结构已标准化,但通常对流形不敏感,未能利用从2-流形采样点固有的低维结构特性。近期基于动态规划的近邻搜索(DP-NNS)方法通过增量构建Voronoi图加速查询,每个站点p维护一个后继列表逐步细化其Voronoi胞腔。然而,DP-NNS仅支持单近邻(k=1)搜索,从而限制了其在需要局部邻域统计的应用中部署。本文通过几何观测将DP-NNS框架推广至支持流形对齐数据的任意k近邻查询:若p_i是查询点q在点集P中的最近邻,则第二近邻必然属于前缀集合P_{1:i-1}={p_1,...,p_{i-1}}或p_i的后继列表。通过递归扩展此原理,我们提出流形k-NN——一种递归算法方案,在流形对齐数据上显著优于传统kd树。该方法在体积-表面查询场景中实现1-10倍加速,并原生支持动态前缀查询——可零开销地对任意子集P_{1:m}(m≤n)执行k近邻搜索。进一步地,我们通过局部Delaunay更新扩展框架以支持点删除,为点集修改提供完整的动态操作套件。在多样化几何数据集上的综合实验证明了该方法对现代图形管线的效率与广泛适用性。源代码见https://github.com/sssomeone/manifold-knn。