1 / 23

Computational Geometry

Computational Geometry. Piyush Kumar (Lecture 3: Convexity and Convex hulls). Welcome to CIS5930. p. q. p. convex. non-convex. q. Convexity. A set S is convex if for any pair of points p,q  S we have pq  S. Convex Hulls : Equivalent definitions.

holmes-vang
Download Presentation

Computational Geometry

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. Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930

  2. p q p convex non-convex q Convexity A set S is convex if for any pair of points p,q S we have pq  S.

  3. Convex Hulls : Equivalent definitions • The intersection of all covex sets that contains P • The intersection of all halfspaces that contains P. • The union of all triangles determined by points in P. • All convex combinations of points in P. P here is a set of input points

  4. Convex Hulls • Applications • Collision Detection • Fitting shapes • Shape Approximation • NN-Searching • Useful as a preprocessing step to many other algorithms in computational geometry. • The most ubiquitous structure in computational geometry.

  5. Convex hulls Extreme point Int angle < pi p6 p9 p5 p12 p7 p4 p11 p1 p8 p2 p0 Extreme edge Supports the point set

  6. Convex hull : Representation • We will represent the convex hull by an enumeration of the vertices of the CH(P) in counterclockwise order. • Naïve Algorithm to compute convex hulls can be implemented in O(n3) in the plane (How?) • Anyone with an O(n2) algorithm?

  7. Convex hull • has a lower bound equivalent to sorting • has many similar algorithms to sorting. • We will see today • Graham Scan • Incremental (one point at a time) • D&C • Qhull ( similar to Quick Sort) • Jarvis March • Chan’s Algorithm

  8. Assignments for next week • Notes of Dr. Mount: Upto Page 20 • D&C notes • Assignment2.cpp and ch_2.cpp • Will talk more about it towards the end of class.

  9. Today (Jan 24th) • Chan’s Algorithm • Line Segment intersection • Homeworks / Projects

  10. Line Segment Intersection • Applications • VLSI (Intel uses it a lot) • Map Overlay • Clipping in Graphics • CSG • Problem : Given a set of line segments in the plane, compute all the intersection point.

  11. Line Segment Intersection • Lower Bound from EU • EU : Given a list of n numbers, are all these numbers unique? [Y / N]? • Lower bound is Ω(nlogn) • How do we use this fact to prove a Ω(nlogn) on Line segment intersection problem? • Does this imply a lower bound of Ω(nlogn+k)? • Tell me a naïve algorithm to solve this problem.

  12. Line Segment intersection • Naïve O(n^2) • Bentley Ottman O((n+k)log n) • Edelsbrunner Chazeele 92 • O(nlogn +k) : Supercomplicated O(nlogn) space • Clarkson and Shor • O(nlogn +k) Randmized O(n) space • Balaban : Deterministic O(nlogn + k) in O(n space. Solved a long open problem.

  13. Segment Intersection • How do we intersect two segments? • How do we implement such a primitive? CG FAQ 1.3 • Any special cases?

  14. Today ( Jan 26th) • Line Segment intersection Algorithm • Project discussion • Polygons

  15. Line Segment intersection • Sweep line paradigm • Main idea is to sweep the entire plane with a line and compute what we want to , as we sweep past the input. • Event scheduling and updates • Carefully schedule the computation so that it does not take too much time to compute the output.

  16. Line Segment Intersection • A Sorted sequence data structure • Insert • Delete • Successor/Predecessor • All in O(log n) • X-structure (or the event queue) • Y-structure (or the sweep line)

  17. Plane Sweep Paradigm • Initialization: • Add all segment endpoints to the X-structure or event queue (O(nlog n)). • Sweep line status is empty. • Algorithm proceeds by inserting and deleting discrete events from the queue until it is empty.

  18. Useful lemma • Given s1,s2 intersecting in p, there is a placement of the sweepline prior to this event such that s1,s2 are adjacent along the sweepline. • Just before an intersection occurs, the two relevant segments are adjacent to each other in the sweep line status.

  19. Plane Sweep • Event A: Segment left endpoint • Insert segment in sweep line or the Y-structure. • Test for intersection to the right of the sweep line with the segments immediately above and below it. Insert intersection points (if found) into X-structure or event queue. • Complexity: ? Worst case?

  20. Plane Sweep – Algorithm • Event B: Segment right endpoint • Delete segment from sweep line status. • Test for intersection to the right of the sweep line between the segments immediately above and below. (can you do any optimization for this case? ) Insert point (if found) into event queue. • Complexity: ?

  21. Plane Sweep – Algorithm • Event C: Intersection point • Report the point. • Swap the two line relevant segments in the sweep line status. • For the new upper segment – test it against its predecessor for an intersection. Insert point (if found) into event queue. • Similar for new lower segment (with successor). • Complexity: O(klogn)

  22. The Simplified Algorithm • Construct the X-structure • scan thru the X-structure (or the event queue) from left to right processing: • Segment Left endpoint • Segment right endpoint • Intersection points

  23. Polygons • Definition of a simple polygon • Point containment in simple polygon • Area of a simple polygon • Triangulation of a simple polygon • Convex hull of a simple polygon • Fast preprocessing of a convex polygon to do in/out queries.

More Related