Chan’s algorithm CS504 Presentation.

Slides:



Advertisements
Similar presentations
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 29.
Advertisements

Why Graham-Scan Needs to Sort Vertices Before Scanning
Computational Geometry - Part II Mohammed Nadeem Ahmed Raghavendra Kyatham.
2/9/06CS 3343 Analysis of Algorithms1 Convex Hull  Given a set of pins on a pinboard  And a rubber band around them  How does the rubber band look when.
Getting A Speeding Ticket. Mesh Generation 2D Point Set Delaunay Triangulation 3D Point Set Delaunay Tetrahedralization.
Chan’s Algorithm It is Jarvis’s march applied to big blobs of points.
Jarvis March Graham Scan Chan’s Algorithm
Planar Convex Hull 2013 / 5 / 9 Group 4 Sungheon Park Jeongho Son CS504 Presentation [CS504 Presentation]
algorithms and data structures
Convex Hull obstacle start end Convex Hull Convex Hull
CS16: Introduction to Data Structures & Algorithms
The Divide-and-Conquer Strategy
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
The Divide-and-Conquer Strategy
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
Andrew's Monotone Chain Convex Hull Algorithm. Andrew's Monotone Chain Scan A left-to-right variant of Graham's scan Discovered by Andrew in 1979 Using.
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Computational Geometry
Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.
Polygons and the convex hull Prof. Noah Snavely CS1114
Advanced Algorithm Design and Analysis (Lecture 10) SW5 fall 2004 Simonas Šaltenis E1-215b
Informal Definition : Let S is set of nails sticking out from a board. the convex hull can be visualized as the shape formed by a tight rubber band that.
1 Today’s Material Computational Geometry Problems –Closest Pair Problem –Convex Hull Jarvis’s March, Graham’s scan –Farthest Point Problem.
Algorithms and Data Structures Lecture 13. Agenda: Plane Geometry: algorithms on polygons - Verification if point belongs to a polygon - Convex hull.
5/17/2015 1:32 AMConvex Hull1 obstacle start end.
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
Computational Geometry Overview from Cormen, et al. Chapter 33
Convex Hull Algorithms for Dynamic Data Kanat Tangwongsan Joint work with Guy Blelloch and Umut Acar (TTI-C)
Two Topics in Adaptive Algorithms: Hulls and Strings Robert Fraser University of Waterloo.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
Polygons and the convex hull Prof. Noah Snavely CS1114
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.
Review of Bézier Curves DeCastlejau Algorithm V2V2 V4V4 V1V1 V3V3 Insert at t = ¾.
Brute-Force Triangulation
ACM Schedule… 2/23 Geometry problems 3/2 Lab problems (geometry!) 3/30 "Mock" competition and lab session (4:15) 3/9 Final algorithm discussion… 3/16 [Spring.
Convex Hull. What is the Convex Hull? Imagine a set of points on a board with a nail hammered into each point. Now stretch a rubber band over all the.
Computational Geometry (35/33) Line Segments and cross-product Segment intersection and Sweep Line Convex Hull and Graham’s Scan, Jarvis’s march Divide-and-Conquer.
Computational Geometry Course Summary (First Half) Spring 2008 Pay special attention to: algorithm details (able to explain correctness and carry out a.
Convex Hull of a 2D Simple Polyline Presenter: Yung-Hsing Peng Date:
Computational Geometry 2D Convex Hulls Joseph S. B. Mitchell Stony Brook University Chapter 2: Devadoss-O’Rourke.
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
Kansas State University Department of Computing and Information Sciences Friday, July 13, 2001 Mantena V. Raju Department of Computing and Information.
CS 162 Intro to Programming II Insertion Sort 1. Assume the initial sequence a[0] a[1] … a[k] is already sorted k = 0 when the algorithm starts Insert.
A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R. Otherwise, it is called concave.
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
Convex Hull 2012/10/23. Convex vs. Concave A polygon P is convex if for every pair of points x and y in P, the line xy is also in P; otherwise, it is.
CS6234 Advanced Algorithms - Convex hull. Terminologies – ◦ Convex hull of a set Q of points is the smallest convex polygon P for which each point in.
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last time Several convex hull algorithms. Lower bound of O(n log n) –O(n log h) for output sensitive.
Convex hulls in 3D Maciej Kot. Finding convex hull Given a set of points, find a convex hull that contains all of them and is minimal.
Andrew's Monotone Chain Convex Hull Algorithm
CS B553: Algorithms for Optimization and Learning
Convex Hull R.L. Graham’s Algorithm Computer Graphics.
Convex Hull.
August 20, 2002 (joint work with Umut Acar, and Guy Blelloch)
Convex Hull obstacle start end 11/21/2018 4:05 AM Convex Hull
Automatic cylinder detection using Hough Transform.
Convex Sets & Concave Sets
Convex Hull 1/1/ :28 AM Convex Hull obstacle start end.
CS 2750: Machine Learning Expectation Maximization
!'!!. = pt >pt > \ ___,..___,..
مديريت موثر جلسات Running a Meeting that Works
Convex Hulls Given a set of points (x1,y1),(x2,y2),…,(xn,yn), the convex hull is the smallest convex polygon containing all the points.
June 12, 2003 (joint work with Umut Acar, and Guy Blelloch)
Convex Hull obstacle start end 4/30/2019 5:21 PM Convex Hull
Print the following triangle, using nested loops
Computational Geometry Algorithms
Presentation transcript:

Chan’s algorithm CS504 Presentation

Graham’s Scan : 𝑂(𝑛 log 𝑛 ) Jarvis’s March : 𝑂(𝑛ℎ) Planar Convex Hull Graham’s Scan : 𝑂(𝑛 log 𝑛 ) Jarvis’s March : 𝑂(𝑛ℎ) Is there any 𝑂(𝑛 log ℎ ) algorithm? CS504 Presentation

3 stages of Chan’s algorithm combining Graham’s scan and Jarvis’s March together 𝑂 𝑛 log ℎ 3 stages of Chan’s algorithm divide vertices into partitions apply Graham’s scan on each partition apply Jarvis’s March on the small convex hull (repeat 1~3 until we find the hull) CS504 Presentation

Consider arbitrary value 𝑚<𝑛, the size of partition Chan’s Algorithm 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 CS504 Presentation

Chan’s Algorithm Stage 1 n = 32 Set m = 8 CS504 Presentation

Chan’s Algorithm Stage 1 n = 32 Set m = 8 r = 4 CS504 Presentation

Compute convex hull of each partition using Graham’s scan Chan’s Algorithm Stage2 : Graham’s Scan Compute convex hull of each partition using Graham’s scan Total 𝑂(𝑛 log 𝑚 ) time CS504 Presentation

Chan’s Algorithm Stage 2 (After Stage 1) m = 8 r = 4 CS504 Presentation

Chan’s Algorithm Stage 2 Using Graham’s Scan O 𝑚 log 𝑚 for each group -> total 𝑂(𝑚𝑟 log 𝑚 ) = 𝑂(𝑛 log 𝑚 ) CS504 Presentation

How to merge these r hulls into a single hull? Chan’s Algorithm 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) CS504 Presentation

Chan’s Algorithm (-inf,0) -> lowest pt (−∞,0) lowest pt CS504 Presentation

Find the point that maximize the angle in each hull Chan’s Algorithm Find the point that maximize the angle in each hull (−∞,0) 1 lowest pt CS504 Presentation

Find the point that maximize the angle in each hull Chan’s Algorithm Find the point that maximize the angle in each hull (−∞,0) 2 1 lowest pt CS504 Presentation

Find the point that maximize the angle in each hull Chan’s Algorithm Find the point that maximize the angle in each hull 3 (−∞,0) 2 1 lowest pt CS504 Presentation

Chan’s Algorithm If 𝑚<ℎ, then the algorithm will fail! CS504 Presentation

FAIL EXAMPLE – too small value m Chan’s Algorithm FAIL EXAMPLE – too small value m m = 4 (−∞,0) 4 iteration CS504 Presentation

Chan’s Algorithm In 4(a), how to find such points? CS504 Presentation

Find the point that maximize the angle in each hull Chan’s Algorithm Find the point that maximize the angle in each hull (−∞,0) 1 lowest pt CS504 Presentation

Find the point that maximize the angle in a hull Chan’s Algorithm Find the point that maximize the angle in a hull (−∞,0) CS504 Presentation

Finding tangent between a point and a convex 𝑚-gon Chan’s Algorithm Finding tangent between a point and a convex 𝑚-gon 5 1 𝑂 log 𝑚 process 4 3 2 CS504 Presentation

Chan’s Algorithm → 𝑂( log 𝑚 ) CS504 Presentation

Chan’s Algorithm Analysis Suppose God told you some good value for 𝑚 ℎ≤𝑚≤ ℎ 2 𝑂 𝑛 log 𝑚 for stage1~2 At most h steps in Jarvis’s March 𝑂( log 𝑚 ) time to compute each tangent 𝑟 tangent for each iteration total 𝑂 ℎ𝑟 log 𝑚 =𝑂(ℎ 𝑛 𝑚 log 𝑚 ) time 𝑂 𝑛+ℎ 𝑛 𝑚 log 𝑚 =𝑂 𝑛 log 𝑚 =𝑂(𝑛 log ℎ ) as desired. 𝑚≤ ℎ 2 CS504 Presentation

The only question remaining is… Chan’s Algorithm The only question remaining is… how do we know what value to give to 𝑚? CS504 Presentation

Then we eventually get 𝑚 to be in [ℎ, ℎ 2 ] ! Chan’s Algorithm Answer : square search Try this way - 𝑚=2, 4, 8, …, 2 2 𝑡 , … Then we eventually get 𝑚 to be in [ℎ, ℎ 2 ] ! CS504 Presentation

The algorithm stops as soon as 2 2 𝑡 ≥ℎ Chan’s Algorithm The algorithm stops as soon as 2 2 𝑡 ≥ℎ 𝑡= lg lg ℎ Total time complexity 𝑡=1 lg lg ℎ 𝑛 log 2 2 𝑡 = 𝑡=1 lg lg ℎ 𝑛 2 𝑡 ≤𝑛 2 1+ lg lg ℎ =2𝑛 2 lg lg ℎ =2𝑛 log ℎ =𝑂(𝑛 log ℎ ) CS504 Presentation