ArticleslgStudy

science

Set packing

Set packing is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Set packing rather than just read about it. In short: Set packing is a classical NP-complete problem in computational complexity theory and combinatorics, and was one of Karp's 21 NP-complete problems. Suppose one has a finite set S and a list of subsets of S.

Key takeaways

  • Set packing belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Set packing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Set packing from memory before moving on to harder problems.

Reference excerpt

Set packing is a classical NP-complete problem in computational complexity theory and combinatorics, and was one of Karp's 21 NP-complete problems. Suppose one has a finite set S and a list of subsets of S. Then, the set packing problem asks if some k subsets in the list are pairwise disjoint (in other words, no two of them share an element). 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 t; the question is whether there is a set packing of size t 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 t subsets, we can easily verify that they are pairwise disjoint in polynomial time. The optimization version of the problem, maximum set packing, asks for the maximum number of pairwise disjoint sets in the list. It is a maximization problem that can be formulated naturally as an integer linear program, belonging to the class of packing problems.

Integer linear program formulation The maximum set packing problem can be formulated as the following integer linear program.

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 maximum clique problem; in particular, it cannot be approximated within any constant factor. The best known algorithm approximates it within a factor of O(|𝒰|). The weighted variant can also be approximated.

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 3-dimensional matching. However, there are constant-factor approximation algorithms:

Cygan 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 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 Hypergraph matching is equivalent to set packing: the sets correspond to the hyperedges. 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 S∈𝒮 there is a vertex vS, and there is an edge between vS and vT iff S∩T≠∅. Every independent set of vertices in the generated graph corresponds to a set packing in 𝒮. Given an independent vertex set problem on a graph G(V,E), build a collection of sets where for each vertex v there is a set Sv containing all edges adjacent to v. Every set packing in the generated collection corresponds to an independent vertex set in G(V,E). 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 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.

Other related problems 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 NP-complete problem, even in the special case in which the size of all sets is 3 (this special case is called exact 3 cover or X3C). However, if we create a singleton set for each element of S and add these to the list, the resulting problem is about as easy as set packing. Karp originally showed set packing NP-complete via a reduction from the clique problem.

Notes

References "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. Michael R. Garey and David S. Johnson (1979). Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman. ISBN 978-0-7167-1045-5. A3.1: SP3, pg.221. Vazirani, Vijay V. (2001). Approximation Algorithms. Springer-Verlag. 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 Archived 2017-07-25 at the Wayback Machine Solving packaging problem in PHP Optimizing Three-Dimensional Bin Packing

Worked examples

Example 1 — a first encounter with Set packing

Start with the simplest possible case. Write down what Set packing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Set packing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Set packing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Set packing

In research
Set packing appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Set packing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Set packing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorics, NP-complete problems, so understanding it makes those chapters shorter.
In everyday life
Look for Set packing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Set packing” →

How to study Set packing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Set packing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Set packing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Set packing in simple terms?

Set packing is a classical NP-complete problem in computational complexity theory and combinatorics, and was one of Karp's 21 NP-complete problems. Suppose one has a finite set S and a list of subsets of S.

Why does Set packing matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Set packing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Set packing.

Tags

  • Combinatorics
  • NP-complete problems

Keep exploring