Convex Hull ● Jarvis' March O(hn) – Find lowest point O(n) – Repeatedly Find next least-counterclockwise point O(hn) ● Grahm's Scan O(n log n) – Find lowest point O(n) – Sort points by counterclockwise-ness from lowest point O(n log n) – Visit points in order, popping verticies off the stack when turning right O(n)
Which is better? Depends whether h > log n
Data Set
Time
Size of Hull
Divergence 500,000 points
Time comparison
Time over n
h vs n
Conclusions ● Jarvis march slower, but implementation is correct ● JM and GS have similar complexity with this data set ● What about 3 dimensions? – applications in ray tracing