1 / 19

Convex Hull A lgorithms

Convex Hull A lgorithms. What is the convex hull problem?. Definition: Given a set of points, find the sub set of points that makes up the convex hull polygon of the given points. What is a Convex hull polygon?. The smallest convex polygon that can contain all the given points.

rock
Download Presentation

Convex Hull A lgorithms

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. Convex Hull Algorithms

  2. What is the convex hull problem? • Definition: • Given a set of points, find the sub set of points that makes up the convex hull polygon of the given points

  3. What is a Convex hull polygon? The smallest convex polygon that can contain all the given points. (Informal Definition) The polygon or shape that will be formed if a rubber band is stretched and released around a bunch of pins.

  4. Three Convex hull Algorithms • Divide and Conquer • Quick Hull • Gift Wrap or Jarvis's march

  5. Background Math Concepts • Cross Products • Perpendicular distance between a line and point

  6. Cross Product A binary operation carried out on two vectors. It is represented by an “X” symbol A X B = |A||B| sin(θ) B A Cross Product also gives the area of a parallelogram whose edges are defined by the two vectors B A

  7. Useful properties of the cross product B A A X B = 0 B B A A CCW CW B X A < 0 A X B > 0

  8. Position of points relative to line Given three points: P1, P2, and P3 P3 B , ) B P1 A P2 A , ) • If A X B > 0 • then P3 is to the left of the line formed by P1 and P2 • If A X B < 0 • then P3 is to the right of the line formed by P1 and P2 • If A X B = 0 • then P3 lies on the line formed by P1 and P2

  9. Perpendicular distance from point to line P3 d P2 B A P1 d

  10. Divide and Conquer • Same idea as the merge sort algorithm • Sort the points using the x values • Divide the points into smaller chunks that you can handle ( 3 or less points) • Then merge the individual sub convex hulls • O (n log n)

  11. How do you merge? Given the two polygons below: • Find a point such that every other point in the polygon is below/above. • Special case for duplicates 2 • Remove all points in-between 1

  12. Quick Hull • First pick the extreme points that are guaranteed to be part of the convex hull polygon • Then recursive pick the point with the farthest perpendicular distance from the produced line until there are no points to pick • O (n log n)

  13. Gift Wrap or Jarvis's march • Pick the lowest point • Draw a vector with every other point and pick the point such that every other point lies above the vector • Make this point your next point and continue till you reach the start point • O ()

  14. C++ Implementation Demo

  15. Applications of convex hull algorithms • Computer visualization, ray tracing • (e.g. video games, replacement of bounding boxes) • Path finding • (e.g. embedded AI of Mars mission rovers) • Geographical Information Systems (GIS) • (e.g. computing accessibility maps) • Visual pattern matching • (e.g. detecting car license plates) • Verification methods • (e.g. bounding of Number Decision Diagrams) • Geometry • (e.g. diameter computation)

  16. Questions

More Related