We introduce two novel algorithms for the problem of finding the closest pair in a cloud of $n$ points based on findings from mathematical optimal packing theory. Both algorithms are deterministic, show fast effective runtimes, and are very easy to implement. For our main algorithm, cppMM, we prove $O(n)$ time complexity for the case of uniformly distributed points. Our second algorithm, cppAPs, is almost as simple as the brute-force approach, but exhibits an extremely fast empirical running time, although its worst-case time complexity is also $O(n^2)$. We embed the new algorithms in a review of the most prominent contenders and empirically demonstrate their runtime behavior for problem sizes up to $n =$ 33,554,432 points observed in our C++ test environment. For large $n$, cppMM dominates the other algorithms under study.
翻译:基于数学最优填充理论的研究成果,我们针对在包含 $n$ 个点的点云中寻找最近点对的问题,提出了两种新颖算法。两种算法均为确定性算法,展现出快速的实际运行时间,且非常易于实现。对于我们的主要算法 cppMM,我们证明了在点均匀分布的情况下其时间复杂度为 $O(n)$。我们的第二种算法 cppAPs,其实现几乎与暴力方法一样简单,但表现出极快的实际运行时间,尽管其最坏情况时间复杂度也为 $O(n^2)$。我们将新算法置于对最突出竞争算法的综述中,并在我们的 C++ 测试环境中,针对问题规模高达 $n =$ 33,554,432 个点的情况,实证展示了它们的运行时间行为。对于较大的 $n$,cppMM 在研究的算法中占据主导地位。