So, if within δ * 2δ rectangle R, we only need to compare one point from the left side to 7 points on the right side. What I don't understand is, despite reading the proof, inside R we can fill as many points as we want inside the rectangle which may exceed the total number of 7. Imagine if we have δ = 2, a point p(1.2, 1.1) on the left side, and on the right side, we have a whole bunch of q, such as q(1.5, 1.7) , q(1.4, 1.3),.....how can only comparing 7 points detects the closest pair? I thought that we must compare every points within rectangle R if it is the case. Please help me.
The time complexity of this algorithm will be O(n log n).
The closest pair is the minimum of the closest pairs within each half and the closest pair between the two halves. To split the point set in two, we find the x-median of the points and use that as a pivot. Finding the closest pair of points in each half is subproblem that is solved recursively.
d) O(N3 log N) Answer: c Explanation: The efficiency of closest pair algorithm by brute force technique is mathematically found to be O(N2). 4. What is the basic operation of closest pair algorithm using brute force technique?
There may only be 6 points inside your rectangle, since that's the maximum number of points that you can put in a rectangle with sides δ and 2δ maintaining the property that they are at least δ distant from each other.
The way to lay those 6 points is shown in the figure below:
You can check for yourself that there's way of putting another point inside the rectangle without violating the distance property. If you add more than 6 points, they would be less than δ apart, which is a contradiction, since δ is supposed to be the distance between the closest pair.
Since there may be a maximum of 6 points, testing 7 will guarantee that you find the solution.
I got figure 1 from these UCSB slides, which may be useful to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With