Lecture 6: Art Galleries and Polygon Triangulation

Simple Polygons: Today we begin study of the problem of triangulating polygons. We introduce this problem by way of a cute example in the field of combinatorial geometry. We begin with some definitions:
  1. A polygonal curve is a finite sequence of line segments, called edges joined end to end. The endpoints of the edges are vertices. For example, let v(0), v(1), ... ,v(n) denote the set of n + 1 vertices, and let e(1), e(2), ... , e(n) denote a sequence of n edges, where e(i) = v(i-1) to v(i) . A polygonal curve is closed if the last endpoint equals the first v(0) = v(n) .
  2. A polygonal curve is simple if it is not self intersecting. More precisely this means that each edge e(i) does not intersect any other edge, except for the endpoints it shares with its adjacent edges.


Figure 23: Polygonal curves, (left) a polygonal curve (middle) closed curve (right) simple, closed curve

The famous Jordan curve theorem states that every simple closed plane curve divides the plane into two regions (the interior and the exterior). (Although the theorem seems intuitively obvious, it is quite difficult to prove). We define a polygon to be the region of the plane bounded by a simple, closed polygonal curve. The term simple polygon is also often used to emphasize the simplicity of the polygonal curve. As usual, we will assume that the vertices are listed in counterclockwise order around the boundary of the polygon.

Art Gallery Problem
Victor Klee (who is not the artist Paul Klee), posed the following question: Suppose we have an art gallery whose floor plan can be modeled as a polygon with n vertices. As a function of n, what is the minimum number of guards that suffice to guard such a gallery?
First, another definition: We say that two points x and y in a simple polygon can see each other (or x and y are visible) if the open line segment xy lies entirely within the interior of P. If we think of a polygon as the floor plan of an art gallery, the problem asks where to place ``guards'', and how many guards to place, so that every point of the gallery is visible to some guard. (Pop quiz, how many guards are needed for a n-sided convex polygon?). We will first ask this question without knowing about the specific polygon. All you know about the polygon is the number of sides, not its actual structure. We want to know the fewest number of guards that suffice to guard all polygons with n sides.

Basic facts
Could there be polygons for which no finite number of guards suffice? It turns out that the answer is no, but the proof is not immediately obvious. You might consider placing a guard at each of the vertices. Such a set of guards will suffice in the plane. But to show how counterintuitive geometry can be, it is interesting to not that there are simple non-convex polyhedra in 3 space, such that even if you place a guard at every vertex there would still be points in the polygon that are not visible to any guard. (As a challenge, try to come up with one with the fewest number of vertices. spoiler after click.

An interesting question in combinatorial geometry is how does the number of guards needed to guard any simple polygon with n sides grow as a function of n? If you play around with the problem for a while (trying polygons with n = 3, 4, 5, 6 ... sides, for example) you will eventually come to the conclusion that floor(n/3) is the right value. The figure below shows a worst case example, where floor(n/3) guards are required. A cute result from combinatorial geometry is that this number always suffices. The proof is based on three concepts: polygon triangulation, dual graphs, and graph coloring. The remarkably clever and simple proof was discovered by Fisk.


Figure 24: Guarding sets.

Theorem: (The Art Gallery Theorem) Given a simple polygon with n vertices, there exists a guarding set with at most floor(n/3) guards.

Proof Sketch

  1. Triangulate the Polygon
  2. cleverly "color" the every node of the triangulation one of 3 colors.
  3. Choose whichever color is least, and argue that putting guards there is sufficient.
Before giving the proof, we explore some aspects of polygon triangulations. We begin by introducing a triangulation of P. A triangulation of a simple polygon is a planar subdivision of (the interior of) P whose vertices are the vertices of P and whose faces are all triangles. An important concept in polygon triangulation is the notion of a diagonal, that is, a line segment between two vertices of P that are visible to one another. A triangulation can be viewed as the union of the edges of P and a maximal set of non-crossing diagonals.

Lemma: Every simple polygon with n vertices has a triangulation consisting of n - 3 diagonals and n - 2 triangles.

We'll leave the proof as an exercise. The proof is based on the fact that given any n vertex polygon, with n >= 4 it has a diagonal. (This may seem utterly trivial, but actually takes a little bit of work to prove. In fact it fails to hold for polyhedra in 3 space.) The addition of the diagonal breaks the polygon into two polygons, of say m1 and m2 vertices, such that:
m1 + m2 = n + 2, (since both share the vertices of the diagonal).
Thus by induction, there are:
(m1 - 2) + (m2 - 2) = n + 2 - 4 = n - 2
triangles total. A similar argument holds for the case of diagonals.

It is a well known fact from graph theory that any planar graph can be colored with 4 colors. (The famous 4 color theorem.) This means that we can assign a color to each of the vertices of the graph, from a collection of 4 different colors, so that no two adjacent vertices have the same color. However we can do even better for the graph we have just described.

Lemma: Let T be the triangulation graph of a triangulation of a simple polygon. Then T is 3 colorable.

Proof: For every planar graph G there is another planar graph G' called its dual. The dual G' is the graph whose vertices are the faces of G, and two vertices of G' are connected by an edge if the two corresponding faces of G share a common edge. (Notice that there are exactly the same number of edges G, G'). Since a triangulation is a planar graph, it has a dual, shown in the figure below. (We do not include the external face in the dual.) Because each diagonal of the triangulation splits the polygon into two, it follows that each edge of the dual graph is a cut edge. This also means that the dual graph is a tree.


