hgeometry-0.12.0.1: Geometric Algorithms, Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

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)\)