UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Lecture 2 Polygon Partitioning Thursday,

Slides:



Advertisements
Similar presentations
Polygon Triangulation
Advertisements

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.
Convex Hull obstacle start end Convex Hull Convex Hull
C o m p u t i n g C O N V E X H U L L S by Kok Lim Low 10 Nov 1998 COMP Presentation.
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.
1 Voronoi Diagrams. 2 Voronoi Diagram Input: A set of points locations (sites) in the plane.Input: A set of points locations (sites) in the plane. Output:
The Divide-and-Conquer Strategy
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
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.
Classes of Polygons Planar polygons Non-planar polygons Simple
Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,
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.
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
K-structure, Separating Chain, Gap Tree, and Layered DAG Presented by Dave Tahmoush.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 l-Monotone Convex polygons are easy to triangulate. Unfortunately the partition.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 O’Rourke Chapter 7 Search & Intersection.
UMass Lowell Computer Science Graduate Algorithms Prof. Karen Daniels Spring, 2005 Computational Geometry Overview from Cormen, et al. Chapter 33.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Chapter 5: Voronoi Diagrams Wednesday,
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 5: Voronoi Diagrams Monday, 2/23/04.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Chapter 4: 3D Convex Hulls Friday, 2/9/07.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 4 Tuesday, 10/2/01 Graph Algorithms: Part 2 Network.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Lecture 2 Chapter 2: Polygon Partitioning.
Computational Geometry Overview from Cormen, et al. Chapter 33
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2002 Tuesday, 5/7/02 Computational Geometry Chapter 33.
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Computing the Delaunay Triangulation By Nacha Chavez Math 870 Computational Geometry; Ch.9; de Berg, van Kreveld, Overmars, Schwarzkopf By Nacha Chavez.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 2 Chapter 2: Polygon Partitioning.
UMass Lowell Computer Science Graduate Algorithms Prof. Karen Daniels Spring, 2009 Computational Geometry Overview from Cormen, et al. Chapter 33.
Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O(n log 2 n) Time MATHEMATICAL SCIENCES COLLOQUIUM Prof. Karen Daniels Wednesday, October.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 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.
Brute-Force Triangulation
Computational Geometry Piyush Kumar (Lecture 4: Planar Graphs, Polygons and Art Gallery) Welcome to CIS5930.
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.
AMS 345/CSE 355 Computational Geometry
Triangulating a monotone polygon
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 O’Rourke Chapter 7 Search & Intersection.
C o m p u t i n g C O N V E X H U L L S. Presentation Outline 2D Convex Hulls –Definitions and Properties –Approaches: Brute Force Gift Wrapping QuickHull.
1 Triangulation Supplemental From O’Rourke (Chs. 1&2) Fall 2005.
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
February 17, 2005Lecture 6: Point Location Point Location (most slides by Sergi Elizalde and David Pritchard)
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 O’Rourke Chapter 6 with some material.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
Polygon Triangulation
Computational Geometry
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Computational Geometry
Introduction to Spatial Computing CSE 555
Introduction to Polygons
Query Processing in Databases Dr. M. Gavrilova
Algorithm design techniques Dr. M. Gavrilova
Computational Geometry Capter:1-2.1
Polygon Triangulation
I. The Problem of Molding
Presentation transcript:

UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Lecture 2 Polygon Partitioning Thursday, 2/4/10 based on textbooks Computational Geometry in C by Joseph O’Rourke and Computational Geometry by de Berg et al.

O’Rourke Chapter 2 & de Berg et al. Chapter 3 Polygon Partitioning useful for triangulations and many other applications!

Some Approaches to Polygon Triangulation O(n 2 ): O’Rourke Ch. 1: Ear removal O(n 2 ): O’Rourke Ch. 1: Ear removal O(nlgn): O(nlgn): Using monotonicity: (see next slide for definition) Using monotonicity: (see next slide for definition) Partition polygon into monotone pieces, then quickly triangulate monotone pieces: Partition polygon into monotone pieces, then quickly triangulate monotone pieces: deBerg et al.: deBerg et al.: O(nlgn): Create y-monotone pieces using diagonals (p.49-55) (CGAL) O(nlgn): Create y-monotone pieces using diagonals (p.49-55) (CGAL) O(n): To triangulate a single y-monotone piece (p.55-58) O(n): To triangulate a single y-monotone piece (p.55-58) O’Rourke Chapter 2, Approach 1: O’Rourke Chapter 2, Approach 1: O(nlgn): Create y-monotone pieces using plane sweep to trapezoidalize (p ) O(nlgn): Create y-monotone pieces using plane sweep to trapezoidalize (p ) O(n): To triangulate a single y-monotone piece (as in deBerg et al.) O(n): To triangulate a single y-monotone piece (as in deBerg et al.) O’Rourke Chapter 2, Approach 2: O’Rourke Chapter 2, Approach 2: O(nlgn): Create monotone mountains using plane sweep to trapezoidalize O(nlgn): Create monotone mountains using plane sweep to trapezoidalize Trapezoidalize (p ) Trapezoidalize (p ) Add diagonals to convert trapezoidalization into set of monotone mountains. Add diagonals to convert trapezoidalization into set of monotone mountains. O(n): To triangulate a single monotone mountain (p ) O(n): To triangulate a single monotone mountain (p ) O(nlg*n) Expected time: Seidel Randomized Triangulation O(nlg*n) Expected time: Seidel Randomized Triangulation Trapezoidalize, monotone mountain, triangulate pieces Trapezoidalize, monotone mountain, triangulate pieces Constrained Delaunay triangulation (CGAL) (Delaunay triangulation to be studied later…) Constrained Delaunay triangulation (CGAL) (Delaunay triangulation to be studied later…) O(n): Chazelle (see paper) O(n): Chazelle (see paper) Recall from Cormen et al.:

