Template:Short description

File:SetCover.svg
Example of an instance of set cover problem.

The set cover problem is a classical question in combinatorics, computer science, operations research, and complexity theory.

Given a set of elements Template:Math(henceforth referred to as the universe, specifying all possible elements under consideration) and a collection, referred to as Template:Mvar, of a given Template:Mvar subsets whose union equals the universe, the set cover problem is to identify a smallest sub-collection of Template:Mvar whose union equals the universe.

For example, consider the universe, Template:Math and the collection of sets Template:Math In this example, Template:Mvar is equal to 4, as there are four subsets that comprise this collection. The union of Template:Mvar is equal to Template:Mvar. However, we can cover all elements with only two sets: Template:Math, see picture, but not with only one set. Therefore, the solution to the set cover problem for this Template:Mvar and Template:Mvar has size 2.

More formally, given a universe <math>\mathcal{U}</math> and a family <math>\mathcal{S}</math> of subsets of <math>\mathcal{U}</math>, a set cover is a subfamily <math>\mathcal{C}\subseteq\mathcal{S}</math> of sets whose union is <math>\mathcal{U}</math>.

  • In the set cover decision problem, the input is a pair <math>(\mathcal{U},\mathcal{S})</math> and an integer <math>k</math>; the question is whether there is a set cover of size <math>k</math> or less.
  • In the set cover optimization problem, the input is a pair <math>(\mathcal{U},\mathcal{S})</math>, and the task is to find a set cover that uses the fewest sets.

The decision version of set covering is NP-complete. It is one of Karp's 21 NP-complete problems shown to be NP-complete in 1972. The optimization/search version of set cover is NP-hard.Template:Sfn It is a problem "whose study has led to the development of fundamental techniques for the entire field" of approximation algorithms.<ref>Template:Harvtxt</ref>

VariantsEdit

In the weighted set cover problem, each set is assigned a positive weight (representing its cost), and the goal is to find a set cover with a smallest weight. The usual (unweighted) set cover corresponds to all sets having a weight of 1.

In the fractional set cover problem, it is allowed to select fractions of sets, rather than entire sets. A fractional set cover is an assignment of a fraction (a number in [0,1]) to each set in <math>\mathcal{S}</math>, such that for each element x in the universe, the sum of fractions of sets that contain x is at least 1. The goal is to find a fractional set cover in which the sum of fractions is as small as possible. Note that a (usual) set cover is equivalent to a fractional set cover in which all fractions are either 0 or 1; therefore, the size of the smallest fractional cover is at most the size of the smallest cover, but may be smaller. For example, consider the universe Template:Math and the collection of sets Template:Math The smallest set cover has a size of 2, e.g. Template:Math But there is a fractional set cover of size 1.5, in which a 0.5 fraction of each set is taken. Template:Covering-Packing Problem Pairs

Linear program formulationTemplate:AnchorEdit

The set cover problem can be formulated as the following integer linear program (ILP).<ref>Template:Harvtxt</ref>

minimize <math>\sum_{s \in \mathcal S} x_s</math> (minimize the number of sets)
subject to <math>\sum_{s\colon e \in s} x_s \geqslant 1 </math> for all <math>e\in \mathcal U</math> (cover every element of the universe)
<math>x_s \in \{0,1\}</math> for all <math>s\in \mathcal S</math>. (every set is either in the set cover or not)

For a more compact representation of the covering constraint, one can define an incidence matrix <math>A</math>, where each row corresponds to an element and each column corresponds to a set, and <math>A_{e,s}=1</math> if element e is in set s, and <math>A_{e,s}=0</math> otherwise. Then, the covering constraint can be written as <math>A x \geqslant 1 </math>.

Weighted set cover is described by a program identical to the one given above, except that the objective function to minimize is <math>\sum_{s \in \mathcal S} w_s x_s</math>, where <math>w_{s}</math> is the weight of set <math>s\in \mathcal{S}</math>.

Fractional set cover is described by a program identical to the one given above, except that <math>x_s</math> can be non-integer, so the last constraint is replaced by <math>0 \leq x_s\leq 1</math>.

This linear program belongs to the more general class of LPs for covering problems, as all the coefficients in the objective function and both sides of the constraints are non-negative. The integrality gap of the ILP is at most <math>\scriptstyle \log n</math> (where <math>\scriptstyle n</math> is the size of the universe). It has been shown that its relaxation indeed gives a factor-<math>\scriptstyle \log n</math> approximation algorithm for the minimum set cover problem.<ref>Template:Harvtxt</ref> See randomized rounding#setcover for a detailed explanation.

Hitting set formulationEdit

Set covering is equivalent to the hitting set problem. That is seen by observing that an instance of set covering can be viewed as an arbitrary bipartite graph, with the universe represented by vertices on the left, the sets represented by vertices on the right, and edges representing the membership of elements to sets. The task is then to find a minimum cardinality subset of left-vertices that has a non-trivial intersection with each of the right-vertices, which is precisely the hitting set problem.

In the field of computational geometry, a hitting set for a collection of geometrical objects is also called a stabbing set or piercing set.<ref>Template:Cite journal</ref>

Greedy algorithmEdit

There is a greedy algorithm for polynomial time approximation of set covering that chooses sets according to one rule: at each stage, choose the set that contains the largest number of uncovered elements. This method can be implemented in time linear in the sum of sizes of the input sets, using a bucket queue to prioritize the sets.<ref>Template:Introduction to Algorithms</ref> It achieves an approximation ratio of <math>H(s)</math>, where <math>s</math> is the size of the set to be covered.<ref>Template:Citation</ref> In other words, it finds a covering that may be <math>H(n)</math> times as large as the minimum one, where <math>H(n)</math> is the <math>n</math>-th harmonic number: <math display=block> H(n) = \sum_{k=1}^{n} \frac{1}{k} \le \ln{n} +1</math>

