English

On the closest pair of points problem

Data Structures and Algorithms 2026-01-12 v1

Abstract

We introduce two novel algorithms for the problem of finding the closest pair in a cloud of nn 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)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(n2)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=n = 33,554,432 points observed in our C++ test environment. For large nn, cppMM dominates the other algorithms under study.

Keywords

Cite

@article{arxiv.2601.05681,
  title  = {On the closest pair of points problem},
  author = {Martin Hitz and Michaela Hitz},
  journal= {arXiv preprint arXiv:2601.05681},
  year   = {2026}
}
R2 v1 2026-07-01T08:57:35.114Z