1 / 51

Planar Convex Hull

[CS504 Presentation]. Planar Convex Hull. 2013 / 5 / 9 Group 4 Sungheon Park Jeongho Son. CS504 Presentation. Contents. Definition of convex hull Bruteforce algorithm Graham’s scan Divide and conquer Quickhull Jarvis’ method. CS504 Presentation. What is convex hull?.

eara
Download Presentation

Planar Convex Hull

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. [CS504 Presentation] Planar Convex Hull 2013 / 5 / 9 Group 4 Sungheon Park Jeongho Son CS504 Presentation

  2. Contents • Definition of convex hull • Bruteforce algorithm • Graham’s scan • Divide and conquer • Quickhull • Jarvis’ method CS504 Presentation

  3. What is convex hull? • Let S be a set of points in the plane. • Intuition: Imagine the points of S as being pegs; the convex hull of S is the shape of a rubber-band stretched around the pegs. CS504 Presentation

  4. What is convex hull? • Formal definition: the convex hull of S is the smallest convex polygon that contains all the points of S • Convexity : A set is convex if given any points any convex combination of p and q is in , or equivalently, the line segment . CS504 Presentation

  5. Applications of convex hull computer visualization, ray tracing path finding Geographical Information Systems (GIS) Visual pattern matching CS504 Presentation

  6. Orientation test • Given a triplet of three points , in the plane, is defined as • >0 : oriented counterclockwise • =0 : collinear • <0 : oriented clockwise CS504 Presentation

  7. Graham’s Scan • algorithm • Points are added one at a time, and structure is updated on each new insertion. CS504 Presentation

  8. Graham’s Scan • Algorithm • Sort the points according to increasing order of their -coordinates, denoted . • Push and then onto stack . • for to do: while( and ) pop . Push onto CS504 Presentation

  9. Graham’s Scan • Analysis • Sorting : • Let the number of points that are popped on processing , the amount of time spent processing is is bounded by since each of the points is pushed onto the stack once. Total time complexity is CS504 Presentation

  10. Original Graham’s scan • Initially, points are sorted in increasing angular value • If the point is not convex (concave), it removes the current point from the perimeter list CS504 Presentation

  11. Divide-and-Conquer • algorithm • Recursively compute convex hulls, and merge two hulls by computing upper and lower tangent CS504 Presentation

  12. Divide-and-Conquer • Algorithm finding lower tangent LowerTangent(,) : (1) Let a be the rightmost point of . (2) Let b be the leftmost point of . (3) While (ab is not a lower tangent for and ) do (a) While (ab is not a lower tangent to ) move a clockwise (b) While (ab is not a lower tangent to ) move b counterclockwise (4) Return ab. • Can be done in where . • Overall algorithm runs time. CS504 Presentation

  13. Quickhull • in worst case, but shows better performance in most cases • Discard points that are not on the hull as quickly as possible. • Begin with the quadrilateral which connects maximum and minimum x,y coordinates CS504 Presentation

  14. Quickhull • Find a point that lies on the hull, and connect and • Eliminate the points inside hull, and recursively process for the remaining points. • Performance depends on the distribution of the points, and how a point is selected CS504 Presentation

  15. Quickhull • Analysis • If for some , then the running time will be • Performance depends on the distribution of the points, and how a point is selected CS504 Presentation

  16. Jarvis’s March • Build the hull using “gift wrapping” process CS504 Presentation

  17. Jarvis’s March • Algorithm • Begins with and pick which is known to be on convex hull (e.g. the leftmost point) • Pick the point which minimize the angle between and .(Use polar coordinate system) • Repeat step 2 until . CS504 Presentation

  18. Jarvis’s March • Analysis • Find the point that maximize angle in • Number of vertices on convex hull : • Total time complexity : ⇒ Output-sensitive algorithm CS504 Presentation

  19. Applet • Java applet • http://www.cse.unsw.edu.au/~lambert/java/3d/hull.html • http://www.cs.princeton.edu/courses/archive/spr09/cos226/demo/ah/JarvisMarch.html CS504 Presentation

  20. Chan’s algorithm Jeongho Son CS504 Presentation

  21. Planar Convex Hull • Graham’s Scan : • Jarvis’s March : • Is there any algorithm? CS504 Presentation

  22. Chan’s Algorithm • Chan’s algorithm • combining Graham’s scan and Jarvis’s March together • 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

  23. 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

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

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

  26. Chan’s Algorithm • Stage2 : Graham’s Scan • Compute convex hull of each partition using Graham’s scan • Total time CS504 Presentation

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

  28. Chan’s Algorithm • Stage 2 Using Graham’s Scan for each group -> total = CS504 Presentation

  29. 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

  30. Chan’s Algorithm • (-inf,0) -> lowest pt lowest pt CS504 Presentation

  31. Chan’s Algorithm • Find the point that maximize the angle in each hull 1 lowest pt CS504 Presentation

  32. Chan’s Algorithm • Find the point that maximize the angle in each hull 2 1 lowest pt CS504 Presentation

  33. Chan’s Algorithm • Find the point that maximize the angle in each hull 3 2 1 lowest pt CS504 Presentation

  34. Chan’s Algorithm If , then the algorithm will fail! CS504 Presentation

  35. Chan’s Algorithm • FAIL EXAMPLE – too small value m m = 4 4 iteration CS504 Presentation

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

  37. Chan’s Algorithm • Find the point that maximize the angle in each hull 1 lowest pt CS504 Presentation

  38. Chan’s Algorithm • Find the point that maximize the angle in a hull CS504 Presentation

  39. Chan’s Algorithm • Finding tangent between a point and a convex -gon 5 1 process 4 3 2 CS504 Presentation

  40. Chan’s Algorithm CS504 Presentation

  41. Chan’s Algorithm 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. CS504 Presentation

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

  43. Chan’s Algorithm • Answer : square search • Try this way - • Then we eventually get to be in ! CS504 Presentation

  44. Chan’s Algorithm • The algorithm stops as soon as • Total time complexity CS504 Presentation

  45. Lower bound for convex hull • Reduction from the sorting problem n points in the x-axis CS504 Presentation

  46. Lower bound for convex hull • Reduction from the sorting problem lifting up to 2D plane CS504 Presentation

  47. Lower bound for convex hull • Reduction from the sorting problem lower convex hull CS504 Presentation

  48. Quiz • Show that the convex hull of n points in the plane can be computed in time if each coordinate of each point is a rational number of the form , with bounded values for and . • hint: don’t use comparison-based sort! CS504 Presentation

  49. Quiz • Solution Instead of comparison-based sort, using radix sort And apply Graham’s scan algorithm. CS504 Presentation

  50. Summary • Finding the convex hull of a set of points is an important problem that is often part of a larger problem • Many different algorithms • Graham’s Scan • Quickhull • Divide-and-Conquer • Jarvis’s March • Chan’s algorithm CS504 Presentation

More Related