Closest Pair of Points

Michael Shamos & Dan Hoey, 1975

O(n log n)

Proposed by Michael Shamos and Dan Hoey in 1975, the closest pair problem asks for the two points with minimum Euclidean distance in a planar set. This visualization uses a brute-force sweep through all pairs: the current comparison appears in gold, previously compared points turn teal, and the best pair found so far is drawn in coral with its distance labeled.