CS 411 Fall 2025  >  Outline & Supplemental Notes for October 6, 2025


CS 411 Fall 2025
Outline & Supplemental Notes
for October 6, 2025

Outline

Multiplication (cont’d) [L 5.4]

See the October 3, 2025 lecture notes.

Closest Pair & Convex Hull [L 5.5]

Supplemental Notes

More on the Divide and Conquer Closest-Pair Algorithm

This section is based in part on work done by my former graduate student Jason Bright and myself.

The Central Strip

When processing the central strip in the closest-pair algorithm, we order the points in ascending order by y-coordinate. The text gives a simple argument showing that we only need to check distances between each point and the next \(7\) points in the ordering. Then it states that it is enough to check the next \(5\).

In fact, we only need to check the next \(3\) points. This is difficult to prove—but it is true.

Checking only the next \(2\) is not enough, as illustrated by the following set of points: \(\left\{(1,-3),(-6,-2),(6,2),(-1,3)\right\}\).

The Base Case

We previously studied a Brute Force algorithm for the Closest Pair Problem. This is \(\Theta(n^2)\), while the Divide and Conquer algorithm is \(\Theta(n\log n)\). However, for small-ish sets of points, the Brute Force algorithm is faster. The crossover point at which the Divide and Conquer algorithm becomes faster depends on various implementation details, but it is somewhere upwards of \(40\) points.

Thus, we can get better performance from the Divide and Conquer algorithm if we use as a base case, not sets of size \(2\) or \(3\), but sets of size at most \(40\)—or perhaps a greater size. The base case is then handled by the Brute Force algorithm.

More on Finding the Convex Hull

Quickhull is another “quick—” algorithm with a fast average case but a slow worst case. We have mentioned how the technique of introspection can be used with the Quickselect and Quicksort algorithms to construct an algorithm that is very fast in the average case and pretty fast in the worst case. Can introspection give us a fast convex-hull algorithm?

Yes, it can. As you might expect, we call the resulting algorithm Introhull. As in the earlier introspection examples, we run Quickhull, keeping track of the recursion depth; we switch to an algorithm with a faster worst case if the depth exceeds some limit. What algorithm should that be? There are known algorithms that find the convex hull of a set of \(n\) points in the plane in time \(\Theta(n\log n)\), example, Plane Sweep (A. M. Andrew 1979), which we will not discuss in any detail. Using this as our fallback algorithm gives us an Introhull with worst-case time \(\Theta(n\log n)\) and average-case time \(\Theta(n)\), where average has the meaning described earlier.