Monotone Partitioning A chain is monotone with respect to a line L if every line orthogonal to L intersects the chain in at most 1 point A chain is monotone with respect to a line L if every line orthogonal to L intersects the chain in at most 1 point P is monotone with respect to a line L if boundary of P can be split into 2 polygonal chains A and B such that each chain is monotone with respect to L P is monotone with respect to a line L if boundary of P can be split into 2 polygonal chains A and B such that each chain is monotone with respect to L Monotonicity implies sorted order with respect to L Monotonicity implies sorted order with respect to L Polygon is monotone if it is monotone in neighborhood of every vertex Polygon is monotone if it is monotone in neighborhood of every vertex Absence of interior cusps guarantees y-monotonicity Absence of interior cusps guarantees y-monotonicity Monotone polygon can be (greedily) triangulated in O(n) time Monotone polygon can be (greedily) triangulated in O(n) time deBerg et al. (see next 2 slides) deBerg et al. (see next 2 slides)

Triangulating a Monotone Polygon in Linear Time (de Berg et al.) Doubly-connected edge list: see p of de Berg et al. 3 collections of records: vertices, faces, half-edges.

Triangulating a Monotone Polygon in Linear Time (de Berg et al.) 2 cases when next vertex is on same side as reflex vertices on stack

Partitioning a Polygon into Monotone Pieces in O(nlgn) Time (de Berg et al.) Using downward sweep, insert diagonals to eliminate “turn” vertices: -“start” (convex downwards) -“split” (reflex downwards) - “end” (convex upwards) -“merge” (reflex upwards) Add diagonal upward from each split vertex & diagonal downward from each merge vertex.

Partitioning a Polygon into Monotone Pieces in O(nlgn) Time (de Berg et al.) Using downward sweep, insert diagonals to eliminate “turn” vertices: -“start” (convex downwards) -“split” (reflex downwards) - “end” (convex upwards) -“merge” (reflex upwards) Add diagonal upward from each split vertex v i. Add diagonal downward from each merge vertex v i. Implemented in CGAL: function y_monotone_partition_2

Trapezoidalization (O’Rourke) Partition into trapezoidsPartition into trapezoids Horizontal line through each vertexHorizontal line through each vertex Diagonal of each interior cusp with each “supporting” vertex yields monotone partitionDiagonal of each interior cusp with each “supporting” vertex yields monotone partition To trapezoidalize, vertically sweep horizontal line LTo trapezoidalize, vertically sweep horizontal line L presort vertices by y (O(nlogn) time)presort vertices by y (O(nlogn) time) maintain sorted list of edges intersecting Lmaintain sorted list of edges intersecting L lg n lookup/insert/delete time (e.g. ht-balanced tree)lg n lookup/insert/delete time (e.g. ht-balanced tree) for each vertexfor each vertex find edge left and right along sweep linefind edge left and right along sweep line Algorithm: POLYGON TRIANGULATION: MONOTONE PARTITION Sort vertices by y coordinate Perform plane sweep to construct trapezoidalization Partition into monotone polygons by connecting from interior cusps Triangulate each monotone polygon in O(n) time O(n lg n)

Partition into Monotone Mountains ( O’Rourke ) Alternative:Alternative: Trapezoidalize (as before, time in O(nlgn))Trapezoidalize (as before, time in O(nlgn)) Partition into monotone mountainsPartition into monotone mountains One monotone chain is a single segmentOne monotone chain is a single segment Every strictly convex vertex is an ear tip (except maybe base endpoints)Every strictly convex vertex is an ear tip (except maybe base endpoints) Connect each pair of trapezoid-supporting vertices that don’t lie on same (left/right) side of their trapezoidConnect each pair of trapezoid-supporting vertices that don’t lie on same (left/right) side of their trapezoid Triangulate mountainsTriangulate mountains Total time in O(nlgn) (as before)Total time in O(nlgn) (as before) Algorithm: TRIANGULATION of MONOTONE MOUNTAIN Identify base edge (find extreme points) Initialize internal angles at each nonbase vertex Link nonbase strictly convex vertices into a circular list while list nonempty do For convex vertex b, remove triangle abc Output diagonal ac Update angles and list O(n)

