Gabriela Cretu
Gayatri Swamynathan
Stephanie Taylor

CS235 Project: Optimal Covering of Art Gallery

Problem Statement:

Given a simple polygon, determine the minimum number of guards that can watch its edges, vertices, and interior.

Introduction:

The art gallery problem was introduced by Victor Klee in 1973 in a discussion with Vasek Chvatal.  An art gallery is modeled as a polygonal region in the plane. A guard (camera position) in the gallery corresponds to a point in the polygon. Given a guard with 360 degrees vision, the problem is to determine the minimum number of guards required to cover the gallery.

Finding the minimal cover of any specific polygon is NP-hard.  There is a well-known approach to finding a guard cover that guarantees no more than n/3 guards - triangulate the polygon, three-color the vertices, and place guards on the vertices with the least-frequently occurring color.  From this, we have the Art Gallery Theorem: For a simple polygon with n vertices, floor(n/3) cameras are occasionally necessary and always sufficient to have every point in the polygon visible from at least one of the cameras.

We looked for other theoretical work regarding the Art Gallery Problem.  Most notable was "Optimal Guarding of Polygons and Monotone Chains"1., in which the authors discussed techniques for guarding monotone chains with guards on the vertices.  But they dealt with the monotone chains separately.  In a polygon, the chains of vertices might interfere with each other (a guard might not be able to see other vertices on its own chain because the other chain has come between the guard and its charge.  So, we decided to use monotone subdivision, but to develop an algorithm that would examine both the upper and lower chain at the same time.

Another paper, "Guarding the walls of an art gallery,"2. was about solving the edge-covering problem rather than the interior-covering problem.  It contained analysis of the complexity of both problems (and their relationship to each other).  It turns out that finding the minimal edge cover is also NP-hard.

We have developed an algorithm that is not optimal, but is generally pretty close to optimal (using visual inspection to determine optimal).  We use a more informed approach than triangulation, because we use information about the convexity/concavity of the vertices.  When there are many convex vertices (like in the layouts of actual buildings), our algorithm out-performs triangulation.  We do not guarantee a maximum of n/3 guards, but experimental evidence shows it will be <= n/3 at least 74% of the time.

Definition:

Monotone Polygon - An x-monotone polygon is a simple polygon with the following property: if you sweep a vertical line from the leftmost point to the rightmost point, the line will intersect with exactly two segments.

Algorithm:

Our approach is based on two observations:
  1. Monotone polygons are useful:  If we know something about the structure of our polygon, we can more easily determine is visible to a single guard.  We have only to deal with two concave chains - so if we know what is happening on each chain, then we know what is happening with all the vertices.
  2. One guard can see an entire convex polygon.  Likewise, one guard can cover a convex part of a polygon.
So, we divide the polygon into monotone subpolygons.  Then, we place guards on concave vertices.

The algorithm consists of three phases:

Two of the largest problems with our approach are:

  1. We can miss the big picture:  By not looking at the original polygon as a whole, we may place guards in one monotone polygon that can actually see large areas in another monotone polygon.



  2. If there is a concave chain (three or more adjacent concave vertices), then it might be optimal to place a guard on a vertex on the opposite chain.  Depending upon the polygon, it could be the case that all of the vertices on the concave chain can be seen by one guard.  This is difficult to handle because we have two chains to deal with at once.  We can detect a concave chain, and we can decide to place guards on the opposite chain, but we may run into problems if we have concave vertices on that chain.


Overall Complexity : O(N log N)

Future Improvements:

Project Demo: The Graphical User Interface

Generating the Polygon

User will input vertices of the polygon by clicking the mouse. Successive mouse clicks will generate edges of the polygon. The following needs to be ensured:
  1. No intersection: In order to ensure that the dynamically-generated polygon is simple, we will check that no two edges of the polygon intersect.
  2. No collinearity: Three collinear vertices will not be allowed.
On inputting the final vertex, the user will click the “Close Polygon” button provided. “Close Polygon” will connect the first and the final vertices of the polygon, again ensuring that intersection and collinearity does not result.

Output

Once the polygon has been plotted on the screen or read in from the testbed, it will be covered with guards. The vertices with guards placed on them will be highlighted, and lines will partition the original polygon into guarded areas.

References:

1. Danny Z. Chen Vladimir Estivill-Castro y Jorge Urrutia, "Optimal Guarding of Polygons and Monotone Chains"
    http://www.site.uottawa.ca/~jorge/online_papers/

2. Guarding the walls of an art gallery (Aldo Laurentini). 

3. M.de Berg, M. van Kreveld, M. Overmars, M.Schwarzkopf ,
Computational Geometry: Algorithms and Applications.