The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple...

62
Computational Geometry [csci 3250] Laura Toma Bowdoin College

Transcript of The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple...

Page 1: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Computational Geometry [csci 3250]

Laura Toma

Bowdoin College

Page 2: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

The Art Gallery Problem

Page 3: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery.

The Art Gallery Problem

Page 4: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery.

The Art Gallery Problem

What does the guard see?

Page 5: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery.

The Art Gallery Problem

What does the guard see?

We say that two points a, b are visible if segment ab stays inside P (touching boundary is ok).

Page 6: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery.

The Art Gallery Problem

What does the guard see?

We say that two points a, b are visible if segment ab stays inside P (touching boundary is ok).

Page 7: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery.

The Art Gallery Problem

What does the guard see?

Page 8: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

We say that a set of guards covers polygon P if every point in P is visible to at least one guard.

The Art Gallery Problem(s)

Examples:

Does the point guard the triangle?

Page 9: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

We say that a set of guards covers polygon P if every point in P is visible to at least one guard.

The Art Gallery Problem(s)

Examples:

Can all triangles be guarded with one point?

Page 10: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

We say that a set of guards covers polygon P if every point in P is visible to at least one guard.

The Art Gallery Problem(s)

Examples:

Does the point guard the quadrilateral?

Page 11: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

We say that a set of guards covers polygon P if every point in P is visible to at least one guard.

The Art Gallery Problem(s)

Examples:

Can all quadrilaterals be guarded with one point?

Page 12: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Questions:

1. Given a polygon P of size n, what is the smallest number of guards (and their locations) to cover P?

The Art Gallery Problem(s)

Page 13: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Questions:

1. Given a polygon P of size n, what is the smallest number of guards (and their locations) to cover P?

The Art Gallery Problem(s)

Page 14: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Questions:

1. Given a polygon P of size n, what is the smallest number of guards (and their locations) to cover P?

The Art Gallery Problem(s)

NP-Complete

Page 15: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Questions:

1. Given a polygon P of size n, what is the smallest number of guards (and their locations) to cover P?

2. Klee’s problem: Consider all polygons of n vertices, and the smallest number of guards to cover each of them. What is the worst-case?

The Art Gallery Problem(s)

NP-Complete

Page 16: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Notation • Let Pn: polygon of n vertices • Let g(P) = the smallest number of guards to cover P • Let G(n) = max { g(Pn) | all Pn}.

• In other words, G(n) is sometimes necessary and always sufficient to guard a polygon of n vertices.

• G(n) is necessary: there exists a Pn that requires G(n) guards • G(n) is sufficient: any Pn can be guarded with G(n) guards

• Klee’s problem: find G(n)

Klee’s problem

Page 17: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Our goal (i.e. Klee’s goal) is to find G(n).

Trivial bounds • G(n) >= 1 : obviously, you need at least one guard.

• G(n) <= n : place one guard in each vertex

Klee’s problem: find G(n)

Page 18: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

n=3

Klee’s Problem

G(3) = 1

Any triangle needs at least one guard. One guard is always sufficient.

Page 19: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

n=4

Klee’s Problem

G(4) = 1

Any quadrilateral needs at least one guard. One guard is always sufficient.

Page 20: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

n=5

Klee’s Problem

G(5) = ?

Can all 5-gons be guarded by one point?

Page 21: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

n=5

Klee’s Problem

G(5) = 1

Page 22: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

n=6

Klee’s Problem

G(6) = ?

A 6-gon that can’t be guarded by one point?

Page 23: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

n=6

Klee’s Problem

G(6) = 2

Page 24: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

G(n) = ?

Come up with a Pn that requires as many guards as possible.

Klee’s Problem

Page 25: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

G(n) = ?

Come up with a Pn that requires as many guards as possible.

Klee’s Problem

Page 26: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

G(n) = ?

Come up with a Pn that requires as many guards as possible.

Klee’s Problem

Page 27: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

n/3 necessary

Klee’s Problem

Page 28: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

It was shown that n/3 is also sufficient. That is,

Any Pn can be guarded with at most n/3 guards.

• (Complex) proof by induction • Subsequently, simple and beautiful proof due to Steve Fisk, who was Bowdoin

Math faculty. • Proof in The Book.

Klee’s Problem

Page 29: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does
Page 30: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

1. Any simple polygon can be triangulated.

2. A triangulated simple polygon can be 3-colored.

3. Observe that placing the guards at all the vertices assigned to one color guarantees the polygon is covered.

4. There must exist a color that’s used at most n/3 times. Pick that color and place guards at the vertices of that color.

Fisk’s proof of sufficiency

Page 31: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Claim: Any simple polygon can be triangulated.

Fisk’s proof of sufficiency

Page 32: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Given a simple polygon P, a diagonal is a segment between 2 non-adjacent vertices that lies entirely within the interior of the polygon.

Polygon triangulation

Page 33: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Claim: Any simple polygon can be triangulated.

Proof idea: induction using the existence of a diagonal. Later.

Polygon triangulation

Page 34: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Fisk’s proof of sufficiency

Page 35: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 36: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 37: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 38: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 39: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 40: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 41: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 42: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 43: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 44: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 45: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 46: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 47: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 48: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 49: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 50: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 51: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Fisk’s proof of sufficiency

1. Any simple polygon can be triangulated

2. Any triangulation of a simple polygon can be 3-colored.

Page 52: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

• Placing guards at vertices of one color covers P.

Fisk’s proof of sufficiency

Page 53: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

• Placing guards at vertices of one color covers P.

Fisk’s proof of sufficiency

Page 54: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

• Placing guards at vertices of one color covers P. • Pick least frequent color! At most n/3 vertices of that color.

Fisk’s proof of sufficiency

Page 55: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

The proofs

Page 56: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

1. Any polygon can be triangulated

2. Any triangulation can be 3-colored

3. Observe that placing the guards at all the vertices assigned to one color guarantees the polygon is covered.

4. There must exist a color that’s used at most n/3 times. Pick that color and place guards at the vertices of that color.

Fisk’s proof of sufficiency

Page 57: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Claim: The set of red vertices covers the polygon. The set of blue vertices covers the polygon. The set of green vertices covers the polygon.

Proof:

Page 58: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

There are n vertices colored with one of 3 colors.

Claim: There must exist a color that’s used at most n/3 times.

Proof:

Page 59: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Theorem: Any triangulation can be 3-colored.

Proof:

Page 60: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Theorem: Any simple polygon has at least one convex vertex.

Proof:

Polygon triangulation

Page 61: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Theorem: Any simple polygon with n>3 vertices contains (at least) a diagonal.

Proof:

Polygon triangulation

Page 62: The Art Gallery Problem - Bowdoin College · Imagine an art gallery whose floor plan is a simple polygon, and a guard (a point) inside the gallery. The Art Gallery Problem What does

Theorem: Any polygon can be triangulated

Proof: