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

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

View Full Document Right Arrow Icon
Introduction to Algorithms 6.046J/18.401 Lecture 1 8 Prof. Piotr Indyk
Image of page 1

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

View Full Document Right Arrow Icon
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
Image of page 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
Image of page 3

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

View Full Document Right Arrow Icon
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
Image of page 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
Image of page 5

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern