Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
Computational Geometry
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
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.
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.
Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp th CGC Workshop.
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
17. Computational Geometry Chapter 7 Voronoi Diagrams.
Orthogonal Range Searching Computational Geometry, WS 2006/07 Lecture 13 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
6/2/ :35 AMIncremental Convex Hull1 q w u e zt.
Delaunay Triangulation Computational Geometry, WS 2006/07 Lecture 11 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
1 Lecture 8: Voronoi Diagram Computational Geometry Prof. Dr. Th. Ottmann Voronoi Diagrams Definition Characteristics Size and Storage Construction Use.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
Lecture 5: Orthogonal Range Searching Computational Geometry Prof. Dr. Th. Ottmann 1 Orthogonal Range Searching 1.Linear Range Search : 1-dim Range Trees.
Special Cases of the Hidden Line Elimination Problem Computational Geometry, WS 2007/08 Lecture 16 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
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.
Lecture 10 : Delaunay Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Overview Motivation. Triangulation of Planar Point Sets. Definition.
Persistent Data Structures Computational Geometry, WS 2007/08 Lecture 12 Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut.
Geometric Data Structures Computational Geometry, WS 2007/08 Lecture 13 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Hidden-Line Elimination Computational Geometry, WS 2006/07 Lecture 14 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
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.
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Voronoi Diagrams.
Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 1 Geometric Data Structures 1.Rectangle Intersection 2.Segment.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Duality and Arrangements Computational Geometry, WS 2006/07 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Brute-Force Triangulation
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.
March Trapezoidal Maps Shmuel Wimer Bar Ilan Univ., School of Engineering.
Point Location Dmitry Rusakov Boris Kronrod. Planar Point Location Lets S be a planar subdivision with n edges. The planar point location problem is.
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.
14/13/15 CMPS 3130/6130 Computational Geometry Spring 2015 Windowing Carola Wenk CMPS 3130/6130 Computational Geometry.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
An Introduction to Computational Geometry Joseph S. B. Mitchell Stony Brook University.
Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
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.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
February 17, 2005Lecture 6: Point Location Point Location (most slides by Sergi Elizalde and David Pritchard)
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.
Polygon Triangulation
Computational Geometry
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry
An Introduction to Computational Geometry
Orthogonal Range Searching and Kd-Trees
CMPS 3130/6130 Computational Geometry Spring 2017
I. The Problem of Molding
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry
Presentation transcript:

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized, incremental algorithm for the construction of the trapezoidal decomposition. 4.Analysis.

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 2 Point location in a map

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 3 Partition of the plane into slabs Query time : O(log n) binary search in x and then binary search in y direction. Storage space O(n 2 ) n/2

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 4 Partitioning into Trapezoids Assumption : Segments are in „general position“ Observation : Every vertical edge has one point in common with a segment end. R

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 5 Observations R f f is convex f is bounded Every non - vertical side of f is part of a segment of S or an edge of R

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 6 Trapezoidal decomposition of set of line segments Lemma : Each face in a trapezoidal map of a set S of line segments in general position has 1 or 2 vertical sides and exactly two non-vertical sides

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 7 For every trapezoid Δ  T(S), except the left most one, the left vertical edge of Δ is defined by a segment endpoint p, denoted by leftp(Δ). R Left edge of a trapezoid

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 8 5 Cases (For left edge of a trapezoid) a) top(  ) bottom(  ) leftp(  ) b) leftp(  ) top(  ) d) leftp(  ) top(  ) c) leftp(  ) top(  ) bottom(  ) e) It is left edge of R. This case occurs for a single trapezoid of T(S) only, namely the unique leftmost trapezoid of T(S)

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 9 Size of the trapezoidal map Theorem: The trapezoidal map T(S) of a set of n line segments in general position contains at most 6n + 4 vertices and at most 3n + 1 trapezoids. Proof (1):A vertex of T(S) is either - a vertex of R or 4 - an endpoint of a segment in S or2n - a point where the vertical extension starting in an endpoint abuts on another segment or on the boundary R. 2 * (2n) 6n + 4

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 10 Proof (2): Each trapezoid has a unique point leftp(  ), which is - the lower left corner of R - the left endpoint of a segment (can be leftp(  ) of at most two different trapezoids) - the right endpoint of a segment (can be leftp(  ) of atmost one trapezoid) 1 2n n 3n + 1 Theorem: The trapezoidal map T(S) of a set of n line segments in general position contains at most 6n + 4 vertices and at most 3n + 1 trapezoids. Size of the trapezoidal map

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 11 Adjacent trapezoids Two trapezoids  and  ´ are adjacent if they meet along a vertical edge.  11 22 33 44 55  11 22 33 44 55 66 1)Segments in general position : A trapezoid has atmost four adjacent trapezoids 2) Segments not in general position : A trapezoid can have an arbitrary number of adjacent trapezoids.

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 12 Vertical neighbors: Upper, lower left neighbor Trapezoid  ' is (vertical) neighbor of  top(  ) = top(  ’) or bottom(  ) = bottom(  ’) In the first case  ´ is upper left neighbor of , in the second case  ´ is lower left neighbor of .

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 13 Representing trapezoidal maps There are records for all line segments and endpoints of S, the structure contains records for trapezoids of T(S), but not for vertices or edges of T(S). The record for trapezoid  stores pointers to top(  ), and bottom(  ), pointers to leftp(  ) and rightp(  ) and finally pointers to its atmost 4 neighbors.  is uniquely defined by top(  ), bottom(  ), leftp(  ) and rightp(  ).

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 14 A search structure A B C D F E G 1l 1r 2l 2r A B C D E F G 1l 1r 2r 2l End points decide between left, right Segments decide between below, above

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 15 Example : Search structure A B C D F E G 1l 1r 2l 2r

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 16 A randomized incremental algorithm Input : A set S of n non-crossing line segments Output : The trapezoidal map T(S) and a search structure D(S) for T(S) in a bounding box. Determine a bounding box R, initialize T and D Compute a random permutation s 1,s 2,..., s n of the elements of S for i = 1 to n do add s i and change T(S i - 1 ) into T(S i ) and D(S i -1 ) into D(S i ) Invariant : In the step i T(S i ) is correct trapezoidal map of S i and D(S i ) is an associated search structure.

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 17 A randomized incremental algorithm Input : A set of n non-crossing line segments Output : The trapezoidal map T(S) and a search structure D for T(S) in a bounding box. Determine a bounding box R, initialize T and D Compute a random permutation s 1,s 2,..., s n of the elements of S for i = 1 to n do Find the set  0,  1,...,  k of trapezoids in T properly intersected by s i. Remove  0,  1,...,  k from T and replace them by new trapezoids that appear because of the intersection of s i. Remove the leaves for  0,  1,...,  k from D and create leaves for the new Trapezoids. Link the new leaves to the existing inner nodes by adding some new inner nodes.

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 18 Questions How can we find the intersecting trapezoids? How can T and D be updated a) if new segment intersects no previous trapezoid b) if new segment intersects previous trapezoids

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 19 Finding the intersecting trapezoids 00 sisi 11 22 33  j+1 is lower right neighbour of  j In T(S i ) exactly those trapezoids are changed, which are intersected by s i if rightp(  j ) lies above s i then Let  j+1 be the lower right neighbor of  j. else Let  j+1 be the upper right neighbor of  j Clue :  0 can be found by a query in the search structure D(S i -1 ) constructed in iteration stage i -1.

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 20 New segment completely contained in trapezoid t p q s Decomposition A C B D T(S i-1 ) T(S i ) Search structure D(S i-1 ) t A B CD p q s 4 new trapezoids, -1 old trapezoid, search depth + 3

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 21 New segment intersects previous ones p q t0 t1 t2 t3 s T(S i - 1 ) Decomposition F A B C E D T(S i ) t0t1t2t3 D(S i - 1 ) Search structure D(S i ) A B C D E F sssq s 6 new trapezoids, – 4 old, depth + 2

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 22 Estimation of the depth of the search structure Let S be a set of n segments in general position, q be an arbitrary fixed query point. Depth of D(S): worst case : 3n, average case : O(log n) Consider the path traversed by the query for q in D Let X i = # of nodes on the search path for q created in iteration step i. X i <= 3 P i = probability that there exists node on the search path for q that is created in iteration step i. E[X i ] <= 3 P i

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 23 Observation Iteration step i contributes a node to the search path for q exactly if  q (S i - 1 ), the trapezoid containing q in T(S i - 1 ), is not the same as  q (S i ), the trapezoid containing q in T(S i ) P i = Pr[  q (S i )   q (S i - 1 )]. If  q (S i ) is not same as  q (S i - 1 ), then  q (S i ) must be one of the trapezoids created in iteration i.  q (S i ) does not depend on the order in which the segments in S i have been inserted. Backwards analysis : We consider T(S i ) and look at the probability that  q (S i ) disappears from the trapezoidal map when we remove the segment s i.  q (S i ) disappears if and only if one of top(  q (S i )), bottom(  q (S i )), leftp(  q (S i )), or right(  q (S i )) disappears with removal of s i.

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 24 Prob[top(  q (S i ))] = Prob[bottom(  q (S i ))] = 1/i. Prob[leftp(  q (S i ))] disappears is at most 1/i. Prob[rightp(  q (S i ))] disappears is at most 1/i. P i = Pr[  q (S i )   q (S i - 1 )] = Pr[  q (S i )  T(S i - 1 )] <= 4/i

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 25 Analysis of the size of search structure Leaves in D are in one – to – one correspondence with the trapezoids in , of which there are O(n). The total number of nodes is bounded by : (# of inner nodes created in iteration step i) The worst case upper bound on the size of the structure

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 26 Analysis of the size of search stucture Theorem: The expected number of nodes of D is O(n). Proof: The # of leaves is in O(n). Consider the internal nodes: X i = # of internal nodes created in iteration step i if  disappears from T(S i ) when s is removed from S i otherwise There are at most four segments that cause a given trapezoid to disappear

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 27 The expected number of newly created trapezoids is O(1) in every iteration of the algorithm, from which the O(n) bound on the expected amount of storage follows.

Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 28 Summary Let S be a planar subdivision with n edges. In O(n log n) expected time one can construct a data structure that uses O(n) expected storage, such that for any query point q, the expected time for a point location query is O(log n).