Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930.

Similar presentations


Presentation on theme: "Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930."— Presentation transcript:

1 Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930

2 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.

3 Step 1 Triangulate

4 Step 2 Put the input in a large triangle and triangulate.

5 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.

6 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.

7 Subdivision Hierarchy Start with triangulated PSLG T 0 Produce a sequence of triangulations T 0, T 1, T 2, … T k where k=O(log n) such that  T k contains a single triangle  Each triangle in T i+1 overlaps only a constant number of triangles in T i.

8 Subdivision hierarchy Courtesy Goodrich,Ramaiyer. T0T0 T5T5

9 Search Structure: Layered DAG T0T0 T3T3

10 Observations 1.The degree of each node is O(1) 2.A fraction of the nodes are removed at each step. Hence the total depth of the DAG is O(log n).

11 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:

12 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 T i. White nodes are the one to be deleted next.

13 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.

14 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).

15 Kirkpatrick’s Method 1.Find a maximal independent set in the PSLG such that the degree of the vertices is bounded by O(1). 2.Remove vertices of the independent set from the PSLG and re-triangulate (the holes) 3.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

16 John Iacono’s Demo

17 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

18 Average degree of a vertex

19 Hence, average degree of a vertex < 6.

20 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.

21 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. oNote: At most 9 vertices marked. How many times can we run this loop before we run out of unmarked vertices? (n/2)/9 = n/18

22 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?

23 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 = log 18/17 n = 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

24 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

25 Summary Space required by DAG = O(n) Query Time: O(log n) Preprocessing time: O(n)


Download ppt "Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930."

Similar presentations


Ads by Google