ORourkeCH2 - UMass Lowell Computer Science 91.504 Advanced...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: UMass Lowell Computer Science 91.504 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(n2): O'Rourke Ch. 1: Ear removal O(nlgn): Using monotonicity: (see next slide for definition) Partition polygon into monotone pieces, then quickly triangulate monotone pieces: deBerg et al.: 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'Rourke Chapter 2, Approach 1: O(nlgn): Create y-monotone pieces using plane sweep to trapezoidalize (p. 47-50) O(n): To triangulate a single y-monotone piece (as in deBerg et al.) O'Rourke Chapter 2, Approach 2: O(nlgn): Create monotone mountains using plane sweep to trapezoidalize Trapezoidalize (p. 47-50) Add diagonals to convert trapezoidalization into set of monotone mountains. O(n): To triangulate a single monotone mountain (p. 52-53) O(nlg*n) Expected time: Seidel Randomized Triangulation Recall from Cormen et al.: log* n = min{i 0 : lg ( i ) n 1} Trapezoidalize, monotone mountain, triangulate pieces Constrained Delaunay triangulation (CGAL) (Delaunay triangulation to be studied later...) O(n): Chazelle (see paper) 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 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 Polygon is monotone if it is monotone in neighborhood of every vertex Absence of interior cusps guarantees y-monotonicity Monotone polygon can be (greedily) triangulated in O(n) time deBerg et al. (see next 2 slides) Triangulating a Monotone Polygon in Linear Time (de Berg et al.) Doubly-connected edge list: see p. 29-32 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 vi. Add diagonal downward from each merge vertex vi. Implemented in CGAL: function y_monotone_partition_2 Trapezoidalization (O'Rourke) Partition into trapezoids Horizontal line through each vertex Diagonal of each interior cusp with each "supporting" vertex yields monotone partition To trapezoidalize, vertically sweep horizontal line L presort vertices by y (O(nlogn) time) maintain sorted list of edges intersecting L lg n lookup/insert/delete time (e.g. ht-balanced tree) for each vertex find 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 O(n lg n) Triangulate each monotone polygon in O(n) time Partition into Monotone Mountains (O'Rourke) Alternative: Trapezoidalize (as before, time in O(nlgn)) Partition into monotone mountains One monotone chain is a single segment 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 trapezoid Triangulate mountains 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 O(n) Update angles and list Towards Linear-Time Triangulation...(O'Rourke) Year Complexity 1911 1978 1983 1984 1986 1988 1989 1990 1990 1991 O(n2) O(n log n) O(n log r), r reflex O(n log s), s sinuosity O(n log log n) O(n + nt0), t0 int. triangles O(n log* n), randomized O(n log* n) bounded integer coordinates O(n) O(n log*n), randomized Authors Lennes Garey et al. Hertel & Melhorn Chazelle & Incerpi Tarjan & Van Wyk Toussaint Clarkson, Tarjan & Van Wyk Kirkpatrick, Klawe, Tarjan Chazelle Seidel Linear-Time Triangulation (O'Rourke) Chazelle's Algorithm (High-Level Sketch) Computes visibility map horizontal chords left and right from each vertex Algorithm is like MergeSort (divide-and-conquer) Partition polygon of n vertices into n/2 vertex chains Merge visibility maps of subchains to get one for chain Improve this by dividing process into 2 phases: 1) Coarse approximations of visibility maps for lineartime merge 2) Refine coarse map into detailed map in linear time see Chazelle's paper for details Seidel's Randomized Triangulation (O'Rourke) Trapezoidalize -> Monotone Mountain -> Triangulate Simple, practical algorithm Randomized: Coin-flip for some decisions Build trapezoidalization quickly O(log n) expected cost for locating point in segment query structure Coin-flip to decide which segment to add next log*n phases, each adding subset of segments in random order to query structure Recall from Cormen et al.: log* n = min{i 0 : lg (i ) n 1} See Section 7.11.4 for details Convex Partitioning (O'Rourke) Competing Goals: minimize number of convex pieces minimize partitioning time 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: r 2 +1 r +1 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: Essential diagonal d for vertex v if removing d creates nonconvex piece at v. Start with any triangulation. Iteratively remove inessential diagonals. Can be done in O(n) time! Lemma 2.5.2: There can be at most 2 diagonals essential for any reflex vertex. 2r By Lemma 2.5.2, number of essential diagonals Number of convex pieces: 2r + 1 < 2r + 4 4 Recall: r r r + 1 4 + 1 4 4 + 4 2 2 2 4 2r + 4 4 Algorithms for Optimal Convex Partitioning of a Polygon (O'Rourke) Optimal convex partition using diagonals Greene (1983): O(n4) time with dynamic programming Keil (1985): O(n3logn) time with dynamic programming Optimal convex partition using arbitrary segments Chazelle (1980) : O(n3) time CGAL Convex Polygon Partitioning Y-Monotone partition: de Berg et al.: O(nlgn) time (see earlier slides) Optimal convex partition using diagonals Greene (1983): O(n4) time with dynamic programming Approximate convex partition removing inessential diagonals Starts with triangulation: 2D constrained triangulation Run time depends on number of triangulation edges intersected by each polygon edge Hertel/ Melhorn: O(n) time after triangulation (see earlier slide) 4 Approximate convex partition using sweep-line 4 Greene (1983): O(nlgn) Starts with y-monotone partition (de Berg et al.) ...
View Full Document

Ask a homework question - tutors are online