This simulation visually demonstrates how the divide-and-conquer algorithm splits a set of points, solves each half recursively, and checks the narrow strip near the dividing line to find the overall closest pair.
Add or generate points on the plane, then step through the algorithm to watch the recursive splitting, the strip formation, and the final closest pair get highlighted.
Controls let you add points, randomize the point set, and step forward or replay the algorithm's divide, recurse, and strip-check phases.
For a set of one million points, the divide-and-conquer algorithm can be millions of times faster than brute force, turning a computation that might take hours into one that finishes in a fraction of a second.
This simulation visually demonstrates how the divide-and-conquer algorithm splits a set of points, solves each half recursively, and checks the narrow strip near the dividing line to find the overall closest pair.
This simulation visually demonstrates how the divide-and-conquer algorithm splits a set of points, solves each half recursively, and checks the narrow strip near the dividing line to find the overall closest pair.
Add or generate points on the plane, then step through the algorithm to watch the recursive splitting, the strip formation, and the final closest pair get highlighted.
For a set of one million points, the divide-and-conquer algorithm can be millions of times faster than brute force, turning a computation that might take hours into one that finishes in a fraction of a second.