UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 2 Chapter 2: Polygon Partitioning.

Slides:



Advertisements
Similar presentations
Geometry Introduction
Advertisements

Polygon Triangulation
2/9/06CS 3343 Analysis of Algorithms1 Convex Hull  Given a set of pins on a pinboard  And a rubber band around them  How does the rubber band look when.
1/13/15CMPS 3130/6130: Computational Geometry1 CMPS 3130/6130: Computational Geometry Spring 2015 Convex Hulls Carola Wenk.
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.
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
CS4413 Divide-and-Conquer
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.
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,
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Computational Geometry
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
Feb Polygon Triangulation Shmuel Wimer Bar Ilan Univ., School of Engineering.
1 Today’s Material Computational Geometry Problems –Closest Pair Problem –Convex Hull Jarvis’s March, Graham’s scan –Farthest Point Problem.
What does that mean? To get the taste we will just look only at some sample problems... [Adapted from S.Suri]
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.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Lecture 2 Polygon Partitioning Thursday,
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, 2007 Chapter 4: 3D Convex Hulls Friday, 2/9/07.
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.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
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.
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 3 Chapter 4: 3D Convex Hulls Chapter.
Brute-Force Triangulation
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
Triangulating a monotone polygon
Convex Hull. What is the Convex Hull? Imagine a set of points on a board with a nail hammered into each point. Now stretch a rubber band over all the.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 O’Rourke Chapter 7 Search & Intersection.
Computational Geometry Course Summary (First Half) Spring 2008 Pay special attention to: algorithm details (able to explain correctness and carry out a.
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.
Fundamental Data Structures and Algorithms Klaus Sutner April 27, 2004 Computational Geometry.
Fundamental Data Structures and Algorithms Margaret Reid-Miller 27 April 2004 Computational Geometry.
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 O’Rourke Chapter 4: 3D Convex Hulls Thursday,
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
Computational Geometry 2D Convex Hulls
Robert Pless, CS 546: Computational Geometry Lecture #3 Last time Several convex hull algorithms. Lower bound of O(n log n) –O(n log h) for output sensitive.
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
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Introduction to Spatial Computing CSE 555
Convex Hull.
Query Processing in Databases Dr. M. Gavrilova
Algorithm design techniques Dr. M. Gavrilova
Polygon Triangulation
Convex Sets & Concave Sets
CHAPTER 33 Computational Geometry
Presentation transcript:

UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 2 Chapter 2: Polygon Partitioning Chapter 3: 2D Convex Hulls Monday, 2/12/01

Chapter 2 Polygon Partitioning useful for triangulations and many other uses!

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 ä Monotone polygon can be (greedily) triangulated in O(n) time

Trapezoidalization ä Partition into trapezoids ä Horizontal line through each vertex ä Diagonal with each “supporting” vertex yields monotone partition ä To trapezoidalize, vertically sweep a 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 Triangulation each monotone polygon in O(n) time O(n lg n)

Partition into Monotone Mountains ä One monotone chain is a single segment ä Every strictly convex vertex is an ear tip (except maybe base endpoints) Algorithm: TRIANGULATION of MONOTONE MOUNTAIN Identify base edge Initialize internal angles at each nonbase vertex Link nonbase strictly convex vertices into a list while list nonempty do For convex vertex b, remove triangle abc Output diagonal ac Update angles and list O(n)

Linear-Time Triangulation YearComplexityAuthors

Linear-Time Triangulation ä 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 linear- time merge 2) Refine coarse map into detailed map in linear time

Seidel’s Randomized Triangulation ä Simple, practical algorithm ä Randomized: Coin-flip for some decisions ä Build trapezoidalization quickly ä O(log n) expected cost for locating point in query structure ä Coin-flip to decide which segment to add next Trapezoidalize -> Monotone Mountain -> Triangulate

Convex Partitioning ä Competing Goals: ä minimize number of convex pieces ä minimize partitioning time ä To add points or not add points? Theorem (Chazelle): Let  be the fewest number of convex pieces into which a polygon may be partitioned. For a polygon of r reflex vertices:

Chapter 3 2D Convex Hulls

Convexity & Convex Hulls  A convex combination of points x 1,..., x k is a sum of the form  1 x  k x k where ä Convex hull of a set of points is the set of all convex combinations of points in the set. nonconvex polygon convex hull of a point set

