Closest pair algorithm why 7 points and not less

269 Views Asked by At

From multiple sources, I've learned that in the divide and conquer closest pair algorithm, when finding the special cases (pairs of points in different halves), you scan for at most 7 indexes ahead of any given point. When I worked it out, it seems like you can get away with only 6 or maybe even 5.

If you do the classic proof where you draw squares of side length d (the min from the recursive calls), you can only fit 7 points (or maybe 6?) between the 2 points, which means you only need to scan 6 (or 5?) points ahead to find the min. This is because the only way you can "fit 8 points" is by putting the points in the corners, but this is impossible because the squares share corners, and also because if you make your bounds strict (and not less than or equal to), it is also impossible.

Sorry for being so unclear, the whole thing takes an entire lecture to describe, so I obviously cannot do it here. To be more clear, can someone give me an example of 8 points that satisfy the conditions and also such that the highest and lowest points are in different halved and are the closest? The conditions being that pairs of points in the same half are at least d apart.

0

There are 0 best solutions below