Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Introduction to Computational Geometry

Similar presentations


Presentation on theme: "An Introduction to Computational Geometry"— Presentation transcript:

1 An Introduction to Computational Geometry
Joseph S. B. Mitchell Stony Brook University

2 Point Location Point-in-polygon test: Is point q inside simple polygon P ? Naïve: O(n) per test CG: O(log n) q P n-gon 5 crossings  q inside

3 Point Location More generally: Search for which face of a planar map contains query point q Example: Map of Manhattan Applet q Trapezoid under the mouse is highlighted

4 One Method: Partition the Plane into Slabs
Query time : O(log n) binary search in x and then binary search in y direction. Storage space O(n2) n/2 n/2 Computational Geometry, WS 2007/08 Prof. Dr. Thomas Ottmann

5 Valuable Resources Preprocessing time
Memory/storage: how big is the data structure? Query time

6 Point Location in 1D Given a partition of the x-axis by a set of points {x1 , x2 , …}. Preprocess for location of a query point q: Sort the xi ‘s O(n log n) time, O(n) space, O(log n) query time Can we achieve these same bounds (optimal) in 2D?

7 An Optimal Method: Kirkpatrick Hierarchical Triangulation
Begin with full triangulation Remove a “large” set of low-degree ( 8) vertices that are independent (such a set always exists in a planar graph, by Euler) Retriangulate the resulting “holes” Repeat until only the big outer triangle remains Build DAG for searching (no two adjacent) O(n) “large” :  Cn  only O(log n) iterations

8 [O’Rourke, page 277] Proof uses Euler’s formula (f-e+v=2) and the fact that each vertex has degree at least 3 in our graph G.

9 Proof of Theorem 7.10.1 Sum of vertex degrees = ∑= 2E
Recall: in a planar n-vertex graph: E≤3n-6 Thus, ∑ ≤ 6n-12 Claim: There are ≥n/2 vertices of degree ≤8 Pf: Assume there are > n/2 vertices of deg ≥9 Then, sum of degrees of these is ≥ 9n/2, and the other vertices have deg ≥3, so the total degree sum, ∑, would satisfy: ∑ ≥ 9n/2+3n/2=6n Contradicts ∑ ≤ 6n-12

10 Independent Set Algorithm
Input: planar graph G Output: an independent set I of vertices of low degree (≤ 8) I ←Ø Mark vertices of G of degree ≥ 9 While some nodes are unmarked, do Choose an unmarked vertex v (lowest index) Mark v and all neighbors of v I ←I {v}

11 Analysis of Algorithm Each time we mark v, and the neighbors of v, the number of unmarked nodes goes down by at most 9 Thus, at least 1/9-th of the m unmarked (deg ≤8) vertices are added to I We know m ≥ n/2 Thus, I ≥ n/18 Thus, the Algorithm always gives an independent set of deg ≤8 vertices of size ≥ n/18 Initially: the unmarked vertices are those with deg≤8.

12 Kirkpatrick Example Full triangulation, T0 Triangles in T0

13 T0 Independent sets: {2,5} {3,7} {4} {6} T1

14 T2 T3 Independent sets: {2,5} {3,7} {4} {6} Final DAG hierarchy and search path for query point p T4

15 Another Example 4 Build Kirkpatrick hierarchy, for extra practice.
(note that vertex 2 has “high” degree) 10 5 2 8 9 3 6 1 7

16 Detecting if a unit disk contains a site: Why locating in Delaunay is not enough
From class discussion/review, 12/4/12

17 Example 4 cocircular points, but Delaunay diagram is a triangulation
From class discussion/review, 12/4/12

18 Examples: Recognizing a Voronoi Diagram
From class discussion/review, 12/4/12


Download ppt "An Introduction to Computational Geometry"

Similar presentations


Ads by Google