Naive Algorithms for Extreme Points Algorithm: INTERIOR POINTS for each i do for each j = i do for each j = i do for each k = j = i do for each k = j = i do for each L = k = j = i do for each L = k = j = i do if p L in triangle(p i, p j, p k ) then p L is nonextreme O(n 4 ) Algorithm: EXTREME EDGES for each i do for each j = i do for each j = i do for each k = j = i do for each k = j = i do if p k is not left or on (p i, p j ) if p k is not left or on (p i, p j ) then (p i, p j ) is not extreme O(n 3 )

Gift Wrapping ä Use one extreme edge as an anchor for finding the next  O(n 2 ) Algorithm: GIFT WRAPPING i 0 index of the lowest point i i 0 repeat for each j = i for each j = i Compute counterclockwise angle  from previous hull edge Compute counterclockwise angle  from previous hull edge k index of point with smallest  k index of point with smallest  Output (p i, p k ) as a hull edge Output (p i, p k ) as a hull edge i k i k until i = i 0

QuickHull ä Concentrate on points close to hull boundary ä Named for similarity to Quicksort a b O(n 2 ) Algorithm: QUICK HULL function QuickHull(a,b,S) if S = 0 return() if S = 0 return() else else c index of point with max distance from ab c index of point with max distance from ab A points strictly right of (a,c) A points strictly right of (a,c) B points strictly right of (c,b) B points strictly right of (c,b) return QuickHull(a,c,A) + (c) + QuickHull(c,b,B) return QuickHull(a,c,A) + (c) + QuickHull(c,b,B)

Graham’s Algorithm ä Points sorted angularly provide “star-shaped” starting point ä Prevent “dents” as you go via convexity testing O(nlgn) Algorithm: GRAHAM SCAN, Version B Find rightmost lowest point; label it p 0. Sort all other points angularly about p 0. In case of tie, delete point(s) closer to p 0. In case of tie, delete point(s) closer to p 0. Stack S (p 1, p 0 ) = (p t, p t-1 ); t indexes top i 2 while i < n do if p i is strictly left of p t-1 p t then Push(p i, S) and set i i +1 else Pop(S) 

Lower Bound of O(nlgn)  Worst-case time to find convex hull of n points in algebraic decision tree model is in  (nlgn) ä Proof uses sorting reduction: ä Given unsorted list of n numbers: (x 1,x 2,…, x n ) ä Form unsorted set of points: (x i, x i 2 ) for each x i ä Convex hull of points produces sorted list! ä Parabola: every point is on convex hull ä Reduction is O(n) (which is o(nlgn))  Finding convex hull of n points is therefore at least as hard as sorting n points, so worst-case time is in  (nlgn) Parabola for sorting 2,1,3

Incremental Algorithm ä Add points, one at a time ä update hull for each new point ä Key step becomes adding a single point to an existing hull. ä Idea is extended to 3D in Chapter 4. O(n 2 ) Algorithm: INCREMENTAL ALGORITHM Let H 2 ConvexHull{p 0, p 1, p 2 } for k 3 to n - 1 do H k ConvexHull{ H k-1 U p k } H k ConvexHull{ H k-1 U p k } can be improved to O(nlgn)

Divide-and-Conquer ä Divide-and-Conquer in a geometric setting ä O(n) merge step is the challenge ä Find upper and lower tangents ä Lower tangent: find rightmost pt of A & leftmost pt of B; then “walk it downwards” ä Idea is extended to 3D in Chapter 4. Algorithm: DIVIDE-and-CONQUER Sort points by x coordinate Divide points into 2 sets A and B: A contains left n/2 points B contains right n/2 points Compute ConvexHull(A) and ConvexHull(B) recursively Merge ConvexHull(A) and ConvexHull(B) O(nlgn) A B

Homework 1 Fri, 2/9 Wed, 2/14 Chapter 1 (O’Rourke) problems 1 & 2 problems 1 & 2 Extra credit may be turned in any time during week of 2/12 2 Mon, 2/12 Wed, 2/21 Chapters 2,3 (O’Rourke) problems 1 & 2 Extra credit may be turned in any time during week of 2/21 HW# Assigned Due Content

Machine Accounts ä Each student has an account on my machine: minkowski.cs.uml.edu ä Username is the same as your username on CS ä Password is your initials followed by the last 5 digits on the bottom right hand corner of the back of your student id card (1 exception) ä To remotely log in, use a secure shell (e.g. ssh) ä To transfer files, use a secure FTP (e.g. sftpc) ä Saturn has an sftpc client ä Code to use with assignments will be there.

Preparing for Homework 2 ä Graham Scan 2D Convex Hull Code ä Background on research problem that motivates problem 2