160 likes | 545 Views
Art Gallery Theorems Shih-Heng Chin Contents Introduction Theorems A Straightforward Method An Advanced Method Introduction
E N D
Art Gallery Theorems Shih-Heng Chin
Contents • Introduction • Theorems • A Straightforward Method • An Advanced Method
Introduction • Determine the minimum number of guards sufficient to cover the interior or an n-wall art gallery. [Question posted by Victor Klee in 1973 and responded by Vasek Chvátal in 1975]
Introduction (cont.) • What shape can place just a guard/camera? • Convex Polygon • What kinds of polygon is always convex? • Triangles • So the problem is how to split a polygon in to triangles = Triangulation, and how to set guards/cameras on these triangles
Theorems • Every simple polygon (without intersections and holes) with n vertices consists of exactly n – 2 triangles. [proof] • For a simple polygon with n vertices, need at least floor(3/n) cameras. [3-coloring approach]
A Straightforward Method • Two Ears Theorem: Any simple polygon has two ears [proof] • Triangulate(P){ for v in P: if is_a_ear_at(v): make_diagonal(pre(v), next(v)) P = P – v}
A Straightforward Method (cont.) • is_a_ear_at(v){ ear = triangle(v, pre(v), next(v)) if intersect(ear, line(pre(v), pre(pre(v)))) or intersect(ear, line(next(v), next(next(v)))): return false for e in {edges of (P – v – pre(v) – next(v))}: if intersect(e, line(pre(v), next(v))): return false return true}
An Advanced Method • Split a simple polygon into y-monotone pieces • Split monotone pieces into triangles A polygon P, for all lines l parallel to y = 0, if the number of intersected line segment of P and l is at most 1, P is y-monotone
Monotone Partitioning • sort vertices by decreasing height • remove upward-pointing interior splitting vertices • remove downward-pointing interior splitting vertices
Monotone Partitioning (cont.) • Remove upward-pointing interior splitting verticesS = [e0, v0]{S in the pattern …[ej-1, wj-1], [ej, wj], [ej+1, wj+1], [ej+2, wj+2]…} for i = 1 to n – 1 do j = index of edge which closest to vi case type_of_v(vi): 1: S = … [ej-1, vi], [ej+2, wj+2] … 2: S = … [ej-1, vi], [e’, vi], [ej+1, wj+1] … 3: S = … [ej, vi], [e’, vi], [e’’, vi], [ej+1, wj+1] … if angle of vi > 180 then draw (vi, wj) e j v i e e e’ j+1 j-1 w v i e e e’’ e’ j+1 j-1
Split monotone pieces into triangles • Sort vertices by decreasing y-xoordinate • Scan vertices and draw diagonal Case 1: Case 2:
Analyze • Two ears throrem: O(n2) • Y-monotone: O(nlogn) + O(r)r: number of vertices in all monotone pieces
Convex • A subset S of the plane is called convex if and only if for any pair of points p,q in S the line segment pq is completely contained is S. [back] Convex Not convex
3-Coloring Approach [back]