Set cover problem
Given a set of elements (called the universe) and a collection of sets whose union equals the universe, the set cover problem is to identify the smallest sub-collection of whose union equals the universe. For example, consider the universe and the collection of sets . Clearly the union of is . However, we can cover all of the elements with the following, smaller number of sets: .
More formally, given a universe and a family of subsets of , a cover is a subfamily of sets whose union is . In the set covering decision problem, the input is a pair and an integer ; the question is whether there is a set covering of size or less. In the set covering optimization problem, the input is a pair , and the task is to find a set covering that uses the fewest sets.
If each set is assigned a cost, it becomes a weighted set cover problem.
Integer linear program formulation
|minimize||(minimize the number of sets)|
|subject to||for all||(cover every element of the universe)|
|for all .||(every set is either in the set cover or not)|
This ILP belongs to the more general class of ILPs for covering problems. The integrality gap of this ILP is at most , so its relaxation gives a factor- approximation algorithm for the minimum set cover problem (where is the size of the universe).
Hitting set formulation
Set covering is equivalent to the hitting set problem. It is easy to see this by observing that an instance of set covering can be viewed as an arbitrary bipartite graph, with sets represented by vertices on the left, the universe represented by vertices on the right, and edges representing the inclusion of elements in sets. The task is then to find a minimum cardinality subset of left-vertices which covers all of the right-vertices. In the Hitting set problem, the objective is to cover the left-vertices using a minimum subset of the right vertices. Converting from one problem to the other is therefore achieved by interchanging the two sets of vertices.
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. It can be shown that this algorithm achieves an approximation ratio of , where is the size of the set to be covered. In other words, it finds a covering that may be times as large as the minimum one, where is the -th harmonic number:
This greedy algorithm actually achieves an approximation ratio of where is the maximum cardinality set of . For δ-dense instances, there exists, however, a -approximation algorithm for every .
There is a standard example on which the greedy algorithm achieves an approximation ratio of . The universe consists of elements. The set system consists of pairwise disjoint sets with sizes respectively, as well as two additional disjoint sets , each of which contains half of the elements from each . On this input, the greedy algorithm takes the sets , in that order, while the optimal solution consists only of and . An example of such an input for 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 in fact .
When refers to the size of the universe, Lund & Yannakakis (1994) showed that set covering cannot be approximated in polynomial time to within a factor of , unless NP has quasi-polynomial time algorithms. Feige (1998) improved this lower bound to under the same assumptions, which essentially matches the approximation ratio achieved by the greedy algorithm. Raz & Safra (1997) established a lower bound of , where is a certain constant, under the weaker assumption that PNP. A similar result with a higher value of was recently proved by Alon, Moshkovitz & Safra (2006). Dinur & Steurer (2013) showed optimal inapproximability by proving that it cannot be approximated to unless PNP.
- 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 and the sets are induced by the intersection of the universe and geometric shapes (e.g., disks, rectangles).
- Set packing is the dual problem of Set Cover.
- 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.
- Closest pair of points problem
- Nearest neighbor search
- Vazirani (2001, p. 15)
- Korte & Vygen 2012, p. 414.
- Vazirani (2001, p. 108)
- Vazirani (2001, pp. 110–112)
- Chvatal, V. A Greedy Heuristic for the Set-Covering Problem. Mathematics of Operations Research Vol. 4, No. 3 (Aug., 1979), pp. 233-235
- Karpinski & Zelikovsky 1998
- Slavík Petr A tight analysis of the greedy algorithm for set cover. STOC'96, Pages 435-441, doi:10.1145/237814.237991
- Vazirani (2001, pp. 118–119)
- Alon, Noga; Moshkovitz, Dana; Safra, Shmuel (2006), "Algorithmic construction of sets for k-restrictions", ACM Trans. Algorithms (ACM) 2 (2): 153–177, doi:10.1145/1150334.1150336, ISSN 1549-6325.
- Cormen, Thomas H.; Leiserson, Charles E.; Rivest, Ronald L.; Stein, Clifford (2001), Introduction to Algorithms, Cambridge, Mass.: MIT Press and McGraw-Hill, pp. 1033–1038, ISBN 0-262-03293-7
- Feige, Uriel (1998), "A threshold of ln n for approximating set cover", Journal of the ACM (ACM) 45 (4): 634–652, doi:10.1145/285055.285059, ISSN 0004-5411.
- Karpinski, Marek; Zelikovsky, Alexander (1998). "Approximating dense cases of covering problems". Proceedings of the DIMACS Workshop on Network Design: Connectivity and Facilities Location. pp. 169–178.
- Lund, Carsten; Yannakakis, Mihalis (1994), "On the hardness of approximating minimization problems", Journal of the ACM (ACM) 41 (5): 960–981, doi:10.1145/185675.306789, ISSN 0004-5411.
- Raz, Ran; Safra, Shmuel (1997), "A sub-constant error-probability low-degree test, and a sub-constant error-probability PCP characterization of NP", STOC '97: Proceedings of the twenty-ninth annual ACM symposium on Theory of computing, ACM, pp. 475–484, ISBN 978-0-89791-888-6.
- Dinur, Irit; Steurer, David (2013), "Analytical approach to parallel repetition", STOC '14: Proceedings of the forty-sixth annual ACM symposium on Theory of computing, ACM, pp. 624–633.
- Vazirani, Vijay V. (2001), Approximation Algorithms (PDF), Springer-Verlag, ISBN 3-540-65367-8
- Korte, Bernhard; Vygen, Jens (2012), Combinatorial Optimization: Theory and Algorithms (5 ed.), Springer, ISBN 978-3-642-24487-2
- Cardoso, Nuno; Abreu, Rui (2014). "An Efficient Distributed Algorithm for Computing Minimal Hitting Sets" (PDF). Proceedings of the 25th International Workshop on Principles of Diagnosis (DX'14, best paper award) location= Graz, Austria. doi:10.5281/zenodo.10037.