AMS 345/CSE 355 Computational Geometry

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Polygon Triangulation
UNC Chapel Hill Lin/Foskey/Manocha Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses.
Computational Geometry
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Triangulation (Naive)
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
By Groysman Maxim. Let S be a set of sites in the plane. Each point in the plane is influenced by each point of S. We would like to decompose the plane.
Feb Polygon Triangulation Shmuel Wimer Bar Ilan Univ., School of Engineering.
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Lecture 2 Polygon Partitioning Thursday,
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
Computational Geometry -- Voronoi Diagram
Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses in a matrix chain multiplication (A.
3. Delaunay triangulation
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
By Dor Lahav. Overview Straight Skeletons Convex Polygons Constrained Voronoi diagrams and Delauney triangulations.
On the Union of Cylinders in Esther Ezra Duke University On the Union of Cylinders in  3 Esther Ezra Duke University.
Computational Geometry Seminar Lecture 1
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Lecture 2 Chapter 2: Polygon Partitioning.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Voronoi Diagrams.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 2 Chapter 2: Polygon Partitioning.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Introduction Outline The Problem Domain Network Design Spanning Trees Steiner Trees Triangulation Technique Spanners Spanners Application Simple Greedy.
Art Gallery Theorem Computational Geometry, WS 2006/07 Lecture 8, Part 1 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 2 Chapter 2: Polygon Partitioning.
Curve Curve: The image of a continous map from [0,1] to R 2. Polygonal curve: A curve composed of finitely many line segments. Polygonal u,v-curve: A polygonal.
The Art Gallery Problem
Brute-Force Triangulation
The Art Gallery Problem
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
Triangulating a monotone polygon
Vertex – A point at which two or more edges meet Edge – A line segment at which two faces intersect Face – A flat surface Vertices, Edges, Faces.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
RA PRESENTATION Sublinear Geometric Algorithms B 張譽馨 B 汪牧君 B 李元翔.
An Introduction to Computational Geometry Joseph S. B. Mitchell Stony Brook University.
CENG 789 – Digital Geometry Processing 02- Polygons and Triangulations Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.
1 Triangulation Supplemental From O’Rourke (Chs. 1&2) Fall 2005.
Computational Geometry Polygon Triangulation and The Art Gallery Problem Joachim Gudmundsson NICTA, Sydney.
Computational Geometry: Intersection Search Joseph S. B. Mitchell Stony Brook University.
1 11. Polygons Polygons 2D polygons ( 다각형 ) –Polygon sides are all straight lines lying in the same plane 3D polyhedra ( 다면체 )  chap. 12 –Polyhedra.
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
An Introduction to Computational Geometry Joseph S. B. Mitchell Stony Brook University.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
Contest Algorithms January 2016 Triangulation & the Art Gallery Problem Contest Algorithms1.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
An Introduction to Computational Geometry: Arrangements and Duality Joseph S. B. Mitchell Stony Brook University Some images from [O’Rourke, Computational.
Polygon Triangulation
Computational Geometry
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
CENG 789 – Digital Geometry Processing 02- Polygons and Triangulations
Advanced Algorithms Analysis and Design
The Art Gallery Problem
The Art Gallery Problem
Polygon Triangulation
I. The Problem of Molding
Computational Geometry
Presentation transcript:

AMS 345/CSE 355 Computational Geometry Triangulation Algorithms Joe Mitchell Some figures: [O’Rourke]: Computational Geometry in C: Chap 2

Triangulation Input: Set S of n points Input: Other shapes 3D: Surfaces and solids (tetrahedralization) Simple polygon Planar Straight-Line Graph (PSLG) Polygon with holes Triangulation applet for simple polygons

Simple Polygons Definition: A simple polygon P is the (closed) region bounded by a “simple closed polygonal curve”.

Simple Polygon Definition in [O’Rourke]:

Simple Polygons Alternate Definition: P is a simple polygon if it is a simply connected (i.e., no “holes”) subset of the plane whose boundary consists of a connected finite union of straight line segments.

Simple Polygons Some definitions would allow this as a “degenerate” simple polygon

Definitions: Visibility, Diagonals For p,q in P, p is visible to q if segment pq lies within (closed) P p q

Definitions: Visibility, Diagonals For p,q in P, p is visible to q if segment pq lies within (closed) P p is clearly visible to q if p is visible to q AND the only points in common between pq and P are possibly p and q p clearly sees q but does not clearly see q’ p sees q’ p q q’

Definitions: Visibility, Diagonals vivj is a diagonal if vi and vj are vertices that clearly see each other (versus: chord pq, with p and q on the boundary of P) q vm vj p vi pq is a chord (not a diagonal) vivj is a diagonal vkvm is not a diagonal vk

Diagonals [Devadoss-O’Rourke]

Triangulation Definition: A partition of P into triangles by a set of noncrossing diagonals. (= a partition of P by a maximal set of noncrossing diagonals) [Devadoss-O’Rourke]

Triangulation Theory in 2D Thm: A simple polygon has a triangulation. Lem: An n-gon with n4 has a diagonal. Thm: Any triangulation of a simple n-gon has n-3 diagonals, n-2 triangles. Thm: The “dual” graph is a tree. Thm: An n-gon with n4 has 2 “ears”. Thm: The triangulation graph can be 3-colored. Also with holes But, NOT true in 3D! Proofs: Induction on n.

Ears A diagonal of the form vi-1vi+1 is an ear diagonal; the triangle vi-1vivi+1 is an ear, and vi is the ear tip Note that there are at most n ears (and that a convex polygon has exactly n ears) vi-1 vi+1 vi

Ears [Devadoss-O’Rourke] Proof(1): There are n edges of P and n-2 triangles in any triangulation. Imagine dropping the n edges into the n-2 “pigeonholes” corresponding to the triangles: Each edge appears on boundary of some triangle. By pigeonhole principle, at least 2 triangles get 2 edges “dropped in their box”. (2) Consider the planar dual (excluding the face at infinity) of a triangulation of P. Claim: The dual graph for a triangulated simple polygon is a TREE. Any tree of 2 or more nodes has at least 2 nodes of degree 1.

Triangulating a Simple Polygon Simple “ear-clipping” methods: O(n2 ) Cases with simple O(n) algorithms: Convex polygons (trivial!) Monotone polygons, monotone mountains General case (even with holes!): Sweep algorithm to decompose into monotone mountains O(n log n) Best theoretical results: Simple polygons: O(n) [Chazelle’90] Polygons with h holes: O(n+h log1+ h), (n+h log h) [BC] Good practical method: FIST [Held], based on clever methods of ear clipping (worst-case O(n2 ) ) fan Not practical!

Lower Bound (n+h log h) (n) : Have to read the data (h log h) : from SORTING

FIST: Fast Industrial-Strength Triangulation Based on ear clipping Simple polygon FIST Constrained Delaunay Works nicely also for highly degenerate and “crazy” polygons Completed through here 2/19/13 http://www.cosy.sbg.ac.at/~held/projects/triang/triang.html 3D cycles

Ear-Clipping Triangulation Input: Simple polygon P vi-1 vi+1 vi pq is a diagonal, cutting off a single triangle (the “ear”) Got to here, 9/19/13 Naive: O(n3) Smarter: Keep track of “ear tip status” of each vi (initialize: O(n2) ) Each ear clip requires O(1) ear tip tests ( @ O(n) per test ) Thus, O(n2) total, worst-case Ear-clipping applet

Triangulate

Ear-Clipping Lemma: When clipping ear wth tip vi the only ear tip statuses that can change are at vi-1 and vi+1

Example: Triangulate

Example: Output

W(n2 ) Examples Exist

Today, 9/26/13 Review: O(n log n) triangulation Examples Primitives: Left test, etc Time permitting: Convex decompositions, Hertel-Mehlhorn

Faster Algorithm: O(n log n) Input: PSLG of size n; enclosed by a big box B Step 1: Use sweep to decompose B into “y-monotone mountains” – y-monotone polygons having one side (left/right) a single segment (the “base”); O(n log n) Step 2: Triangulate each y-monotone polygon (size ni ) in time O(ni), for total O(n) Overall: O(n log n) to triangulate PSLG

Monotone Polygons P is monotone in direction d t d b Every line perpendicular to d intersects P in a connected set; i.e., the left/right chains from bottom, b, to top, t, are each d-monotone. b

Monotone Polygons P is monotone in direction d d

y-Monotone Polygon d

Examples Which of these polygons are monotone? (with respect to which directions d?) Which are monotone mountains? With respect to which directions d?

Examples Circle of directions of monotonicity, d

Example from Practice Midterm

y-Monotone Polygon d

Monotone Mountains t d b

Triangulating a Monotone Mountain in O(n) Ear clipping is easy! Testing if vi-1 vi+1 is a diagonal takes only O(1) time t vi-1 vi vi+1 vi is ear tip iff Left(vi+1 , vi , vi-1 ) Just traverse vertices from top to bottom. Test/clip ears. If an ear is clipped, re-test the earity of the upper endpoint (vi-1 ) of the diagonal just clipped. monotone b

Triangulating a Monotone Mountain in O(n)

Example

Triangulation in O(n log n) (1) Plane sweep to get horizontal trapezoidalization L Fire bullets left/right from each vertex SLS: left-to-right ordering of segments crossed by L (balanced binary tree) Events: L hits a vertex Time: O(n log n)

Sweep Algorithms Paradigm: Process geometric data by “sweeping” over it, in some order

Sweep Algorithms Two key ingredients of any sweep algorithm: (1) The “Sweep Line Status” (SLS): gives a “combinatorial description” of the “slice” given by the sweeping line Often stored in a balanced binary tree (2) Events: These are instants when the SLS “changes” combinatorially, and we must pause and do some event handling. Store in “Event Queue” (EQ), often a “priority queue” that allows us to quickly determine the next event Often events occur at certain discrete points/vertices of the input; EQ is sometimes “static” (events known in advance), sometimes “dynamic” (events learned as we go)

Sweep Algorithms What is needed to describe a sweep algorithm: What is being “swept”? (line, plane, curve, etc) And how is it “sweeping”? (“order”?) What exactly does the SLS store, and in what kind of data structure is it stored (to provide for efficient updates as it changes)? Exactly what are the “events”? How are they stored (the Event Queue, EQ)? How are they handled? Usually there are various cases, and one must specify for each exactly what updates are made to the SLS and the EQ (if any).

Trapezoidalization

Trapezoidalization

Trapezoidalization In each case: We do O(1) updates to the SLS, each taking time O(log n), since the SLS is stored in a balanced binary search tree.

Trapezoidalization

Triangulation in O(n log n) (2) Join top vertex to bottom vertex in each trapezoid Lemma: Resulting pieces are monotone mountains

Triangulation in O(n log n) (3) Triangulate each monotone mountain Triangulate each, in time O(ni ), for total time O(n) Summary: O(n log n) to triangulate n points or a planar straight-line graph (PSLG)

Bottom Line: Triangulation in 2D Best theoretical results: Simple polygons: O(n) [Chazelle’90] Polygons with h holes: O(n+h log1+ h), (n+h log h) [BC] PSLG: for each simple face (without holes), O(ni); for each face with holes, O(ni+hi log1+ hi) Good practical method: FIST [Held], based on clever methods of ear clipping (worst-case O(n2 ))

Convex Decomposition Partition simple polygon P into a small number of convex pieces One way to do it: Triangulate P

Convex Decomposition Partition simple polygon P into a small number of convex pieces Another way to do it: Use diagonals to partition P into convex polygons

Convex Decomposition Partition simple polygon P into a small number of convex pieces Another way to do it: Allow “Steiner” points (non-vertices) inside P. May get fewer pieces!

Convex Decomposition Goal: Partition P into a small number of convex pieces (convex polygons) A triangulation is one possible decomposition into convex pieces, but it may have many more pieces than necessary! Dynamic Programming algorithms yield optimal solutions for simple polygons (for both Steiner and non-Steiner versions), in roughly O(n3) Hertel-Mehlhorn algorithm: 4-approximation in time O(n) O(r2n log n) without Steiner [Keil’85]; O(n+r3) allowing Steiner [Chazelle’80]

Convex Decomposition

Convex Decomposition

Optimal Convex Decomposition Allowing Steiner points

Convex Decomposition r=6

Convex Decomposition One diagonal “resolves” the local nonconvexities at 2 reflex vertices at once r=6 We need at least r/2 segments to resolve all r reflex vertices Results in at least ceil(r/2)+1 pieces

Hertel-Mehlhorn Algorithm Start with any triangulation of simple polygon P (time O(n), [Chazelle]) Remove inessential diagonals, in any order (time O(n), since we can test a diagonal locally in time O(1) to see if it is essential; if we remove a diagonal, we only have to update the “inessential” flag of O(1) other diagonals)

Hertel-Mehlhorn Algorithm Lemma 2.5.2: At the end of the algorithm, for each reflex vertex v, there can be at most 2 diagonals essential for v

Hertel-Mehlhorn Algorithm Theorem 2.5.3: The H-M algorithm yields a decomposition into at most 4*OPT pieces, where OPT is the minimum possible number of convex pieces in a (Steiner) convex decomposition. We say that the H-M Algorithm is a “4-approximation algorithm” OPEN: Find a better factor than 4, which still runs very efficiently (say, in O(n log n) or O(n) time).

Hertel-Mehlhorn Algorithm Proof: At end, each diagonal is essential for some (reflex) vertex. By Lemma 2.5.2, there are at most 2r diagonals left (since each reflex vertex is “responsible” for at most 2 diagonals) Thus, the number, M, of pieces is ≤ 2r+1 < 2r+4 ≤ 4*OPT (Since, by Theorem 2.5.1, OPT ≥ ceil(r/2)+1, so 4*OPT ≥4*ceil(r/2)+4≥2r+4)

H-M Algorithm: Example

Minimum-Weight Triangulation MWT of a simple polygon: O(n3), using dynamic programming MWT of a polygon with holes (or of a set of points in the plane) is NP-hard Min-Weight Steiner Triangulation: allow extra “Steiner” points to be added Not known to exist 316-approximation known AMS 545 / CSE 555

AMS 545 / CSE 555 MWT in Simple Polygon Dynamic Programming Bellman equation: Let f(i,j) be the total length of diagonals in a min-weight triangulation in the simple polygon left of diagonal (i,j). f(i,j) = 0, if (i,j) is ear diagonal; else, f(i,j)=mink:k sees i,j [|ik|+|kj|+f(i,k)+f(k,j)] AMS 545 / CSE 555 k i Time O(n3) j

Related Optimizations Using DP Min-max diagonal triangulation of P Max-min diagonal Min-max area triangle Max-min area triangle Max-min angle Min-max angle Fewest-guards-by-Fisk-method etc AMS 545 / CSE 555