lecture_17

Lecture_17 - Introduction to Algorithms 6.046J/18.401 Lecture 18 Prof Piotr Indyk Today We have seen algorithms for"numerical data(sorting median

Info iconThis 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
Background image of page 1

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

View Full DocumentRight 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
Background 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
Background image of page 3

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

View Full DocumentRight 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
Background 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
Background image of page 5

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

View Full DocumentRight Arrow Icon
Combine 2d Let d=min(d
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/10/2008 for the course CSE 6.046J/18. taught by Professor Piotrindykandcharlese.leiserson during the Fall '04 term at MIT.

Page1 / 16

Lecture_17 - Introduction to Algorithms 6.046J/18.401 Lecture 18 Prof Piotr Indyk Today We have seen algorithms for"numerical data(sorting median

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online