Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.

Slides:



Advertisements
Similar presentations
Planar Subdivision Induced by planar embedding of a graph. Connected if the underlying graph is. edge vertex hole in f face f disconnected subdivision.
Advertisements

Two Segments Intersect?
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.
Chapter 9 Graphs.
Planar straight line graph A planar straight line graph (PSLG) is a planar embedding of a planar graph G = (V, E) with: 1.each vertex v  V mapped to a.
Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Convex drawing chapter 5 Ingeborg Groeneweg. Summery What is convex drawing What is convex drawing Some definitions Some definitions Testing convexity.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
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.
One of the most important problems is Computational Geometry is to find an efficient way to decide, given a subdivision of E n and a point P, in which.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
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
Overlay of Two Subdivisions
Incidences and Many Faces via cuttings Sivanne Goldfarb
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Computational Geometry -- Voronoi Diagram
17. Computational Geometry Chapter 7 Voronoi Diagrams.
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.
The Half-Edge Data Structure Computational Geometry, WS 2007/08 Lecture 3, Part III Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
The Half-Edge Data Structure
1 Lecture 8: Voronoi Diagram Computational Geometry Prof. Dr. Th. Ottmann Voronoi Diagrams Definition Characteristics Size and Storage Construction Use.
Voronoi Diagrams Computational Geometry, WS 2006/07 Lecture 10 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Duality and Arrangements Computational Geometry, WS 2007/08 Lecture 6 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Computational Geometry Seminar Lecture 1
Tucker, Applied Combinatorics, Section 1.4, prepared by Patti Bodkin
Lecture 8 : Arrangements and Duality Computational Geometry Prof. Dr. Th. Ottmann 1 Duality and Arrangements Duality between lines and points Computing.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Voronoi Diagrams.
1 Separator Theorems for Planar Graphs Presented by Shira Zucker.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
Rectangular Drawing Imo Lieberwerth. Content Introduction Rectangular Drawing and Matching Thomassen’s Theorem Rectangular drawing algorithm Advanced.
Duality and Arrangements Computational Geometry, WS 2006/07 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
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.
Brute-Force Triangulation
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
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.
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
Line Arrangement Chapter 6. Line Arrangement Problem: Given a set L of n lines in the plane, compute their arrangement which is a planar subdivision.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
Planar Subdivision Induced by planar embedding of a graph. Connected if the underlying graph is. edge vertex disconnected subdivision Complexity = #vertices.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
CMPS 3130/6130 Computational Geometry Spring 2015
Arrangements and Duality Motivation: Ray-Tracing Fall 2001, Lecture 9 Presented by Darius Jazayeri 10/4/01.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness)
An Introduction to Computational Geometry Joseph S. B. Mitchell Stony Brook University.
UNC Chapel Hill M. C. Lin Computing Voronoi Diagram For each site p i, compute the common inter- section of the half-planes h(p i, p j ) for i  j, using.
Trees Thm 2.1. (Cayley 1889) There are nn-2 different labeled trees
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 9 Line Arrangements.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Planarity Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering, IIT.
Polygon Triangulation
Computational Geometry
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry 2
I. The Problem of Molding
Computational Geometry
Planarity.
Overlay of Two Subdivisions
Presentation transcript:

Map Overlay Algorithm

Birch forest Wolves Map 1: Vegetation Map 2: Animals

Birch and wolves Overlay Thus we need to find intersections of segments of two planar subdivisions

Overlay of two subdivisions S1 and S2 are two subdivisions (planar graphs), given in the form of DCEL’s Our goal is to compute the DCEL for the overlay O(S1, S2) Note: f is a face of O (S1, S2) if and only if there are two faces f 1 from S1 and f 2 from S2 such that f is the maximal connected component of the intersection f 1 and f 2

Strategy Take the union of DCEL’s of S1 and S2 This union is NOT a valid DCEL (does not represent planar subdivision) We need to transform this union into a valid DCEL, i.e. to compute new half-edge records, face records, and vertex records For each face record f in O (S1, S2) we also need to report information about faces f 1 from S1 and f 2 from S2 such that f is the maximal connected component of the intersection f 1 and f 2 Recall: any half-edge in DCEL is oriented so that the face it bounds lies to the left. Therefore we can use an unchanged half-edge record from S1 in O(S1, S2) if and only if it is not intersected by any edge from S2, and vice versa

Algorithm - preparation By complexity of a subdivision we mean the num. of vertices + the num. of edges + the num. of faces In what follows, k will denote the complexity of D (the resulting subdivision), and n will denote the sum of complexities of S1 and S2 Note: due to the Euler's formula, the complexity of a connected planar subdivision is O (number of edges)

Algorithm - preparation Based on the plane sweep algorithm for segment intersections We use it to find intersections of edges from S1 and S2 Data structures to be used: Q (event queue) and T (status structure) as before Additionally, D will be new DCEL Together with edges in T, we store pointers to the corresponding half-edges in D Initially, D contains the union of DCEL’s of S1 and S2 During the algorithm, D will be transformed into the correct DCEL for the overlay O (S1, S2)

Algorithm – handling an event point We update T and Q as in the case of segment intersection algorithm If event point involves segments from only one of S1 or S2, nothing else happens If not, we must create new half-edges in D This involves several possible case:  an edge of S1 crosses and edge of S2  an edge from S1 passes through a vertex of S2 (or vice versa)  a common vertex

