200 likes | 433 Views
Art Gallery Theorem. Computational Geometry, WS 2006/07 Lecture 8, Part 1 Prof. Dr. Thomas Ottmann. Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg. Agenda. Motivation: Guarding art galleries
E N D
Art Gallery Theorem Computational Geometry, WS 2006/07 Lecture 8, Part 1 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für Angewandte Wissenschaften Albert-Ludwigs-Universität Freiburg
Agenda • Motivation: Guarding art galleries • Art gallery theorem for simple polygons • Partitioning of polygons into monotone pieces • Triangulation of y-monotone polygons Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Guarding art galleries Problem Definition Imagine an art gallery room whose floor plan can be modeled by a polygon of n vertices. Victor Klee asked (1973): How many stationary guards are needed to guard the room? Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Guarding art galleries • The gallery is represented by a simple polygon • A guard is represented by a point within the polygon • Guards have a viewport of 360°, and of course cannot see through a wall • A polygon is completely guarded, if every point within the polygon is guarded by at least one of the watchmen • Visibility polygon: • The visibility polygon of a polygon P is defined by the set of all points that are visible from a base point p. • Demo Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Guarding art galleries Even if two polygons have the same number of vertices, one may be easier to guard than the other. We are NOT interested in the minimum number of guards for a specific polygon, but rather want to determine the number of guards that suffice for an arbitrary polygon with n vertices. Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Guarding art galleries If the polygon is complex, it is not obvious to see how many gurads are needed. Idea: Divide the polygon into pieces that are easy to guard Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Guarding a triangulated polygon Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Triangulation of simple polygons Does every simple polygon admit a triangulation? If yes, what is the number of triangles? Does any triangulation of a polygon P lead to the same number of triangles? Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Theorem Theorem: Every simple polygon admits a triangulation. Proof: By induction on n. Let n>3, and assume theorem is truefor all m<n. Let P be polygon with n vertices. We first prove the existence of a diagonal in P. Let v be leftmostvertex of P. Let u and v be two neighboring vertices of v.If uw lies in the interior of P we have found a diagonal. Else, there are one or more vertices inside the triangle defined by u, v, and w. Let v´ be the farthest vertex from uw. The segment connecting v´ to v cannot intersect an edge of p (contradicts the definition of v´). Hence vv´ is a diagonal. Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Case 2: uw not completely in P w w v u v u Proof of Diagonal Consider leftmost vertex v of P Case 1: uw completely in P Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Diagonals and Triangulation So a diagonal exists. Any diagonal cuts P in two simple sub-polygons P1 and P2. Let m1 be the number of vertices of P1and m2 the number of vertices of P2. Both m1 and m2 mustbe smaller than n, so by induction hypothesis P1 and P2 can be triangulated so P can be triangulated as well. Back to the questions Does any triangulation of a polygon P lead to the same number of triangles? If yes, what is the number of triangles? Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Theorem Theorem:Any triangulation of P contains n-2 triangles. Proof:By induction on n. n=3 trivial. Let n>3, and assume theorem is true for all m<n.Consider an arbitrary diagonal in some triangulation Tp.This diagonal cuts P into 2 subpolygons with m1 and m2 vertices: m1 + m2 = n + 2. So by induction hypothesis any triangulation of Picontains mi - 2 triangles (m1 - 2) + (m2 - 2) = n - 2 triangles. Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Upper and lower bounds for the number of guards We know that for any simple polygon with n vertices n-2 guards are always enough. But can we do better? Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Upper and lower bounds for the number of guards Idea: Compute a 3-coloring of the vertices and place guards on nodes with the least-frequently used color. No two nodes connected by an edge are assigned the same color. -> Every triangle has all 3 colors. Hence every triangle is watched. Hence the entire polygon is watched. Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Example Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
b c 3- coloring Theorem: The triangulation graph of a polygon P is 3-colorable. Proof: Induction on n. Clearly, a triangle can be 3-colored. Let n>3, and assume theorem is true for all m<n. By Meister’s Two Ears Theorem, P has an ear abc. a Corollary: n/3guards are always sufficient to guard a simple Polygon with n vertices. Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Art gallery theorem For a simple polygon with n vertices, n/3 cameras are occasionally necessary and always sufficient to have every point in the polygon visible from at least one of the cameras. Worst-case example? Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann
Worst-case example Demo Computational Geometry, WS 2006/07 Prof. Dr. Thomas Ottmann