Computational Geometry

Similar documents
CS 532: 3D Computer Vision 14 th Set of Notes

Computational Geometry Lecture Delaunay Triangulation

Delaunay Triangulations

Delaunay Triangulations. Presented by Glenn Eguchi Computational Geometry October 11, 2001

CS133 Computational Geometry

Voronoi Diagrams and Delaunay Triangulations. O Rourke, Chapter 5

CAD & Computational Geometry Course plan

Voronoi diagrams Delaunay Triangulations. Pierre Alliez Inria

Chapter 8. Voronoi Diagrams. 8.1 Post Oce Problem

Voronoi Diagrams and Delaunay Triangulation slides by Andy Mirzaian (a subset of the original slides are used here)

Voronoi Diagrams in the Plane. Chapter 5 of O Rourke text Chapter 7 and 9 of course text

Fortune s Algorithm. Notes from the book by de Berg, Van Krevald, Overmars, and Schwarzkpf

Voronoi Diagrams. A Voronoi diagram records everything one would ever want to know about proximity to a set of points

Lecture 16: Voronoi Diagrams and Fortune s Algorithm

Other Voronoi/Delaunay Structures

Week 8 Voronoi Diagrams

Voronoi diagram and Delaunay triangulation

Computational Geometry. Algorithm Design (10) Computational Geometry. Convex Hull. Areas in Computational Geometry

2D Geometry. Pierre Alliez Inria Sophia Antipolis

Computational Geometry

Voronoi Diagram. Xiao-Ming Fu

3. Voronoi Diagrams. 3.1 Definitions & Basic Properties. Examples :

Computational Geometry

Lecture 4 (CGAL) Panos Giannopoulos, Dror Atariah AG TI WS 2012/13

Lifting Transform, Voronoi, Delaunay, Convex Hulls

Notes in Computational Geometry Voronoi Diagrams

Facial Expression Recognition

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Fall, 2012

Solutions to problem set 1

Introduction to Voronoi Diagrams and Delaunay Triangulations

Course 16 Geometric Data Structures for Computer Graphics. Voronoi Diagrams

CMSC 425: Lecture 9 Geometric Data Structures for Games: Geometric Graphs Thursday, Feb 21, 2013

Outline of the presentation

6.854J / J Advanced Algorithms Fall 2008

Constrained Delaunay Triangulations (CDT)

Midpoint Routing algorithms for Delaunay Triangulations

Lecture 3: Art Gallery Problems and Polygon Triangulation

Preferred directions for resolving the non-uniqueness of Delaunay triangulations

Surface Mesh Generation

CS6100: Topics in Design and Analysis of Algorithms

Wolfgang Mulzer Institut für Informatik. Planar Delaunay Triangulations and Proximity Structures

Computational Geometry

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality

Computational Geometry Lecture Duality of Points and Lines

Geometric Modeling. Bing-Yu Chen National Taiwan University The University of Tokyo

2 Delaunay Triangulations

Computational Geometry Exercise Duality

Art Gallery, Triangulation, and Voronoi Regions

PS Computational Geometry Homework Assignment Sheet I (Due 16-March-2018)

Image Warping and Morphing. Alexey Tikhonov : Computational Photography Alexei Efros, CMU, Fall 2007

Algorithmische Geometrie Voronoi Diagram

CS S Lecture February 13, 2017

Polygon decomposition. Motivation: Art gallery problem

Computational Geometry: Lecture 5

Differential Geometry: Circle Patterns (Part 1) [Discrete Conformal Mappinngs via Circle Patterns. Kharevych, Springborn and Schröder]

Connected Components of Underlying Graphs of Halving Lines

Acute Triangulations of Polygons

Möbius Transformations in Scientific Computing. David Eppstein

Scientific Computing WS 2018/2019. Lecture 12. Jürgen Fuhrmann Lecture 12 Slide 1

Polygon Partitioning. Lecture03

VORONOI DIAGRAM PETR FELKEL. FEL CTU PRAGUE Based on [Berg] and [Mount]

CS 532: 3D Computer Vision 11 th Set of Notes

Simulations of the quadrilateral-based localization