Case 1 Before After S1 S2 Similarly in the case of more segments, going through one point v – event point

Case 1 Before After S1 S2 S1 S2 v – event point v

Case 1 Before After v – event point v e1'e1' e 1 '' e1e1 e2e2 e' 2 e'' 2 Updates to D: Next(e' 2 ) = e'' 1, Next(e'' 1 ) = Next (e 1 ), Prev(e' 1 )= Prev(e 1 ), and so on Next(e 1 ) Prev(e 1 ) Clockwise order around v to determine Next() and Prev()

Case 1 After v e1'e1' e 1 '' e' 2 e'' 2 Clockwise order around v to determine Next() and Prev()  It takes O(deg v) time to determine Next() and Prev() relationships around v  It takes constant time to determine Next() and Prev() relationships around every other vertex, involved in the event  Thus, in total (i.e. for all vertices of D) it takes sum of degrees of all vertices of D, which is O(k)

Case 2 Before After S1 S2 v – event point is a vertex of S1

Case 2 Before After S1 S2 v – event point is a vertex of S1 O(k) total time to determine Prev() and Next() relationships

Case 3 Before After S1 S2 event point is a vertex of both S1 and S2

Case 3 Before After S1 S2 event point is a vertex of both S1 and S2 O(k) total time to determine Prev() and Next() relationships

Total Time Let k be the complexity of D and n be the sum of complexities of S1 and S2 Then, according to the time required for the segment intersection algorithm, the previous part of the map overlay algorithm takes O(n log n + k log n) time

Some remarks During the plane sweep: 1. for each half-edge in D, we can record the corresponding half- edge from S1 or S2 - this will allow us to find the corresponding face record from S1 or S2 by looking at IncidentFace () 2.for each vertex v of S1 which does not belong to any edge of S2, we can determine a face of S2 that contains it by looking and the edges of S2 in the status T, immediately to the left and to the right of v (and vice versa, for each v of S2) 3.for each vertex we will record the half-edge of D that lies immediately to the left of the vertex with respect to the current position of the sweep line By traversing the edges of D, we can find all boundary cycles in O(k) time, where k is the complexity of D This will help us to create face records in D Moreover, using 1. and 2. from the above, for each new face record we will be able to find faces f1 and f2 of S1 and S2, respectively, such that f is the intersection of f1 and f2

Face records in D We know all boundary cycles of D Problem: which of them are outer boundaries of faces and which are inner cycles, i.e. boundaries of holes inside faces? It can be solved as follows  Look at the leftmost vertex of the cycle  If half-edges from the boundary of the cycle, that are incident to this vertex, form an angle < 180 o, it is outer cycle, otherwise it is an inner cycle

Face records in D Another Problem: which of outer cycles lie in a given inner cycle? To decide, we will construct a special graph G as follows:  vertices of G are boundary cycles  additional vertex corresponds to the imaginary outer boundary of the unbounded face  two vertices are joined by an edge if and only if one of the corresponding cycles is the boundary of a hole and the other cycle has a half-edge immediately to the left of the leftmost vertex of that hole cycle  if there is no such half-edge, then the vertex is linked to the vertex, corresponding to the unbounded face It takes O(k) time to construct G

Example Which half-edge is immediately to the left of v? Sweep line v e′e′ e′′

Example

Lemma 2.5 Each connected component of the graph G corresponds exactly to the set of cycles incident to one face Thus, we need to determine connected components of G It takes O(k) time to do it (using e.g. a depth-first search)

Total time required for map overlay Let n be the sum of complexities of S1 and S2 and k be the complexity of D Plan sweep: O (n log n + k log n) After the plane sweep:  Finding boundary cycles: O(k)  Constructing the graph: O(k)  Finding connected components of G: O(k)  Thus the total time is still O (n log n + k log n)

Algorithm MAPOVERLAY(S1,S2) Input. S1 and S2 stored as DCEL’s Output. The overlay of S1 and S2 stored in DCEL D  Copy DCEL’s for S1 and S2 to D  Plane sweep: compute all intersections between edges from S1 and S2  In addition, do the following during the plane sweep:  Update D if the event involves edges of both S1and S2 (create new half-edges and update Next() and Prev() info)  Store the half-edge immediately to the left of the event point at the vertex in D representing it (will be required later to create G)  For each v from S1 which does not belong to any edge of S2, record the face of S2 in which it is contained (and similarly for vertices of S2) Now D is the DCEL for O(S1,S2), except that the information about the faces has not been computed yet

 Determine the boundary cycles in O(S1,S2) by traversing D.  Construct the graph G whose vertices correspond to boundary cycles and whose edges connect each hole cycle to the cycle to the left of its leftmost vertex  Compute connected components of G  For each connected component in G Do  Let C be the unique outer boundary cycle in the component and let f denote the face bounded by this cycle  create a face record for f  set OuterComponent (f) to some half-edge of C  construct the list InnerComponents (f) consisting of pointers to one half-edge in each hole cycle in the component  let the IncidentFace() pointers of all half-edges in the cycles point to the face record of f  End Do  Label each face of O(S1,S2) with the names of the faces of S1 and S2 containing it