1 / 23

CSE 4101/5101

CSE 4101/5101. Prof. Andy Mirzaian. Polygon Triangulation. References:. [M. de Berge et al ’00] chapter 3 [Preparata-Shamos’85] chapter 6 [O’Rourke’98] chapter 1. Applications : Graphics: Ray Shooting Robotics: Geodesic Shortest Paths inside polygon, visibility

giolla
Download Presentation

CSE 4101/5101

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. CSE 4101/5101 Prof. Andy Mirzaian Polygon Triangulation

  2. References: • [M. de Berge et al ’00] chapter 3 • [Preparata-Shamos’85] chapter 6 • [O’Rourke’98] chapter 1 Applications: • Graphics: Ray Shooting • Robotics: Geodesic Shortest Paths inside polygon, visibility • GIS: Planar Point Location • GIS: Elevation estimate on polyhedral terrain • GIS: Piece-wise linear interpolation of bi-variate function f(x,y). • . . .

  3. Polygon Triangulation Guarding and Art Gallery

  4. Art Gallery Problem [Victor Klee 1973] How many camera guards do we need to guard a given gallery and how do we decide where to place them? • It’s NP-hard to determine the MINIMUM number of camera guards for an arbitrary given simple polygon [Aggarwal 1984]. • Let P be an n-vertex simple polygon. • If P is convex, then a single guard anywhere inside P is sufficient. • n guards for P are always sufficient; one guard at each vertex.[This does not work for 3D polytopes!] • Can we use less than n guards? Yes. Use Triangulation of P.

  5. A simple polygon P

  6. A triangulation of P

  7. Dual Tree of the Triangulation

  8. Proof: Let x be any convex vertex of the polygon (e.g., an extreme vertex, say, the lowest-leftmost). (case a) yz is a diagonal (case b) xw is a diagonal y y x x w z z max [Shaded triangle does not contain any vertex of the polygon] Diagonalof a simple polygon P: Any line-segment between two non-adjacent vertices of P that is completely inside P. yes no LEMMA 1Any simple n-gon with n>3 admits at least one diagonal. Such a diagonal can be found in O(n) time.

  9. Proof: By induction on n.Basis (n=3): Obvious.Ind. Step (n>3): By previous Lemma, a diagonal d of P exists and can be found inO(n) time, and divides P into simple polygons P1 & P2 with, say, n1 & n2 vertices, where d is an edge of both. Note, n = n1+n2 -2.Triangulations T1 & T2 of P1 & P2 can be obtained recursively. Now set T = T1T2 with d as an extra diagonal. Total computation time: Time(n) = Time(n1) + Time(n2) + O(n) = O(n2).By induction hypothesis: T1 has n1–3 diagonals and n1–2 triangles, T2 has n2–3 diagonals and n2–2 triangles, These imply: T has n–3 diagonals and n–2 triangles. d P2 P1 P THEOREM 2Any simple n-gon P admits at least one Triangulation. Such a triangulation T can be computed in O(n2) time. Any such triangulation has n-3 diagonals, and n-2 triangles.

  10. Proof: Necessity: B R=4B=3G=4 G R R G R B G B R G THEOREM 3[Chvătal 1975, Fisk 1978] n/3 guards are always sufficient and sometimes necessary to guard any simple n-gon. Sufficiency: • T = a triangulation of the n-gon. • 3-colour vertices of T (so that the vertices of each triangle get 3 different colours).This can be done (implicitly) by a DFS traversal on the dual tree of T. • Choose a colour least often used (break ties arbitrarily). • Place a guard at the vertices of the chosen colour. (Each triangle has a guard.)

  11. Geodesic Shortest Paths inside polygon

  12. Geodesic Shortest Paths inside polygon A B A shortest path: Walk along the path of the dual tree from triangle of A to B.

  13. Geodesic Shortest Paths inside polygon source Single-source shortest paths: Do a DFS on dual tree of the triangulation and maintain the visibility funnel for the frontier diagonal.

  14. Geodesic Shortest Paths inside polygon source Single-source shortest paths

  15. Geodesic Shortest Paths inside polygon source Single-source shortest paths

  16. Simple Polygon Triangulation Algorithms O(n2) time See Theorem 2. Also by “ear removal”, Lennes 1911. O(n log n) Garey-Johnson-Preparata-Tarjan (plane sweep) 1978. O(n log log n) Tarjan-van Wyk (balanced-cut & Jordan-sort) 1986-88. O(n log* n) randomized Clarkson-Tarjan-van Wyk 1989. O(n) Chazelle 1991. [Complicated. Can it be simplified?] O(n) randomized Amato-Goodrich-Ramos 2000. [1]

  17. If you do a DFS of the non-tree dual graph, you get a DFS tree, plus h back-edges. How can you deal with these back-edges that would correspond to opening corridors? THEOREM 4[Art Gallery Theorem for polygons with holes] A polygon P with h polygonal holes and n vertices (including vertices of the holes)can be guarded with (n+2h)/3 guards. Proof: Triangulate P. Dual graph is not a tree.Use h of the diagonals to connect the holes and the outer boundary of P. Double-up these h diagonals to open up narrow corridors.We now have a simple polygon with n+2h vertices. Now apply Theorem 3.

  18. Exercises

  19. Give a simple linear time algorithm to triangulate any given star polygon.Assume a kernel point of the polygon is available. • Guarding the walls: Construct a simple polygon P and a placement of guards such that the guards see every point of the boundary of P, but there is at least one point interior to P not seen by any guard. • Visibility: Consider an arbitrary simple polygon P. Two points a and b in P (i.e., in the interior or boundary of P) are visible from each other if the line-segment ab does not intersect the exterior of P.(a)Prove or disprove: Let v be any point in P such that every vertex of P is visible from v. Then every point in P is also visible from v. (b) Prove or disprove: Let v and w be any pair of points in P such that every vertex of P is visible from v or w. Then every point in P is also visible from v or w. • Suppose that a simple polygon P with n vertices is given, together with a set of diagonals that partition P into convex quadrilaterals. How many point guards are sufficient to guard the interior of P? Why doesn't this contradict the Art Gallery Theorem 3? • Balanced Split: Let P be any simple polygon with n vertices. A diagonal d of P is said to be a balanced diagonal, if it splits P into two simple polygons, each with at most 2n/3 + 1 vertices.(a) Show that any simple polygon has a balanced diagonal.(b) Show the bound 2n/3 + 1 is tight, i.e., for every n>2, there are simple n-gons that have no diagonal that splits the polygon with both sides containing less than 2n/3 + 1 vertices each. (c) Give an O(n log n) time algorithm to find a balanced diagonal of P. [Hint: Use the dual graph of a triangulation. This has applications in divide-&-conquer algorithms.]

  20. Polygon Area: Prove the following fact about the algebraic area of a simple polygon as stated in Lecture Slide 10: • Polygon Triangulation by Horn Cutting:We are given a simple n-gon P = [ p0 , p1, ..., pn-1]. We want to find a triangulation T(P) of P by a horn-cutting method. A horn of P is any vertex pi of P, such that (the interior of) P contains (the interior of) triangle (pi-1 , pi , pi+1) formed by pi and its two neighboring vertices pi-1 and pi+1 (index arithmetic is done mod n). We can cut this horn by removing vertex pi from the sequence of polygon vertices, resulting in a sub-polygon P' with n-1 vertices. The line-segment (pi-1 pi+1) now becomes an edge of the new polygon P'. We say we have cut the horn pi (or the horn-triangle (pi-1 , pi , pi+1) ) from the simple polygon P.(a) Argue that the sub-polygon P' that results from cutting a horn of P is itself a simple polygon (i.e., it has a non-self-crossing boundary).(b) Prove that any simple polygon P with n > 3 vertices has at least two horn vertices that are non-adjacent.(c) Algorithmically show how in O(n) time we can test whether a given vertex pi is a horn of P.(d) Design and analyze an O(n2) time algorithm to compute a triangulation T(P) of simple polygon P by an iterative horn-cutting process.

  21. a a flip D D’ c c D d d b b • Diagonal Flip in Polygon Triangulation: Let P be a simple polygon with n vertices and T a triangulation of P. Consider a diagonal D=(a,b), incident to two triangles (a,b,c) and (a,b,d) in T. The union of these two triangles is the quadrangle (a,c,b,d). If this quadrangle is convex, then we can flip D to obtain the new diagonal D’=(c,d). This creates a new triangulation T’ where the two triangles (a,b,c) and (a,b,d) are replaced by the two new triangles (c,d,a) and (c,d,b). (See the figure below.). Note that flipping is reversible, i.e., you can go from T’ back to T by flipping D’.Let T and T’ be two arbitrary triangulations of P. We say T is flip-connected to T’, if there is a sequence of zero or more diagonal flips that transforms T to T’. Let the flip-distance, denoted FD(T,T’), be the minimum number of flips required to transform T to T’. FD(T,T’) = if T and T’ are not flip-connected. Flip-connectivity is an equivalence relation on the set of triangulations of P. So, it partitions the set into equivalence classes. (Can there be more than one equivalence class?)(a) Show that if P is a convex polygon, then T,T’, FD(T,T’) = O(n).(b) What if P is a simple polygon? Can there be a pair T, T’ such that FD(T,T’) =? Why or why not? If not, then derive a tight asymptotic upper-bound on FD(T,T’) over all triangulation pairs T and T’ of P.

  22. a b • Geodesic in a Simple Polygon: The following problem has a number of applications including robot path planning.We are given a simple n-gon P and a triangulation T of P. The triangulation is given by its list of triangles, and their incidence relationship, where two triangles are incident iff they share a common diagonal. We are also given two points a and b inside P. The problem is to find the shortest path from a to b inside P. Such a path is called the geodesic between a and b inside P (see the figure below). Design and analyze an O(n)-time algorithm to solve this problem. [Hint: after locating the triangles that contain a and b, "walk" along the triangles from a to b (which way?), while maintaining the two shortest paths from a to the two ends of the next diagonal on the walk. These two shortest paths form a funnel that encloses a prefix of the final geodesic. Carefully analyze how you update the funnel as you advance from one diagonal to the next on your "walk".]

  23. END

More Related