Set cover problem

{{Short description|Classical problem in combinatorics}}

File:SetCover.svg

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

Given a set of elements {{math|{1, 2, …, n} }}(henceforth referred to as the universe, specifying all possible elements under consideration) and a collection, referred to as {{mvar|S}}, of a given {{mvar|m}} subsets whose union equals the universe, the set cover problem is to identify a smallest sub-collection of {{mvar|S}} whose union equals the universe.

For example, consider the universe, {{math|1=U = {1, 2, 3, 4, 5} }} and the collection of sets {{math|1=S = { {1, 2, 3}, {2, 4}, {3, 4}, {4, 5} }.}} In this example, {{mvar|m}} is equal to 4, as there are four subsets that comprise this collection. The union of {{mvar|S}} is equal to {{mvar|U}}. However, we can cover all elements with only two sets: {{math|{ {1, 2, 3}, {4, 5} }‍}}, see picture, but not with only one set. Therefore, the solution to the set cover problem for this {{mvar|U}} and {{mvar|S}} has size 2.

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

  • In the set cover decision problem, the input is a pair (\mathcal{U},\mathcal{S}) and an integer k; the question is whether there is a set cover of size k or less.
  • In the set cover optimization problem, the input is a pair (\mathcal{U},\mathcal{S}), 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.{{sfn |Korte|Vygen|2012|p=414}} It is a problem "whose study has led to the development of fundamental techniques for the entire field" of approximation algorithms.{{harvtxt|Vazirani|2001|p=15}}

Variants

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 \mathcal{S}, 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 {{math|1=U = {1, 2, 3} }} and the collection of sets {{math|1=S = { {1, 2}, {2, 3}, {3, 1} }.}} The smallest set cover has a size of 2, e.g. {{math|1={ {1, 2}, {2, 3} }.}} But there is a fractional set cover of size 1.5, in which a 0.5 fraction of each set is taken. {{Covering-Packing Problem Pairs}}

Linear program formulation{{Anchor|LP}}

The set cover problem can be formulated as the following integer linear program (ILP).{{harvtxt|Vazirani|2001|p=108}}

minimize

| \sum_{s \in \mathcal S} x_s

|

| (minimize the number of sets)

subject to

| \sum_{s\colon e \in s} x_s \geqslant 1

| for all e\in \mathcal U

| (cover every element of the universe)

| x_s \in \{0,1\}

| for all s\in \mathcal S.

