cs504 presentation chan’s algorithm. planar convex hull cs504 presentation
TRANSCRIPT
CS504 Presentation
Chan’s algorithm
Planar Convex Hull
CS504 Presentation
• Graham’s Scan :
• Jarvis’s March :
• Is there any algorithm?
Chan’s Algorithm
CS504 Presentation
• Chan’s algorithm– combining Graham’s scan and Jarvis’s March together
• 3 stages of Chan’s algorithm1. divide vertices into partitions2. apply Graham’s scan on each partition3. apply Jarvis’s March on the small convex hull
(repeat 1~3 until we find the hull)
Chan’s Algorithm
CS504 Presentation
• Stage1 : Partition
• Consider arbitrary value , the size of partition– how to decide will be treated later
• Partition the points into groups, each of size – is the number of groups
Chan’s Algorithm
CS504 Presentation
• Stage 1
n = 32
Set m = 8
Chan’s Algorithm
CS504 Presentation
• Stage 1
n = 32
Set m = 8 r = 4
Chan’s Algorithm
CS504 Presentation
• Stage2 : Graham’s Scan
• Compute convex hull of each partition using Gra-ham’s scan
• Total time
Chan’s Algorithm
CS504 Presentation
• Stage 2
(After Stage 1) m = 8 r = 4
Chan’s Algorithm
CS504 Presentation
• Stage 2
Using Graham’s Scan
for each group-> total =
Chan’s Algorithm
CS504 Presentation
• Stage3 : Jarvis’s March
• How to merge these r hulls into a single hull?
• IDEA : treat each hull as a “fat point” and run Jarvis’s March!
• # of iteration is at most m– to guarantee the time complexity O(nlogh)
Chan’s Algorithm
CS504 Presentation
• (-inf,0) -> lowest pt
(−∞ ,0)
lowest pt
Chan’s Algorithm
CS504 Presentation
• Find the point that maximize the angle in each hull
(−∞ ,0)
lowest pt1
Chan’s Algorithm
CS504 Presentation
• Find the point that maximize the angle in each hull
(−∞ ,0)
lowest pt1
2
Chan’s Algorithm
CS504 Presentation
• Find the point that maximize the angle in each hull
(−∞ ,0)
lowest pt1
2
3
Chan’s Algorithm
CS504 Presentation
If , then the algorithm will fail!
Chan’s Algorithm
CS504 Presentation
• FAIL EXAMPLE – too small value m
m = 4
(−∞ ,0)
4 iteration
Chan’s Algorithm
CS504 Presentation
In 4(a), how to find such points?
Chan’s Algorithm
CS504 Presentation
• Find the point that maximize the angle in each hull
(−∞ ,0)
lowest pt1
Chan’s Algorithm
CS504 Presentation
• Find the point that maximize the angle in a hull
(−∞ ,0)
Chan’s Algorithm
CS504 Presentation
• Finding tangent between a point and a convex -gon
1
23
4
5
process
Chan’s Algorithm
CS504 Presentation
→𝑂 (log𝑚)
Chan’s Algorithm
CS504 Presentation
Analysis• Suppose God told you some good value for
• for stage1~2• At most h steps in Jarvis’s March
– time to compute each tangent– tangent for each iteration– total time
• as desired.
𝑚≤h2
Chan’s Algorithm
CS504 Presentation
• The only question remaining is…
how do we know what value to give to ?
Chan’s Algorithm
CS504 Presentation
• Answer : square search
• Try this way -
• Then we eventually get to be in !
Chan’s Algorithm
CS504 Presentation
• The algorithm stops as soon as
• Total time complexity