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

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

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

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

View Full Document
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