This greedy algorithm actually achieves an approximation ratio of <math>H(s^\prime)</math> where <math>s^\prime</math> is the maximum cardinality set of <math>S</math>. For <math>\delta-</math>dense instances, however, there exists a <math>c \ln{m}</math>-approximation algorithm for every <math>c > 0</math>.<ref> Template:Harvnb</ref>

File:SetCoverGreedy.gif
Tight example for the greedy algorithm with k=3

There is a standard example on which the greedy algorithm achieves an approximation ratio of <math>\log_2(n)/2</math>. The universe consists of <math>n=2^{(k+1)}-2</math> elements. The set system consists of <math>k</math> pairwise disjoint sets <math>S_1,\ldots,S_k</math> with sizes <math>2,4,8,\ldots,2^k</math> respectively, as well as two additional disjoint sets <math>T_0,T_1</math>, each of which contains half of the elements from each <math>S_i</math>. On this input, the greedy algorithm takes the sets <math>S_k,\ldots,S_1</math>, in that order, while the optimal solution consists only of <math>T_0</math> and <math>T_1</math>. An example of such an input for <math>k=3</math> is pictured on the right.

Inapproximability results show that the greedy algorithm is essentially the best-possible polynomial time approximation algorithm for set cover up to lower order terms (see Inapproximability results below), under plausible complexity assumptions. A tighter analysis for the greedy algorithm shows that the approximation ratio is exactly <math>\ln{n} - \ln{\ln{n}} + \Theta(1)</math>.<ref>Slavík Petr A tight analysis of the greedy algorithm for set cover. STOC'96, Pages 435-441, {{#invoke:doi|main}}</ref>

Low-frequency systemsEdit

If each element occurs in at most Template:Var sets, then a solution can be found in polynomial time that approximates the optimum to within a factor of Template:Var using LP relaxation.

If the constraint <math>x_S\in\{0,1\}</math> is replaced by <math>x_S \geq 0</math> for all Template:Var in <math>\mathcal{S}</math> in the integer linear program shown above, then it becomes a (non-integer) linear program Template:Var. The algorithm can be described as follows:

  1. Find an optimal solution Template:Var for the program Template:Var using some polynomial-time method of solving linear programs.
  2. Pick all sets Template:Var for which the corresponding variable Template:VarTemplate:Var has value at least 1/Template:Var in the solution Template:Var.<ref>Template:Harvtxt</ref>

Inapproximability resultsEdit

When <math> n</math> refers to the size of the universe, Template:Harvtxt showed that set covering cannot be approximated in polynomial time to within a factor of <math>\tfrac{1}{2}\log_2{n} \approx 0.72\ln{n}</math>, unless NP has quasi-polynomial time algorithms. Feige (1998) improved this lower bound to <math>\bigl(1-o(1)\bigr)\cdot\ln{n}</math> under the same assumptions, which essentially matches the approximation ratio achieved by the greedy algorithm. Template:Harvtxt established a lower bound of <math>c\cdot\ln{n}</math>, where <math>c</math> is a certain constant, under the weaker assumption that P<math>\not=</math>NP. A similar result with a higher value of <math>c</math> was recently proved by Template:Harvtxt. Template:Harvtxt showed optimal inapproximability by proving that it cannot be approximated to <math>\bigl(1 - o(1)\bigr) \cdot \ln{n}</math> unless P<math>=</math>NP.

In low-frequency systems, Template:Harvtxt proved it is NP-hard to approximate set cover to better than <math>f-1-\epsilon</math>. If the Unique games conjecture is true, this can be improved to <math>f-\epsilon</math> as proven by Template:Harvtxt.

Template:Harvtxt proves that set cover instances with sets of size at most <math>\Delta</math> cannot be approximated to a factor better than <math>\ln \Delta - O(\ln \ln \Delta)</math> unless P<math>=</math>NP, thus making the approximation of <math>\ln \Delta + 1</math> of the greedy algorithm essentially tight in this case.

Weighted set coverEdit

Template:Expand section

Relaxing the integer linear program for weighted set cover stated above, one may use randomized rounding to get an <math>O(\log n)</math>-factor approximation. Non weighted set cover can be adapted to the weighted case.<ref>Template:Harvtxt</ref>

Fractional set coverEdit

Template:Expand section

Related problemsEdit

  • Hitting set is an equivalent reformulation of Set Cover.
  • Vertex cover is a special case of Hitting Set.
  • Edge cover is a special case of Set Cover.
  • Geometric set cover is a special case of Set Cover when the universe is a set of points in <math>\mathbb{R}^d</math> and the sets are induced by the intersection of the universe and geometric shapes (e.g., disks, rectangles).
  • Set packing
  • Maximum coverage problem is to choose at most k sets to cover as many elements as possible.
  • Dominating set is the problem of selecting a set of vertices (the dominating set) in a graph such that all other vertices are adjacent to at least one vertex in the dominating set. The Dominating set problem was shown to be NP complete through a reduction from Set cover.
  • Exact cover problem is to choose a set cover with no element included in more than one covering set.
  • Red-blue set cover.<ref>Template:Cite book</ref>
  • Set-cover abduction.
  • Monotone dualization is a computational problem equivalent to either listing all minimal hitting sets or listing all minimal set covers of a given set family.<ref>Template:Citation</ref>

NotesEdit

Template:Reflist

ReferencesEdit

External linksEdit

Template:Sister project