Towards Linear-Time Triangulation…(O’Rourke) YearComplexityAuthors

Linear-Time Triangulation (O’Rourke) Chazelle’s Algorithm (High-Level Sketch)Chazelle’s Algorithm (High-Level Sketch) Computes visibility mapComputes visibility map horizontal chords left and right from each vertexhorizontal chords left and right from each vertex Algorithm is like MergeSort (divide-and-conquer)Algorithm is like MergeSort (divide-and-conquer) Partition polygon of n vertices into n/2 vertex chainsPartition polygon of n vertices into n/2 vertex chains Merge visibility maps of subchains to get one for chainMerge visibility maps of subchains to get one for chain Improve this by dividing process into 2 phases:Improve this by dividing process into 2 phases: 1) Coarse approximations of visibility maps for linear- time merge1) Coarse approximations of visibility maps for linear- time merge 2) Refine coarse map into detailed map in linear time2) Refine coarse map into detailed map in linear time see Chazelle’s paper for details

Seidel’s Randomized Triangulation (O’Rourke) Simple, practical algorithm Simple, practical algorithm Randomized: Coin-flip for some decisions Randomized: Coin-flip for some decisions Build trapezoidalization quickly Build trapezoidalization quickly O(log n) expected cost for locating point in segment query structure O(log n) expected cost for locating point in segment query structure Coin-flip to decide which segment to add next Coin-flip to decide which segment to add next log*n phases, each adding subset of segments in random order to query structure log*n phases, each adding subset of segments in random order to query structure Trapezoidalize -> Monotone Mountain -> Triangulate See Section for details Recall from Cormen et al.:

Convex Partitioning (O’Rourke) Competing Goals: Competing Goals: minimize number of convex pieces minimize number of convex pieces minimize partitioning time minimize partitioning time Add (Steiner) points or just use diagonals and not add points? Add (Steiner) points or just use diagonals and not add points? Adding segments with Steiner points. r = number of reflex vertices Adding only diagonals.

Convex Partitioning (O’Rourke) Theorem (Chazelle): Let  be the fewest number of convex pieces into which a polygon may be partitioned. For a polygon of r reflex vertices: Lower bound: Must eliminate all reflex vertices. Single segment resolves at most* 2 reflex angles. Upper bound: Bisect each reflex angle.

Convex Partitioning (O’Rourke) Hertel & Melhorn’s Algorithm: Hertel & Melhorn’s Algorithm: Essential diagonal d for vertex v if removing d creates nonconvex piece at v. Essential diagonal d for vertex v if removing d creates nonconvex piece at v. Start with any triangulation. Start with any triangulation. Iteratively remove inessential diagonals. Iteratively remove inessential diagonals. Can be done in O(n) time! Can be done in O(n) time! By Lemma 2.5.2, number of essential diagonals By Lemma 2.5.2, number of essential diagonals Number of convex pieces: Number of convex pieces: Recall: Recall: Lemma 2.5.2: There can be at most 2 diagonals essential for any reflex vertex.

Algorithms for Optimal Convex Partitioning of a Polygon (O’Rourke) Optimal convex partition using diagonals Optimal convex partition using diagonals Greene (1983): O(n 4 ) time with dynamic programming Greene (1983): O(n 4 ) time with dynamic programming Keil (1985): O(n 3 logn) time with dynamic programming Keil (1985): O(n 3 logn) time with dynamic programming Optimal convex partition using arbitrary segments Optimal convex partition using arbitrary segments Chazelle (1980) : O(n 3 ) time Chazelle (1980) : O(n 3 ) time

CGAL Convex Polygon Partitioning Y-Monotone partition: Y-Monotone partition: de Berg et al.: O(nlgn) time (see earlier slides) de Berg et al.: O(nlgn) time (see earlier slides) Optimal convex partition using diagonals Optimal convex partition using diagonals Greene (1983): O(n 4 ) time with dynamic programming Greene (1983): O(n 4 ) time with dynamic programming Approximate convex partition removing inessential diagonals Approximate convex partition removing inessential diagonals Starts with triangulation: Starts with triangulation: 2D constrained triangulation 2D constrained triangulation Run time depends on number of triangulation edges intersected by each polygon edge Run time depends on number of triangulation edges intersected by each polygon edge Hertel/ Melhorn: O(n) time after triangulation (see earlier slide) Hertel/ Melhorn: O(n) time after triangulation (see earlier slide) Approximate convex partition using sweep-line Approximate convex partition using sweep-line Greene (1983): O(nlgn) Greene (1983): O(nlgn) Starts with y-monotone partition (de Berg et al.) Starts with y-monotone partition (de Berg et al.)