Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. The closest pair
of points problem or closest pair problem is a problem of computational
geometry: given n points in metric space, find a pair of points with the
smallest distance between them. Its two-dimensional version, for points
in the Euclidean plane, was among the first geometric problems which
were treated at the origins of the systematic study of the computational
complexity of geometric algorithms. A naive algorithm of finding
distances between all pairs of points and selecting the minimum requires
O time. It turns out that the problem may be solved in O time in an
Euclidean space or Lp space of fixed dimension d. In the algebraic
decision tree model of computation, the O algorithm is optimal. The
optimality follows from the observation that the element uniqueness
problem is reducible to the closest pair problem: checking whether the
minimal distance is 0 after the solving of the closest pair problem
answers the question whether there are two coinciding points.