Closest Pair of Points

A visualization of a divide-and-conquer algorithm for finding the closest pair of points in the plane.

Instructions — Click on the canvas to add points. Use the buttons to add 10 random points, run the algorithm, or clear the canvas. Keyboard: Space = random, Enter = run/play, Delete = clear, = step back/forward. After running, use step buttons or arrows to move through the animation.

Slow Fast

Annotations — Dashed lines are division boundaries. The current subproblem is teal; left and right (L / R) are coral; the merge strip is violet. The closest pair is drawn in teal.