lecture_17

# lecture_17 - Introduction to Algorithms 6.046J/18.401...

This preview shows pages 1–7. Sign up to view the full content.

Introduction to Algorithms 6.046J/18.401 Lecture 1 8 Prof. Piotr Indyk

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Today We have seen algorithms for: – “numerical” data (sorting, median) – graphs (shortest path, MST) Today and the next lecture: algorithms for geometric data © 2003 by Piotr Indyk Introduction to Algorithms November 10, 2004 L17.2
Computational Geometry Algorithms for geometric problems Applications: CAD, GIS, computer vision,……. E.g., the closest pair problem: – Given: a set of points P={p 1 …p n } in the plane, such that p i =(x i ,y i ) – Goal: find a pair p i p j that minimizes ||p i – p j || ||p-q||= [(p x -q x ) 2 +(p y -q y ) 2 ] 1/2 We will see more examples in the next lecture © 2003 by Piotr Indyk Introduction to Algorithms November 10, 2004 L17.3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Closest Pair Find a closest pair among p 1 …p n Easy to do in O(n 2 ) time – For all p i p j , compute ||p i – p j || and choose the minimum We will aim for O(n log n) time © 2003 by Piotr Indyk Introduction to Algorithms November 10, 2004 L17.4
Divide and conquer Divide: – Compute the median of x-coordinates – Split the points into P L and P R , each of size n/2 Conquer: compute the closest pairs for P L and P R Combine the results (the hard part) © 2003 by Piotr Indyk Introduction to Algorithms November 10, 2004 L17.5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Combine 2d Let d=min(d 1 ,d 2 ) Observe:
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern