hgeometry-0.12.0.4: Geometric Algorithms, Data structures, and Data types.
Copyright (C) Frank Staals see the LICENSE file Frank Staals None Haskell2010

Algorithms.Geometry.ClosestPair

Description

$$O(n\log n)$$ time algorithm to compute the closest pair among a set of $$n$$ points in $$\mathbb{R}^2$$.

Synopsis

# Documentation

closestPair :: (Ord r, Num r) => LSeq 2 (Point 2 r :+ p) -> Two (Point 2 r :+ p) Source #

Classical divide and conquer algorithm to compute the closest pair among $$n$$ points.

running time: $$O(n \log n)$$