Construction Of The Constrained Delaunay Triangulation Of A Polygonal Domain

The statement implies that any three intersection points of two distinct planes lie on a line.

Packing Two Disks into a Polygonal Environment

Line segment intersection. Family of intersection problems

The Medial Axis of the Union of Inner Voronoi Balls in the Plane

Commando: Solution. Solution 3 O(n): Consider two decisions i<j, we choose i instead of j if and only if : A S j S i

Quadratic and cubic b-splines by generalizing higher-order voronoi diagrams

Simplicial Complexes: Second Lecture

Lecture 4: Trees and Art Galleries

Exercise set 2 Solutions

The Farthest Point Delaunay Triangulation Minimizes Angles

High-Dimensional Computational Geometry. Jingbo Shang University of Illinois at Urbana-Champaign Mar 5, 2018

The Geodesic Integral on Medial Graphs

arxiv: v1 [cs.cg] 8 Jan 2018

CMPS 3130/6130 Computational Geometry Spring Voronoi Diagrams. Carola Wenk. Based on: Computational Geometry: Algorithms and Applications

Definition 1 (Hand-shake model). A hand shake model is an incidence geometry for which every line has exactly two points.

CMSC 754 Computational Geometry 1

Vertex Cover Approximations

Euclidean TSP Between Two Nested Convex Obstacles

Motion Planning. O Rourke, Chapter 8

Lokale Netzstrukturen Exercise 5. Juli 19, 2017

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

CSE 5311 Notes 13: Computational Geometry

[8] that this cannot happen on the projective plane (cf. also [2]) and the results of Robertson, Seymour, and Thomas [5] on linkless embeddings of gra

COMPUTING CONSTRAINED DELAUNAY

Optimal Compression of a Polyline with Segments and Arcs

Definitions. Topology/Geometry of Geodesics. Joseph D. Clinton. SNEC June Magnus J. Wenninger

Parameterization. Michael S. Floater. November 10, 2011

Week 7 Convex Hulls in 3D

Math 776 Graph Theory Lecture Note 1 Basic concepts

Ma/CS 6b Class 11: Kuratowski and Coloring

Proceedings - AutoCarto Columbus, Ohio, USA - September 16-18, Alan Saalfeld

Image Warping and Morphing. Alexey Tikhonov

The Piecewise Linear-Quadratic Model for Convex Bivariate Functions

Computational Geometry

Testing Euclidean Minimum Spanning Trees in the Plane

Planarity: dual graphs

Transcription:

Lecture 12: Lecture 12:

Motivation: Terrains by interpolation To build a model of the terrain surface, we can start with a number of sample points where we know the height. Lecture 12:

Motivation: Terrains How do we interpolate the height at other points? Nearest neighbor interpolation Piecewise linear interpolation by a triangulation Moving windows interpolation Natural neighbor interpolation... 233 235 240 211? 246 258 251 Lecture 12:

Triangulation Introduction Let P = {p 1,...,p n } be a point set. A triangulation of P is a maximal planar subdivision with vertex set P. Complexity: 2n 2 k triangles 3n 3 k edges where k is the number of points in P on the convex hull of P Lecture 12:

Triangulation Introduction But which triangulation? Lecture 12:

Triangulation Introduction But which triangulation? For interpolation, it is good if triangles are not long and skinny. We will try to use large angles in our triangulation. Lecture 12:

Angle Vector of a Triangulation Let T be a triangulation of P with m triangles. Its angle vector is A(T) = (α 1,...,α 3m ) where α 1,...,α 3m are the angles of T sorted by increasing value. Let T be another triangulation of P. We define A(T) > A(T ) if A(T) is lexicographically larger than A(T ) T is angle optimal if A(T) A(T ) for all triangulations T of P α 4 α 5 α 2 α 3 α 1 α 6 Lecture 12:

Edge Flipping Introduction p l p l α 2 α 3 α 5 p j edge flip α 2 α 4 α 6 p j α 1 p i α 4 α 6 p i α 1 α 3 α 5 p k p k Change in angle vector: α 1,...,α 6 are replaced by α 1,...,α 6 The edge e = p i p j is illegal if min 1 i 6 α i < min 1 i 6 α i Flipping an illegal edge increases the angle vector Lecture 12:

