In geometry, a covering of a polygon is a set of primitive units (e.g. squares) whose union equals the polygon. A polygon covering problem is a problem of finding a covering with a smallest number of units for a given polygon. This is an important class of problems in computational geometry. There are many different polygon covering problems, depending on the type of polygon being covered. An example polygon covering problem is: given a rectilinear polygon, find a smallest set of squares whose union equals the polygon.
In some scenarios, it is not required to cover the entire polygon but only its edges (this is called polygon edge covering) or its vertices (this is called polygon vertex covering).
In a covering problem, the units in the covering are allowed to overlap, as long as their union is exactly equal to the target polygon. This is in contrast to a packing problem, in which the units must be disjoint and their union may be smaller than the target polygon, and to a polygon partition problem, in which the units must be disjoint and their union must be equal to the target polygon.
A polygon covering problem is a special case of the set cover problem. In general, the problem of finding a smallest set covering is NP-complete, but for special classes of polygons, a smallest polygon covering can be found in polynomial time.
A covering of a polygon is a collection of maximal units, possibly overlapping, whose union equals .
A minimal covering is a covering that does not contain any other covering (i.e. it is a local minimum).
A minimum covering is a covering with a smallest number of units (i.e. a global minimum). Every minimum covering is minimal, but not vice versa.
A rectilinear polygon can always be covered with a finite number of vertices of the polygon.[1] The algorithm uses a local optimization approach: it builds the covering by iteratively selecting maximal squares that are essential to the cover (i.e., contain uncovered points not covered by other maximal squares) and then deleting from the polygon the points that become unnecessary (i.e., unneeded to support future squares). Here is a simplified pseudo-code of the algorithm:
For polygons which may contain holes, finding a minimum such covering is NP-hard.[2] This sharp difference between hole-free and general polygons can be intuitively explained based on the following analogy between maximal squares in a rectilinear polygon and nodes in an undirected graph:[1]
In a hole-free rectilinear polygon, all maximal squares are either continuators or separators; thus, such a polygon is analogous to a tree graph. A general polygon is analogous to a general graph. Just like the vertex cover problem is polynomial for tree graphs but NP-hard for general graphs, the square covering problem is linear for hole-free polygons but NP-hard for general polygons.
It is possible to use the linear algorithm to get a 2-approximation; i.e., a covering with at most squares, where opt is the number of squares in a minimum covering:[3]
The number of squares in the resulting covering is at most, where holes is the number of holes. It is possible to prove that . Hence the number of squares in the covering is at most .
For general rectilinear polygons, the problem of finding a minimum rectangle covering is NP-hard, even when the target polygon is hole-free. Several partial solutions have been suggested to this problem:
For a rectilinear polygon which is half-orthogonally convex (i.e. only in the x direction), a minimum covering by orthogonally convex polygons can be found in time O(n^2), where n is the number of vertices of the polygon. The same is true for a covering by rectilinear star polygons.[4]
The number of orthogonally-convex components in a minimum covering can, in some cases, be found without finding the covering itself, in time O(n).[5]
A rectilinear star polygon is a polygon P containing a point p, such that for every point q in P, there is an orthogonally convex polygon containing p and q.
The problem of covering a polygon with star polygons is a variant of the art gallery problem.
The visibility graph for the problem of minimally covering hole-free rectilinear polygons with star polygons is a perfect graph. This perfectness property implies a polynomial algorithm for finding a minimum covering of any rectilinear polygon with rectilinear star polygons.[6]
The most general class of polygons for which coverings by squares or rectangles can be found is the class of polygons without acute interior angles. This is because an acute angle cannot be covered by a finite number of rectangles. This problem is NP-hard, but several approximation algorithms exist.[7]
In some cases, a polygon has to be covered not with arbitrary rectangles but with rectangles from a finite family.[8]
Finding the smallest set of triangles covering a given polygon is NP-hard. It is also hard to approximate - every polynomial-time algorithm might find a covering with size (1 + 1/19151) times the minimal covering.[9]
If the polygon is in general position (i.e. no two edges are collinear), then every triangle can cover at most 3 polygon edges. Hence every polygon triangulation is a 3-approximation.
If the covering is restricted to triangles whose vertices are vertices of the polygon (i.e. Steiner points are not allowed), then the problem is NP-complete.
If Steiner points are not allowed and the polygon is in general position (i.e. no two edges are collinear), then every minimal covering without Steiner points is also a minimal partitioning of the polygon to triangles (i.e., the triangles in the minimal covering to not overlap).[9] Hence, the minimum covering problem is identical to the polygon triangulation problem, which can be solved in time O(nlog n). Note that if we drop the general position assumption, there are polygons in which the triangles in the optimal covering overlap. Think of the Star of David for example.
The problem of covering only the boundary of a polygon with triangles is NP-complete, but there is an efficient 2-approximation.[9]
Covering a polygon (which may contain holes) with convex polygons is NP-hard. It has also been shown to be
\existsR
Covering a polygon with convex polygons is NP-hard even when the target polygon is hole-free.[12] It is also APX-hard,[11] but there is a 6-approximation algorithm for the hole-free case.[13] The problem is NP-complete when the covering must not introduce new vertices (i.e. Steiner points are not allowed).[9]
See main article: Art gallery problem.
Covering a simple polygon with star polygons is \existsR
Given a set S of points in the plane, and a set of identical squares, the goal is to find the smallest number of squares that can cover all points in S.
Suppose that, for each point p in S, we put a square centered at p. Let GS be the intersection graph of these squares. Note that two points in S can be covered by a single square, if and only if the two squares centered at them overlap. Therefore, a square-covering of the points in S is equivalent to a clique cover of GS. Finding a smallest square-covering of S is NP-hard; the proof is by reduction from 3SAT.[14]
Covering a polygon (which may contain holes) with spiral polygons is NP-hard.[15]
Covering a polygon with pseudotriangles has also been studied.
Additional information can be found in.[16]