This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: > δ > δ All we have to do now Q R δ δ S Figure if a pair in S has distance < δ The algorithm so far… Input: n 2D points P = { p 1 ,…, p n }; p i =( x i , y i ) Sort P to get P x and P y Q is first half of P x and R is the rest ClosestPair ( P x , P y ) Compute Q x , Q y , R x and R y (q ,q 1 ) = ClosestPair ( Q x , Q y ) (r ,r 1 ) = ClosestPair ( R x , R y ) δ = min ( d(q ,q 1 ), d(r ,r 1 ) ) S = points (x,y) in P s.t. x – x* < δ return Closestinbox ( S, (q ,q 1 ), (r ,r 1 ) ) If n < 4 then find closest point by bruteforce Assume can be done in O(n) Assume can be done in O(n) O(n log n) O(n log n) O(n) O(n) O(n) O(n) O(n) O(n) O(n) O(n) O(n log n) + T(n) T(< 4) = c T(n) = 2T(n/2) + cn O(n log n) overall Rest of today’s agenda Implement Closestinbox in O(n) time...
View
Full Document
 Fall '11
 RUDRA
 Distance, Metric space, euclidean distance, Euclidean space, Ry, closest pairs

Click to edit the document details