Set packing
Set packing is a classical
More formally, given a universe and a family of subsets of , a packing is a subfamily of sets such that all sets in are pairwise disjoint. The size of the packing is . In the set packing decision problem, the input is a pair and an integer ; the question is whether there is a set packing of size or more. In the set packing optimization problem, the input is a pair , and the task is to find a set packing that uses the most sets.
The problem is clearly in NP since, given subsets, we can easily verify that they are pairwise disjoint in polynomial time.
The
Integer linear program formulation
The maximum set packing problem can be formulated as the following
maximize | (maximize the total number of subsets) | ||
subject to | for all | (selected sets have to be pairwise disjoint) | |
for all . | (every set is either in the set packing or not) |
Complexity
The set packing problem is not only NP-complete, but its optimization version (general maximum set packing problem) has been proven as difficult to approximate as the
Packing sets with a bounded size
The problem does have a variant which is more tractable. Given any positive integer k≥3, the k-set packing problem is a variant of set packing in which each set contains at most k elements.
When k=1, the problem is trivial. When k=2, the problem is equivalent to finding a maximum cardinality matching, which can be solved in polynomial time.
For any k≥3, the problem is NP-hard, as it is more general than
- Cygan[4] presented an algorithm that, for any ε>0, attains a (k+1+ε)/3 approximation. The run-time is polynomial in the number of sets and elements, but doubly-exponential in 1/ε.
- Furer and Yu[5] presented an algorithm that attains the same approximation, but with run-time singly-exponential in 1/ε.
Packing sets with a bounded degree
In another more tractable variant, if no element occurs in more than d of the subsets, the answer can be approximated within a factor of d. This is also true for the weighted version.
Related problems
Equivalent problems
The independent set problem is also equivalent to set packing – there is a one-to-one polynomial-time reduction between them:
- Given a set packing problem on a collection , build a graph where for each set there is a vertex , and there is an edge between and iff . Every independent set of vertices in the generated graph corresponds to a set packing in .
- Given an independent vertex set problem on a graph , build a collection of sets where for each vertex there is a set containing all edges adjacent to . Every set packing in the generated collection corresponds to an independent vertex set in .
This is also a bidirectional PTAS reduction, and it shows that the two problems are equally difficult to approximate.
In the special case when each set contains at most k elements (the k-set packing problem), the intersection graph is (k+1)-claw-free. This is because, if a set intersects some k+1 sets, then at least two of these sets intersect, so there cannot be a (k+1)-claw. So Maximum Independent Set in claw-free graphs[6] can be seen as a generalization of Maximum k-Set Packing.
Special cases
Graph matching is a special case of set packing in which the size of all sets is 2 (the sets correspond to the edges). In this special case, a maximum-size matching can be found in polynomial time.
3-dimensional matching is a special case in which the size of all sets is 3, and in addition, the elements are partitioned into 3 colors and each set contains exactly one element of each color. This special case is still NP-hard, though it has better constant-factor approximation algorithms than the general case.
In the set cover problem, we are given a family of subsets of a universe , and the goal is to determine whether we can choose t sets that together contain every element of . These sets may overlap. The optimization version finds the minimum number of such sets. The maximum set packing need not cover every possible element.
In the exact cover problem, every element of should be contained in exactly one of the subsets. Finding such an exact cover is an
Karp originally showed set packing NP-complete via a reduction from the clique problem.
Notes
- S2CID 1858087. See in particular p. 21: "Maximum clique (and therefore also maximum independent set and maximum set packing) cannot be approximated to within unless NP ⊂ ZPP."
- ^ Halldórsson, Magnus M.; Kratochvíl, Jan; Telle, Jan Arne (1998). Independent sets with domination constraints. 25th International Colloquium on Automata, Languages and Programming. Lecture Notes in Computer Science. Vol. 1443. Springer-Verlag. pp. 176–185.
- ^ Halldórsson, Magnus M. (1999). Approximations of weighted independent set and hereditary subset problems. 5th Annual International Conference on Computing and Combinatorics. Lecture Notes in Computer Science. Vol. 1627. Springer-Verlag. pp. 261–270.
- S2CID 14160646.
- S2CID 15815885.
- )
References
- Maximum Set Packing, Viggo Kann.
- "set packing". Dictionary of Algorithms and Data Structures, editor Paul E. Black, National Institute of Standards and Technology. Note that the definition here is somewhat different.
- Steven S. Skiena. "Set Packing". The Algorithm Design Manual.
- Pierluigi Crescenzi, Viggo Kann, Magnús Halldórsson, Marek Karpinski and Gerhard Woeginger. "Maximum Set Packing". A compendium of NP optimization problems. Last modified March 20, 2000.
- ISBN 978-0-7167-1045-5. A3.1: SP3, pg.221.
- ISBN 978-3-540-65367-7.
External links
- [1]: A Pascal program for solving the problem. From Discrete Optimization Algorithms with Pascal Programs by MacIej M. Syslo, ISBN 0-13-215509-5.
- Benchmarks with Hidden Optimum Solutions for Set Covering, Set Packing and Winner Determination
- Solving packaging problem in PHP
- Optimizing Three-Dimensional Bin Packing