GScanJMarch-2 - Read Chapter 1 from text by BKOS. The...

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

View Full Document Right Arrow Icon
Read Chapter 1 from text by BKOS. The procedure SlowConvexHull(P) [pp.3-4] is a brute force algorithm taking O(n 3 ) time. The algorithm on p.6 called ConvexHull(P) is a modification of Graham’s Scan algorithm which is presented its original form below. Read the rest of the chapter Sections 1.2 and 1.3. Extreme Point Lemma : A point is non-extreme iff it is inside some closed triangle whose vertices are points of the set, and is not itself a corner of that triangle. Proof of this lemma and an algorithm taking O(n 4 ) time are left as exercises. An edge with two extreme vertices is called an extreme edge. Develop an O(n 3 ) algorithm to determine the extreme edges of S.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Convex hulls Graham’s scan Concept A point within a triangle of S cannot be a vertex of the convex hull. Previous algorithm determined if a point p was within a triangle of S by trying (as many as) all of the triangles for each point p . Can we find out if p is within a triangle of S more efficiently? Graham’s scan does so. This algorithm is from one of the first papers specifically concerned with finding an efficient geometric algorithm (1972). The essential idea: if a point p is not a vertex of the convex hull, then it is internal to some triangle Op 1 p 2 , where O is an internal point and p 1 and p 2 are hull vertices. But if we are trying to find the hull vertices, where do p 1 and p 2 come from? We shall see. The algorithm consists of preparation and scan. Single shot algorithm (there is only one H ( S ) for a given S ).
Background image of page 2
Convex hulls Graham’s scan Centroid The centroid of a finite set of points p 1 , p 2 , …, p N is their arithmetic mean ( p 1 + p 2 + … + p N ) / N . (Computed for each coordinate separately.) Lexicographic sort Sorting on multiple keys associated with objects to be sorted. Compare objects to be sorted on first key; and sort accordingly. If first keys are equal, sort on second key. If second keys are equal, … farther faster fastest father p 1 = (-3,-1) p 2 = (-2,1.5) p 2 = (2,1) c = (-1,0.5)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Convex hulls Graham’s scan Polar angles The polar angle of a point p is the angle from the x axis through the origin to the point, ascending counterclockwise. 0 x y p 1 p 2 θ 1 θ 2
Background image of page 4
Convex hulls Graham’s scan 0 x y p 1 p 2 θ 1 θ 2 Comparing polar angles Given two points p 1 and p 2 in the plane, which has the greater polar angle? p 2 forms a strictly small polar angle with the x axis than p 1 iff triangle 0 p 2 p 1 has a positive signed area. Area(triangle 0
Background image of page 5

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

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

This note was uploaded on 10/04/2011 for the course COT 5520 taught by Professor Mukherjee during the Spring '11 term at University of Central Florida.

Page1 / 20

GScanJMarch-2 - Read Chapter 1 from text by BKOS. The...

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

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