Suppose a 2D map of an art gallery is given by a polygon ,
having
corners (vertices) and
walls (edges). If a
watchman sees everything that lies on a straight line from his
position, then the maximal number of guards needed is
[12]. Finding
the minimum number of watchmen needed for this task is NP hard,
since it can be reduced to the 3-SAT problem [12].
Banos et al. reduce the art gallery problem to set cover and
approximate the latter one. Set cover is defined as follows:
Given a pair
, where
is some finite set.
is a
subset of the power set of
, i.e.,
and
. Find the
, such that
and the set
has a minimum number of
elements. The reduction of the art gallery to the set cover
problem is randomized and can be stated as:
1.
Generate randomly
candidate positions in the interior of
the polygon (map).
2.
Calculate for all candidate positions the part of the polygon
that is visible.
3.
Approximate the set cover problem, i.e., find a minimal set of
candidate positions from which the entire polygon is visible.
A greedy algorithm approximates the set cover problem fast and
with a good approximation ratio.