Figure 25: Polygon triangulation and a 3 coloring.

meaning that its deletion would disconnect the graph. As a result it is easy to see that the dual graph is a free tree (that is, a connected, acyclic graph), and its maximum degree is 3. (This would not be true if the polygon had holes.)


Figure 26: Dual graph of triangulation.

The coloring will be performed inductively. If the polygon consists of a single triangle, then just assign any 3 colors to its vertices. An important fact about any free tree is that it has at least one leaf (in fact it has at least two). Remove this leaf from the tree. This corresponds to removing a triangle that is connected to the rest triangulation by a single edge. (Such a triangle is called an ear.) By induction 3 color the remaining triangulation. When you add back the deleted triangle, two of its vertices have already been colored, and the remaining vertex is adjacent to only these two vertices. Give it the remaining color. In this way the entire triangulation will be 3 colored. We can now give the simple proof of the guarding theorem.

Proof: (of the Art Gallery Theorem:) Consider any 3 coloring of the vertices of the polygon. At least one color occurs at most n/3 time. (Otherwise we immediately get there are more than n vertices, a contradiction.) Place a guard at each vertex with this color. We use at most floor(n/3) guards. Observe that every triangle has at least one vertex of each of the three colors (since you cannot use the same color twice on a triangle). Thus, every point in the interior of this triangle is guarded, implying that the interior of P is guarded. A somewhat messy detail is whether you allow guards placed at a vertex to see along the wall. However, it is not a difficult matter to push each guard infinitesimally out from his vertex, and so guard the entire polygon.

Final Thoughts:

  1. There is an entire book about this problem here!
  2. Another presentation of this problem is available: here.
  3. The problem of: "Given an art gallery, find the optimal number of guards", is known to be NP-hard. What we've done here is proven that some art galleries may require up to n/3 guards, and the n/3 guards are sufficient for all art galleries. We did not present an optimal algorithm.
  4. If you are a complexity theory junkie, the problem is not only NP-Complete, but also "APX-hard", meaning it is hard even to get a good approximate answer (there is no polynomial time approximation scheme).
  5. Gallery w/ n edges and h holes requires (n+h)/3 guards.
  6. There are many related problems. One of them is the "Watchman Problem", to plan a route for a single watchman so that the route is short, and every part of the art gallery is available from somewhere on the route. For this problem there is a known O(n2) algorithm; a nice applet is here.



This course is modeled on the Computational Geometry Course taught by Dave Mount, at the University of Maryland. These notes are modifications of his Lecture Notes, which are copyrighted as follows: Copyright, David M. Mount, 2000, Dept. of Computer Science, University of Maryland, College Park, MD, 20742. These lecture notes were prepared by David Mount for the course CMSC 754, Computational Geometry, at the University of Maryland, College Park. Permission to use, copy, modify, and distribute these notes for educational purposes and without fee is hereby granted, provided that this copyright notice appear in all copies.