This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Mepo y the two co lve p p q p p q p q q p q
Merging the left and right subhulls. q CONVEX HULL  Gift Wrapping
✦ Start w ith theoleLectst e o int onvex Hullaroun d
N n ftmour pE: C an d wrap s l p=l l
p p
p p
l F l l
p The execution of Jarvis’s March. In other words, if q is the vertex following p, and r is any other input
, r is in counterclockwise HULL e caGift eachrsuppingvertex in lin
order. W  n ﬁnd W a ccessive
CONVEX
series of O(n) counterclockwise tests.
JarvisMarch(X [1 .. n], Y [1 .. n]):
←1
for i ← 2 to n
if X [i] < X [ ]
←i p←
rep eat
q ←p+1
Make sure p = q
for i ← 2 to n
if CCW(p, i, q )
q←i
next[p] ← q ; pr ev [q ] ← p
p←q
until p = algorithm sp ends O(n) time for each convex hull vertex, the worstcase ru CONVEXithm is optimal (within aBounant factor), he
HULL  Lower const d
Our algor
proof by reduction from sor ting.
let N = (x1 , x2 , . . . xn ) ⊂ IR
for all i let pi = (xi , x2 )
i
compute C H(P )
P : y = x2
C H(P ) p3 p2
p1
p4 Intro Linesegment intersection
Given n line segments, does an...
View
Full
Document
This note was uploaded on 01/15/2012 for the course COT 5405 taught by Professor Ungor during the Fall '08 term at University of Florida.
 Fall '08
 UNGOR
 Algorithms, Data Mining, Databases

Click to edit the document details