This applet demonstrates a solution of the closest point pair problem. The user can place points with mouse or click +4 random to add four random points at once. Depending of the status of the run mode check box, the applet either "play" the algorithm or runs it step by step.
The algorithm sorts points by one of the coordinate and then applies recursive partitioning, at the same time limiting the search distance by the distance of the known best candidate for the closest point pair.
This code is written by Ultrastudio.org team and is available under GPL v 3 license.