| (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 A, where each row corresponds to an element and each column corresponds to a set, and A_{e,s}=1 if element e is in set s, and A_{e,s}=0 otherwise. Then, the covering constraint can be written as A x \geqslant 1 .

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

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

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 \scriptstyle \log n (where \scriptstyle n is the size of the universe). It has been shown that its relaxation indeed gives a factor-\scriptstyle \log n approximation algorithm for the minimum set cover problem.{{harvtxt|Vazirani|2001|pp=110–112}} See randomized rounding#setcover for a detailed explanation.

Hitting set formulation

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.{{Cite journal |last=Nielsen |first=Frank |date=2000-09-06 |title=Fast stabbing of boxes in high dimensions |url=http://www.lix.polytechnique.fr/%7Enielsen/pdf/2000-FastStabbingBoxes-TCS.pdf |journal=Theoretical Computer Science |volume=246 |issue=1 |pages=53–72 |doi=10.1016/S0304-3975(98)00336-3 |issn=0304-3975|doi-access=free }}

Greedy algorithm

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.{{Introduction to Algorithms|edition=3|chapter=Exercise 35.3-3|pages=1122|mode=cs2}} It achieves an approximation ratio of H(s), where s is the size of the set to be covered.{{citation

| last1=Chvatal | first1=V. | authorlink1=Václav Chvátal

| jstor=3689577

| title=A Greedy Heuristic for the Set-Covering Problem

| journal=Mathematics of Operations Research

| volume=4

| issue=3

| date=August 1979

| pages=233–235

| doi=10.1287/moor.4.3.233}} In other words, it finds a covering that may be H(n) times as large as the minimum one, where H(n) is the n-th harmonic number:

H(n) = \sum_{k=1}^{n} \frac{1}{k} \le \ln{n} +1

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

{{harvnb|Karpinski|Zelikovsky|1998}}

Image:SetCoverGreedy.gif with k=3]]

There is a standard example on which the greedy algorithm achieves an approximation ratio of \log_2(n)/2.

The universe consists of n=2^{(k+1)}-2 elements. The set system consists of k pairwise disjoint sets

S_1,\ldots,S_k with sizes 2,4,8,\ldots,2^k respectively, as well as two additional disjoint sets T_0,T_1,

each of which contains half of the elements from each S_i. On this input, the greedy algorithm takes the sets

S_k,\ldots,S_1, in that order, while the optimal solution consists only of T_0 and T_1.

An example of such an input for k=3 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 \ln{n} - \ln{\ln{n}} + \Theta(1).Slavík Petr [http://dl.acm.org/citation.cfm?id=237991 A tight analysis of the greedy algorithm for set cover]. STOC'96, Pages 435-441, {{doi|10.1145/237814.237991}}

Low-frequency systems

If each element occurs in at most {{var|f}} sets, then a solution can be found in polynomial time that approximates the optimum to within a factor of {{var|f}} using LP relaxation.

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

  1. Find an optimal solution {{var|O}} for the program {{var|L}} using some polynomial-time method of solving linear programs.
  2. Pick all sets {{var|S}} for which the corresponding variable {{var|x}}{{var|S}} has value at least 1/{{var|f}} in the solution {{var|O}}.{{harvtxt|Vazirani|2001|pp=118–119}}

Inapproximability results

When n refers to the size of the universe, {{harvtxt |Lund|Yannakakis|1994}} showed that set covering cannot be approximated in polynomial time to within a factor of \tfrac{1}{2}\log_2{n} \approx 0.72\ln{n}, unless NP has quasi-polynomial time algorithms. Feige (1998) improved this lower bound to \bigl(1-o(1)\bigr)\cdot\ln{n} under the same assumptions, which essentially matches the approximation ratio achieved by the greedy algorithm. {{harvtxt |Raz|Safra|1997}} established a lower bound

of c\cdot\ln{n}, where c is a certain constant, under the weaker assumption that P\not=NP.

A similar result with a higher value of c was recently proved by {{harvtxt |Alon|Moshkovitz|Safra|2006}}. {{harvtxt |Dinur|Steurer|2013}} showed optimal inapproximability by proving that it cannot be approximated to \bigl(1 - o(1)\bigr) \cdot \ln{n} unless P=NP.

In low-frequency systems, {{harvtxt |Dinur|Guruswami|Khot|Regev|2003}} proved it is NP-hard to approximate set cover to better than f-1-\epsilon.

If the Unique games conjecture is true, this can be improved to f-\epsilon as proven by {{harvtxt |Khot|Regev|2008}}.

{{harvtxt |Trevisan|2001}} proves that set cover instances with sets of size at most \Delta cannot be approximated to a factor better than \ln \Delta - O(\ln \ln \Delta) unless P=NP, thus making the approximation of \ln \Delta + 1 of the greedy algorithm essentially tight in this case.

Weighted set cover

{{Expand section|date=November 2017}}

Relaxing the integer linear program for weighted set cover stated above, one may use randomized rounding to get an O(\log n)-factor approximation. Non weighted set cover can be adapted to the weighted case.{{harvtxt|Vazirani|2001|loc=Chapter 14}}

Fractional set cover

{{Expand section|date=September 2023}}

Related problems

  • 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 \mathbb{R}^d 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.{{Cite book|last=Information.|first=Sandia National Laboratories. United States. Department of Energy. United States. Department of Energy. Office of Scientific and Technical|url=http://worldcat.org/oclc/68396743|title=On the Red-Blue Set Cover Problem.|date=1999|publisher=United States. Dept. of Energy|oclc=68396743}}
  • 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.{{citation

| last1 = Gainer-Dewar | first1 = Andrew

| last2 = Vera-Licona | first2 = Paola

| arxiv = 1601.02939

| doi = 10.1137/15M1055024

| issue = 1

| journal = SIAM Journal on Discrete Mathematics

| mr = 3590650

| pages = 63–100

| title = The minimal hitting set generation problem: algorithms and computation

| volume = 31

| year = 2017| s2cid = 9240467

}}

Notes

{{reflist}}

References

  • {{Citation | last1=Alon | first1=Noga | author1-link=Noga Alon | last2=Moshkovitz | first2=Dana|author2-link= Dana Moshkovitz | last3=Safra | first3=Shmuel | author3-link=Shmuel Safra | title=Algorithmic construction of sets for k-restrictions | year=2006 | journal=ACM Trans. Algorithms | issn=1549-6325 | volume=2 | issue=2 | pages=153–177 | doi=10.1145/1150334.1150336| citeseerx=10.1.1.138.8682 | s2cid=11922650 }}.
  • {{Citation

| last1=Cormen | first1=Thomas H. | author-link=Thomas H. Cormen

| last2=Leiserson | first2=Charles E. | author-link2=Charles E. Leiserson

| last3=Rivest | first3=Ronald L. | author-link3=Ronald L. Rivest

| last4=Stein | first4=Clifford | author-link4=Clifford Stein

| title=Introduction to Algorithms | year=2001 | publisher=MIT Press and McGraw-Hill | location=Cambridge, Mass.

| isbn=978-0-262-03293-3 | pages=1033–1038}}

  • {{Citation | last1=Feige | first1=Uriel | author1-link=Uriel Feige | title=A threshold of ln n for approximating set cover | year=1998 | journal=Journal of the ACM | issn=0004-5411 | volume=45 | issue=4 | pages=634–652 | doi=10.1145/285055.285059| citeseerx=10.1.1.70.5014 | s2cid=52827488 }}.
  • {{Citation

| last1=Karpinski | first1=Marek | last2=Zelikovsky|first2=Alexander

| year=1998

| contribution=Approximating dense cases of covering problems

| title=Proceedings of the DIMACS Workshop on Network Design: Connectivity and Facilities Location

| volume=40

| pages=169–178

| publisher=American Mathematical Society | url=https://books.google.com/books?id=IMmuF0RZk1MC&q=karpinski+zelikovsky+cover+dense&pg=PA169

| isbn=9780821870846 }}

  • {{Citation | last1=Lund | first1=Carsten | author1-link=Carsten Lund | last2=Yannakakis | first2=Mihalis | author2-link=Mihalis Yannakakis | title=On the hardness of approximating minimization problems | year=1994 | journal=Journal of the ACM | issn=0004-5411 | volume=41 | issue=5 | pages=960–981 | doi=10.1145/185675.306789| s2cid=9021065 | doi-access=free }}.
  • {{Citation | last1=Raz | first1=Ran | author1-link=Ran Raz | last2=Safra | first2=Shmuel | author2-link=Shmuel Safra | title=STOC '97: Proceedings of the twenty-ninth annual ACM symposium on Theory of computing | publisher=ACM | isbn=978-0-89791-888-6 | year=1997 | chapter=A sub-constant error-probability low-degree test, and a sub-constant error-probability PCP characterization of NP | pages=475–484}}.
  • {{Citation | last1=Dinur | first1=Irit | author1-link=Irit Dinur | last2=Steurer | first2=David | title=STOC '14: Proceedings of the forty-sixth annual ACM symposium on Theory of computing | publisher=ACM | year=2013 | chapter=Analytical approach to parallel repetition | pages=624–633}}.
  • {{Citation| last = Vazirani | first = Vijay V.

| author-link = Vijay Vazirani

| title = Approximation Algorithms

| year = 2001

| publisher = Springer-Verlag

| isbn = 978-3-540-65367-7

| url = https://www.ics.uci.edu/~vazirani/book.pdf

}}

  • {{Citation| last1 = Korte | first1 = Bernhard | authorlink1=Bernhard Korte

| last2 = Vygen | first2 = Jens

| title = Combinatorial Optimization: Theory and Algorithms

| year = 2012

| isbn = 978-3-642-24487-2

| edition = 5

| publisher = Springer

}}

  • {{Citation| last1 = Cardoso | first1 = Nuno | last2 = Abreu | first2 = Rui | contribution = An Efficient Distributed Algorithm for Computing Minimal Hitting Sets | year = 2014 | title=Proceedings of the 25th International Workshop on Principles of Diagnosis |location=Graz, Austria | contribution-url = http://dx-2014.ist.tugraz.at/papers/DX14_Mon_PM_S1_paper1.pdf | doi=10.5281/zenodo.10037 }}
  • {{Citation

| last1=Dinur | first1=Irit | author-link=Irit Dinur

| last2=Guruswami | first2=Venkatesan | author-link2=Venkatesan Guruswami

| last3=Khot | first3=Subhash | author-link3=Subhash Khot

| last4=Regev | first4=Oded | author-link4=Oded Regev (computer scientist)

| title=A new multilayered PCP and the hardness of hypergraph vertex cover

| year=2003

| isbn=1581136749 | publisher=Association for Computing Machinery

| pages=595–601

| doi=10.1145/780542.780629 | url = https://doi.org/10.1145/780542.780629

}}

  • {{Citation

| last1=Khot | first1=Subhash | author-link=Subhash Khot

| last2=Regev | first2=Oded | author-link2=Oded Regev (computer scientist)

| title=Vertex cover might be hard to approximate to within 2−\epsilon

| year=2008

| publisher=Journal of Computer and System Sciences

| url = https://doi.org/10.1016/j.jcss.2007.06.019

| pages=335–349

| doi=10.1016/j.jcss.2007.06.019 }}

  • {{Citation

| last1=Trevisan | first1=Luca | title=Proceedings of the thirty-third annual ACM symposium on Theory of computing | author-link=Luca Trevisan

| chapter=Non-approximability results for optimization problems on bounded degree instances

| year=2001

| publisher=Association for Computing Machinery

| chapter-url = https://doi.org/10.1145/380752.380839

| pages=453–461

| doi=10.1145/380752.380839 | isbn=1-58113-349-9 }}