Characterisation of Illegal Edges How do we determine if an edge is illegal? Lemma: The edge p i p j is illegal if and only if p l lies in the interior of the circle C. p i p j p l p k illegal Lecture 12:

Thales Theorem Theorem: Let C be a circle, l a line intersecting C in points a and b, and p,q,r,s points lying on the same side of l. Suppose that p,q lie on C, r lies inside C, and s lies outside C. Then p s q r arb > apb = aqb > asb, b where abc denotes the smaller angle defined by three points a,b,c. l a C Lecture 12:

Legal A legal triangulation is a triangulation that does not contain any illegal edge. Algorithm LegalTriangulation(T) Input. A triangulation T of a point set P. Output. A legal triangulation of P. 1. while T contains an illegal edge p i p j 2. do ( Flip p i p j ) 3. Let p i p j p k and p i p j p l be the two triangles adjacent to p i p j. 4. Remove p i p j from T, and add p k p l instead. 5. return T Question: Why does this algorithm terminate? Lecture 12:

Properties Voronoi Diagram and Delaunay Graph Let P be a set of n points in the plane The Voronoi diagram Vor(P) is the subdivision of the plane into Voronoi cells V(p) for all p P Let G be the dual graph of Vor(P) The Delaunay graph DG(P) is the straight line embedding of G Lecture 12:

Properties Voronoi Diagram and Delaunay Graph Let P be a set of n points in the plane The Voronoi diagram Vor(P) is the subdivision of the plane into Voronoi cells V(p) for all p P Let G be the dual graph of Vor(P) The Delaunay graph DG(P) is the straight line embedding of G Lecture 12:

Properties Voronoi Diagram and Delaunay Graph Let P be a set of n points in the plane The Voronoi diagram Vor(P) is the subdivision of the plane into Voronoi cells V(p) for all p P Let G be the dual graph of Vor(P) The Delaunay graph DG(P) is the straight line embedding of G Lecture 12:

Properties Voronoi Diagram and Delaunay Graph Let P be a set of n points in the plane The Voronoi diagram Vor(P) is the subdivision of the plane into Voronoi cells V(p) for all p P Let G be the dual graph of Vor(P) The Delaunay graph DG(P) is the straight line embedding of G Lecture 12:

Planarity of the Delaunay Graph Properties Theorem: The Delaunay graph of a planar point set is a plane graph. contained in V(p i ) p i C ij p j contained in V(p j ) Lecture 12:

Delaunay Triangulation Properties If the point set P is in general position then the Delaunay graph is a triangulation. f v Lecture 12:

Empty Circle Property Properties Theorem: Let P be a set of points in the plane, and let T be a triangulation of P. Then T is a Delaunay triangulation of P if and only if the circumcircle of any triangle of T does not contain a point of P in its interior. Lecture 12:

Properties and Legal Theorem: Let P be a set of points in the plane. A triangulation T of P is legal if and only if T is a Delaunay triangulation. p m C(pi p j p m ) p i e p l p j p k C(p i p j p k ) Lecture 12:

Properties Angle Optimality and Theorem: Let P be a set of points in the plane. Any angle-optimal triangulation of P is a Delaunay triangulation of P. Furthermore, any Delaunay triangulation of P maximizes the minimum angle over all triangulations of P. Lecture 12:

Properties Computing There are several ways to compute the Delaunay triangulation: By iterative flipping from any triangulation By plane sweep By randomized incremental construction By conversion from the Voronoi diagram The last three run in O(nlogn) time [expected] for n points in the plane Lecture 12:

Using Delaunay triangulations help in constructing various things: Euclidean Minimum Spanning Trees Approximations to the Euclidean Problem α-hulls Lecture 12:

Euclidean Minimum Spanning Tree For a set P of n points in the plane, the Euclidean Minimum Spanning Tree is the graph with minimum summed edge length that connects all points in P and has only the points of P as vertices Lecture 12:

Euclidean Minimum Spanning Tree For a set P of n points in the plane, the Euclidean Minimum Spanning Tree is the graph with minimum summed edge length that connects all points in P and has only the points of P as vertices Lecture 12:

Euclidean Minimum Spanning Tree Lemma: The Euclidean Minimum Spanning Tree does not have cycles (it really is a tree) Proof: Suppose G is the shortest connected graph and it has a cycle. Removing one edge from the cycle makes a new graph G that is still connected but which is shorter. Contradiction Lecture 12:

Euclidean Minimum Spanning Tree Lemma: Every edge of the Euclidean Minimum Spanning Tree is an edge in the Delaunay graph Proof: Suppose T is an EMST with an edge e = pq that is not Delaunay p r Consider the circle C that has e as its diameter. Since e is not Delaunay, C must contain another point r in P (different from p and q) q Lecture 12:

Euclidean Minimum Spanning Tree Lemma: Every edge of the Euclidean Minimum Spanning Tree is an edge in the Delaunay graph Proof: (continued) p r Either the path in T from r to p passes through q, or vice versa. The cases are symmetric, so we can assume the former case q Lecture 12:

Euclidean Minimum Spanning Tree Lemma: Every edge of the Euclidean Minimum Spanning Tree is an edge in the Delaunay graph Proof: (continued) Then removing e and inserting pr instead will give a connected graph again (in fact, a tree) Since q was the furthest point from p inside C, r is closer to q, so T was not a minimum spanning tree. Contradiction p q r Lecture 12:

Euclidean Minimum Spanning Tree How can we compute a Euclidean Minimum Spanning Tree efficiently? From your Data Structures course: A data structure exists that maintains disjoint sets and allows the following two operations: Union: Takes two sets and makes one new set that is the union (destroys the two given sets) Find: Takes one element and returns the name of the set that contains it If there are n elements in total, then all Unions together take O(nlogn) time and each Find operation takes O(1) time Lecture 12:

Euclidean Minimum Spanning Tree Let P be a set of n points in the plane for which we want to compute the EMST 1 Make a Union-Find structure where every point of P is in a separate set 2 Construct the Delaunay triangulation DT of P 3 Take all edges of DT and sort them by length 4 For all edges e from short to long: Let the endpoints of e be p and q If Find(p) Find(q), then put e in the EMST, and Union(Find(p),Find(q)) Lecture 12:

Euclidean Minimum Spanning Tree Step 1 takes linear time, the other three steps take O(nlogn) time Theorem: Let P be a set of n points in the plane. The Euclidean Minimum Spanning Tree of P can be computed in O(nlogn) time Lecture 12:

The traveling salesperson problem Given a set P of n points in the plane, the Euclidean Traveling Salesperson Problem is to compute a tour (cycle) that visits all points of P and has minimum length A tour is an order on the points of P (more precisely: a cyclic order). A set of n points has (n 1)! different tours Lecture 12:

The traveling salesperson problem We can determine the length of each tour in O(n) time: a brute-force algorithm to solve the Euclidean Traveling Salesperson Problem (ETSP) takes O(n) O((n 1)!) = O(n!) time How bad is n!? Lecture 12:

Efficiency Introduction n n 2 2 n n! 6 36 64 720 7 49 128 5040 8 64 256 40K 9 81 512 360K 10 100 1024 3.5M 15 225 32K 2,000,000T 20 400 1M 30 900 1G Clever algorithms can solve instances in O(n 2 2 n ) time Lecture 12:

Approximation algorithms If an algorithm A solves an optimization problem always within a factor k of the optimum, then A is called an k-approximation algorithm If an instance I of ETSP has an optimal solution of length L, then a k-approximation algorithm will find a tour of length k L Lecture 12:

Approximation algorithms Consider the diameter problem of a set of n points. We can compute the real value of the diameter in O(nlogn) time Suppose we take any point p, determine its furthest point q, and return their distance. This takes only O(n) time Question: Is this an approximation algorithm? Lecture 12:

Approximation algorithms Consider the diameter problem of a set of n points. We can compute the real value of the diameter in O(nlogn) time Suppose we take any point p, determine its furthest point q, and return their distance. This takes only O(n) time p Question: Is this an approximation algorithm? q Lecture 12:

Approximation algorithms Suppose we determine the point with minimum x-coordinate p and the point with maximum x-coordinate q, and return their distance. This takes only O(n) time Question: Is this an approximation algorithm? Lecture 12:

Approximation algorithms Suppose we determine the point with minimum x-coordinate p and the point with maximum x-coordinate q, and return their distance. This takes only O(n) time Question: Is this an approximation algorithm? Lecture 12:

Approximation algorithms Suppose we determine the point with minimum x-coordinate p and the point with maximum x-coordinate q. Then we determine the point with minimum y-coordinate r and the point with maximum y-coordinate s. We return max(d(p, q), d(r, s)). This takes only O(n) time Question: Is this an approximation algorithm? Lecture 12:

Approximation algorithms Suppose we determine the point with minimum x-coordinate p and the point with maximum x-coordinate q. Then we determine the point with minimum y-coordinate r and the point with maximum y-coordinate s. We return max(d(p, q), d(r, s)). This takes only O(n) time Question: Is this an approximation algorithm? Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP start at any vertex Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP follow an edge on one side Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP... to get to another vertex Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP proceed this way Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP proceed this way Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP proceed this way Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP skipping visited vertices Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP skipping visited vertices Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP skipping visited vertices Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP skipping visited vertices Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP skipping visited vertices Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP skipping visited vertices Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP skipping visited vertices Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP skipping visited vertices Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP and close the tour Lecture 12:

Approximation algorithms Back to Euclidean Traveling Salesperson: We will use the EMST to approximate the ETSP and close the tour Lecture 12:

Approximation algorithms Why is this tour an approximation? The walk visits every edge twice, so it has length 2 EMST The tour skips vertices, which means the tour has length 2 EMST The optimal ETSP-tour is a spanning tree if you remove any edge!!! So EMST < ETSP optimal ETSP-tour Lecture 12:

Approximation algorithms Theorem: Given a set of n points in the plane, a tour visiting all points whose length is at most twice the minimum possible can be computed in O(nlogn) time In other words: an O(nlogn) time, 2-approximation for ETSP exists Lecture 12:

α-shapes Introduction Suppose that you have a set of points in the plane that were sampled from a shape We would like to reconstruct the shape Lecture 12:

α-shapes Introduction Suppose that you have a set of points in the plane that were sampled from a shape We would like to reconstruct the shape Lecture 12:

α-shapes Introduction An α-disk is a disk of radius α The α-shape of a point set P is the graph with the points of P as the vertices, and two vertices p,q are connected by an edge if there exists an α-disk with p and q on the boundary but no other points if P inside or on the boundary Lecture 12:

α-shapes Introduction An α-disk is a disk of radius α The α-shape of a point set P is the graph with the points of P as the vertices, and two vertices p,q are connected by an edge if there exists an α-disk with p and q on the boundary but no other points if P inside or on the boundary Lecture 12:

α-shapes Introduction An α-disk is a disk of radius α The α-shape of a point set P is the graph with the points of P as the vertices, and two vertices p,q are connected by an edge if there exists an α-disk with p and q on the boundary but no other points if P inside or on the boundary Lecture 12:

α-shapes Introduction An α-disk is a disk of radius α The α-shape of a point set P is the graph with the points of P as the vertices, and two vertices p,q are connected by an edge if there exists an α-disk with p and q on the boundary but no other points if P inside or on the boundary Lecture 12:

α-shapes Introduction Because of the empty disk property of Delaunay triangulations (each Delaunay edge has an empty disk through its endpoints), every α-shape edge is also a Delaunay edge Hence: there are O(n) α-shape edges, and they cannot properly intersect Lecture 12:

α-shapes Introduction Given the Delaunay triangulation, we can determine for any edge all sizes of empty disks through the endpoints in O(1) time So the α-shape can be computed in O(nlogn) time Lecture 12:

Conclusions Introduction The Delaunay triangulation is a versatile structure that can be computed in O(nlogn) time for a set of n points in the plane Approximation algorithms are like heuristics, but they come with a guarantee on the quality of the approximation. They are useful when an optimal solution is too time-consuming to compute Lecture 12: