arXiv:2610.10780cs.CGOct 2026

Manuscript Offprint

arXiv:2610.10780

Deterministic Distance Selection in O(n4/3)O(n^{4/3}) Time

Haitao Wang

Abstract

Let PP be a set of nn points in the plane. Given an integer KK with 1≤K≤(n2)1 \leq K \leq \binom{n}{2}, the distance selection problem asks for the KK-th smallest distance among all pairwise distances of the points of PP. The problem has been studied extensively over the past four decades. Recently, Chan and Zheng (2023) gave a randomized algorithm with O(n4/3)O(n^{4/3}) expected running time, while the best known deterministic algorithm runs in O(n4/3log⁡n)O(n^{4/3} \log n) time. In this paper, we present a deterministic O(n4/3)O(n^{4/3})-time algorithm for the problem, matching the best known randomized complexity.

We also consider the more general bichromatic version of the problem, where two point sets A and B are given, with m=∣A∣m = |A| and n=∣B∣n = |B|, and the goal is to find the K-th smallest distance among the mn distances between points of A and points of B. For this problem, the best previously known algorithm runs in O((mlog⁡n+nlog⁡m+m2/3n2/3)log⁡(m+n))O((m \log n + n \log m + m^{2/3}n^{2/3}) \log(m + n)) time. We present a new deterministic algorithm with running time O(mlog⁡2n+nlog⁡2m+m2/3n2/3)O(m \log^2 n + n \log^2 m + m^{2/3}n^{2/3}).

Keywords: Distance selection, geometric optimization, distance counting, hierarchical cuttings, biclique partitions, range searching

1 Introduction

Let PP be a set of nn points in the plane. Given an integer KK with 1≤K≤(n2)1 \leq K \leq \binom{n}{2}, the distance selection problem asks for the KK-th smallest distance among all pairwise distances of the points of PP.

Distance selection is a fundamental problem in computational geometry. Besides its intrinsic interest, it serves as a prototype for a broad class of geometric optimization problems whose optimal objective values are realized by interpoint distances [3, 5, 9, 18, 19, 27]. One may even regard it as a geometric analogue of the classical selection problem [7]. The problem can be solved trivially in O(n2)O(n^2) time. The first subquadratic algorithm was given by Chazelle [11]. Later, Agarwal, Aronov, Sharir, and Suri [2] obtained an O(n3/2log⁡5/2n)O(n^{3/2} \log^{5/2} n)-time algorithm, which was subsequently improved by Goodrich [17] to O(n4/3log⁡8/3n)O(n^{4/3} \log^{8/3} n) time. Katz and Sharir [20] further improved the running time to O(n4/3log⁡2n)O(n^{4/3} \log^2 n). Wang and Zhao recently reduced it to O(n4/3log⁡n)O(n^{4/3} \log n) in ESA 2023 [28].

All of the above algorithms are deterministic. Several randomized algorithms are also known. The randomized algorithm of Agarwal, Aronov, Sharir, and Suri [2] runs in O(n4/3log⁡8/3n)O(n^{4/3} \log^{8/3} n) expected time. Matoušek [22] later improved the bound to O(n4/3log⁡2/3n)O(n^{4/3} \log^{2/3} n) expected time. Most recently, Chan and Zheng [10] obtained a randomized algorithm of O(n4/3)O(n^{4/3}) expected time. Their algorithm uses random sampling and is reminiscent of the randomized linear-time selection algorithm of Floyd and Rivest [16]. The complexity can also be expressed as a function of K. In particular, combining Chan's randomized optimization framework [8] with the result of Wang [24] yields an O(nlog⁡n+n2/3K1/3log⁡5/3n)O(n \log n + n^{2/3} K^{1/3} \log^{5/3} n)-time randomized algorithm, which is particularly attractive when K is relatively small.

Like Hopcroft’s problem and several related geometric range searching problems [10,15], it is possible that distance selection has complexity Θ(n4/3)\Theta(n^{4/3}), although no matching lower bound is currently known. In particular, many problems whose best known upper bounds are O(n4/3)O(n^{4/3}) admit Ω(n4/3)\Omega(n^{4/3}) lower bounds, at least in a restricted partition-based computational model [15], such as Hopcroft’s

*Kahlert School of Computing, University of Utah, Salt Lake City, UT 84112, USA. haitao.wang@utah.edu problem [10], segment intersection counting [10], computing closest points for segments [6, 25], computing many faces in line arrangement [1, 4, 13, 14, 23, 26], etc. If a similar lower bound could be established for distance selection, then the randomized algorithm of Chan and Zheng [10] would be optimal. On the deterministic side, however, the best known complexity remained O(n4/3log⁡n)O(n^{4/3} \log n) [28], leaving a logarithmic gap between deterministic and randomized algorithms.

Our result. In this paper, we close the gap between the best known deterministic and randomized complexities by presenting a deterministic O(n4/3)O(n^{4/3})-time algorithm for distance selection.

We consider a more general bichromatic version of the problem. Let AA and BB be two sets of points in the plane with m=∣A∣m = |A| and n=∣B∣n = |B|, respectively. Let SS denote the set of all pairwise distances between points of AA and points of BB. Given an integer KK with 1≤K≤mn1 \leq K \leq mn, the goal is to compute the KK-th smallest distance in SS. The original monochromatic problem can be easily reduced to this bichromatic problem.

We first consider the symmetric case m=nm = n. Previous work typically solved the bichromatic problem first (with the same time complexities as discussed above), with the monochromatic problem obtained as a consequence. We follow the same approach. Our main result is a deterministic O(n4/3)O(n^{4/3})-time algorithm for the symmetric bichromatic distance selection problem.

We also study the asymmetric case m≠nm \neq n. For this problem, the best previously known algorithm runs in O((mlog⁡n+nlog⁡m+m2/3n2/3)log⁡(m+n))O((m \log n + n \log m + m^{2/3}n^{2/3}) \log(m + n)) time [28]. By extending the framework developed for the symmetric case, we obtain a deterministic algorithm with running time O(mlog⁡2n+nlog⁡2m+m2/3n2/3)O(m \log^2 n + n \log^2 m + m^{2/3}n^{2/3}). Note that if m=O(1)m = O(1), then the running time becomes O(n)O(n), matching the complexity of the classical linear-time selection algorithm. On the other hand, if m=nm = n, then the bound becomes O(n4/3)O(n^{4/3}), matching the complexity of our symmetric case algorithm. Thus, the asymmetric bound naturally interpolates between linear time and the symmetric O(n4/3)O(n^{4/3}) time.

References (28)