rec24 - 6.006 Intro to Algorithms Recitation 24 May 6, 2011...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
6.006 Intro to Algorithms Recitation 24 May 6, 2011 Convex Hull Given a set of points Q , we may want to find the convex hull, which is a subset of points that form the smallest convex polygon where every point in Q is either on the boundary of the polygon or in the interior of the polygon. We can imagine fitting an elastic band around all of the points. When the band tightens, the points that it rests on form the convex hull. There are several algorithms to solve the convex hull problem with varying runtimes. Graham’s Scan The Graham’s scan algorithm begins by choosing a point that is definitely on the convex hull and then iteratively adding points to the convex hull. 1. Let H be the list of points on the convex hull, initialized to be empty 2. Choose p 0 to be the point with the lowest y-coordinate. Add p 0 to H since p 0 is definitely in the convex hull. 3. Let ( p 1 ,p 2 ,...,p n ) be the remaining points sorted by their polar angles relative to p 0 from smallest to largest. Iterating through the points in sorted order should sweep around
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/11/2011 for the course MATH 180 taught by Professor Byrns during the Spring '11 term at Montgomery College.

Page1 / 3

rec24 - 6.006 Intro to Algorithms Recitation 24 May 6, 2011...

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

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