250 likes | 347 Views
Computational Geometry. Piyush Kumar (Lecture 10: Point Location). Welcome to CIS5930. Planar Point Location. Given a polygonal subdivision of the plane (a PSLG) , Preprocess to answer which face a query point lies in. Assume Input has n vertices. Step 1. Triangulate. Step 2.
E N D
Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930
Planar Point Location • Given a polygonal subdivision of the plane (a PSLG) , Preprocess to answer which face a query point lies in. Assume Input has n vertices.
Step 1 • Triangulate
Step 2 • Put the input in a large triangle and triangulate.
Timing • How much time did you spend yet? • Any ideas on how to locate a given point in such a subdivision? • Notice that each face is a triangle now, including the face containing the point at infinity.
By the way • Kirkpatrick’s subdivision hierarchy method for performing point location in planar graphs is also applicable • In higher dimensions • Amenable to parallelization • Uses? Many, Collision detection in 3D? • Beware: The algorithm has large constants.
Subdivision Hierarchy • Start with triangulated PSLG T0 • Produce a sequence of triangulations T0, T1, T2, … Tk where k=O(log n) such that • Tk contains a single triangle • Each triangle in Ti+1 overlaps only a constant number of triangles in Ti.
Subdivision hierarchy T5 T0 Courtesy Goodrich,Ramaiyer.
Observations • The degree of each node is O(1) • A fraction of the nodes are removed at each step. Hence the total depth of the DAG is O(log n).
Obsevation 1 • Constant degree Observation • When we delete a node with degree d, there is a hole of size d vertices which we can re-triangulate (with d-2 triangles). Each of the new triangles can overlap only d triangles in the previous triangulation. Trivial Example:
Observation 2 • Independent Set : No two vertices that are deleted are adjacent to each other (the vertices to be deleted form an independent set in the current graph Ti. • White nodes are the one to be deleted next.
Observation 2 • Independent set removal: Is easy. These vertices create independent holes that can be triangulated independently of each other. Note that the size of these holes is O(1). Maximum size hole created in this example is 4.
Independent set • We need to make sure that we have large independent set of vertices with bounded (O(1)) degree in a triangulated planar graph. • We want to remove a fraction of the vertices at each step. Hence the total number of layers in the DAG will be O(log n).
Kirkpatrick’s Method • Find a maximal independent set in the PSLG such that the degree of the vertices is bounded by O(1). • Remove vertices of the independent set from the PSLG and re-triangulate (the holes) • Repeat the process until only the outer face remains. Maximal Ind. Set : A set of independent vertices of a graph G such that no new vertex can be added to this set keeping the independence property
Search for Maximal independent set • Lemma: Given a planar graph with n vertices, there is an independent set consisting of vertices of degree at most 8, with at least n/18 vertices. This independent set can be constructed in O(n) time. See page 106 of Dr. Mount’s Lecture notes
Average degree of a vertex Hence, average degree of a vertex < 6.
At least n/2 vertices of degree <= 8 • Proof by contradiction : • Let there be more than n/2 vertices of degree 9 or greater. The other vertices must have degree > 3 (Assuming n > 3). • Hence average degree now would be ( 9n/2 + 3n/2 ) / n = 6. • This is a contradiction since average degree should be < 6.
Search Algorithm for Maximal independent set • Mark all nodes with degree >= 9 • Note: At least n/2 unmarked nodes. • While there exists an unmarked node • Choose unmarked vertex v • Add v to independent set • Mark v and all its neighbors. • Note: At most 9 vertices marked. (n/2)/9 = n/18 How many times can we run this loop before we run out of unmarked vertices?
Search Algorithm for Maximal independent set • Note that in each iteration of the loop we add one vertex in our independent set. So we get at least a n/18 size independent set with degree of vertices <= 8 in it. (Proves our main lemma). • Why does this run in O(n) time?
Height of the DAG? • At each successive level, the number of vertices falls by a factor of (17/18)n. • Hence the total height of the DAG is • k = log18/17n = O(log n) • What about total space taken by the data structure? • O(n) Why? In each level you reduce the size of the data by a constant fraction
Size of the data structure • Size proportional to total number of triangles • Number of triangles in each layer proportional to the number of vertices. • Sum of number of vertices
Summary • Space required by DAG = O(n) • Query Time: O(log n) • Preprocessing time: O(n)