ArticleslgStudy

computer science

Bin covering problem

Bin covering problem is a computer 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 Bin covering problem rather than just read about it. In short: In the bin covering problem, items of different sizes must be packed into a finite number of bins or containers, each of which must contain at least a certain given total size, in a way that maximizes the number of bins used. This problem is a dual of the bin packing problem: in bin covering, the bin sizes are bounded from below and the goal is to maximize their number; in bin packing, the bin sizes are bounded from…

Key takeaways

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

Reference excerpt

In the bin covering problem, items of different sizes must be packed into a finite number of bins or containers, each of which must contain at least a certain given total size, in a way that maximizes the number of bins used. This problem is a dual of the bin packing problem: in bin covering, the bin sizes are bounded from below and the goal is to maximize their number; in bin packing, the bin sizes are bounded from above and the goal is to minimize their number. The problem is NP-hard, but there are various efficient approximation algorithms:

Algorithms covering at least 1/2, 2/3 or 3/4 of the optimum bin count asymptotically, running in time O(n),O(nlog⁡n),O(nlog2n) respectively. An asymptotic PTAS, algorithms with bounded worst-case behavior whose expected behavior is asymptotically-optimal for some discrete distributions, and a learning algorithm with asymptotically optimal expected behavior for all discrete distributions. An asymptotic FPTAS.

The bidirectional bin-filling algorithm Csirik, Frenk, Lebbe and Zhang present the following simple algorithm for 2/3 approximation. Suppose the bin size is 1 and there are n items.

Order the items from the largest (1) to smallest (n). Fill a bin with the largest items: 1, 2, ..., m, where m is the largest integer for which the sum of items 1, ..., m is less than 1. Add to this bin the smallest items: n, n-1, ..., until its value raises above 1. For any instance I, denote by OPT(I) the number of bins in the optimal solution, and by BDF(I) the number of full bins in the bidirectional filling algorithm. Then BDF(I)≥(2/3)OPT(I)−(2/3), or equivalently, OPT(I)≤(3/2)BDF(I)+1.

Proof For the proof, the following terminology is used.

t:=BDF(I)= the number of bins filled by the algorithm. B1,…,Bt:= the t bins filled by the algorithm. Initial items - the t items that are inserted first into each of the t bins. Final items - the t items that are inserted last into each of the t bins. Middle items - all items that are neither initial nor final. w := the number of final items that are at most 1/2 (equivalently, t−w is the number of final items larger than 1/2). The sum of each bin B1,…,Bt is at least 1, but if the final item is removed from it, then the remaining sum is smaller than 1. Each of the first w bins B1,…,Bw contains an initial item, possibly some middle items, and a final item. Each of the last t−w bins Bw+1,…,Bt contains only an initial item and a final item, since both of them are larger than 1/2 and their sum is already larger than 1. The proof considers two cases. The easy case is w=t, that is, all final items are smaller than 1/2. Then, the sum of every filled Bi is at most 3/2, and the sum of remaining items is at most 1, so the sum of all items is at most 3t/2+1. On the other hand, in the optimal solution the sum of every bin is at least 1, so the sum of all items is at least OPT(I). Therefore, OPT(I)≤3t/2+1 as required. The hard case is w<t, that is, some final items are larger than 1/2. We now prove an upper bound on OPT(I) by presenting it as a sum OPT(I)=|K0|+|K1|+|K2| where:

K0:= the optimal bins with no initial/final items (only middle items). K1:= the optimal bins with exactly one initial/final item (and some middle items). K2:= the optimal bins with two or more initial/final items (and some middle items). We focus first on the optimal bins in K0 and K1. We present a bijection between the items in each such bin to some items in B1,…,Bt which are at least as valuable.

The single initial/final item in the K1 bins is mapped to the initial item in B1,…,B|K1|. Note that these are the largest initial items. The middle items in the K0 and K1 bins are mapped to the middle items in B1,…,Bw. Note that these bins contain all the middle items. Therefore, all items in K0 and K1 are mapped to all non-final items in B1,…,B|K1|, plus all middle items in B|K1|+1,…,Bw. The sum of each bin B1,…,Bw without its final item is less than 1. Moreover, the initial item is more than 1/2, so the sum of only the middle items is less than 1/2. Therefore, the sum of all non-final items in B1,…,B|K1|, plus all middle items in B|K1|+1,…,Bw, is at most |K1|+(w−|K1|)/2=(|K1|+w)/2. The sum of each optimal bin is at least 1. Hence: |K0|+|K1|≤(|K1|+w)/2, which implies 2|K0|+|K1|≤w≤t. We now focus on the optimal bins in K1 and K2.

The total number of initial/final items in the K1 and K2 bins is at least |K1|+2|K2|, but their total number is also 2t since there are exactly two initial/final items in each bin. Therefore, |K1|+2|K2|≤2t. Summing the latter two inequalities implies that 2OPT(I)≤3t, which implies OPT(I)≤3t/2.

Tightness The 2/3 factor is tight for BDF. Consider the following instance (where ϵ>0 is sufficiently small):1−6kϵ, 12−ϵ,…,12−ϵ, ϵ,…,ϵ {⋯6k units⋯} {⋯6k units⋯}BDF initializes the first bin with the largest item and fills it with the 6k smallest items. Then, the remaining 6k items can cover bins only in triplets, so all in all 2k+1 bins are filled. But in OPT one can fill 3k bins, each of which contains two of the middle-sized items and two small items.

Three-classes bin-filling algorithm Csirik, Frenk, Lebbe and Zhang present another algorithm that attains a 3/4 approximation. The algorithm orders the items from large to small, and partitions them into three classes:

X: The items with size at least 1/2; Y: The items with size less than 1/2 and at least 1/3; Z: The items with size less than 1/3. The algorithm works in two phases. Phase 1:

Initialize a new bin with either the largest item in X, or the two largest items in Y, whichever is larger. Note that in both cases, the initial bin sum is less than 1. Fill the new bin with items from Z in increasing order of value. Repeat until either X U Y or Z are empty. Phase 2:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Bin covering problem

Start with the simplest possible case. Write down what Bin covering problem claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer 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 Bin covering problem 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 Bin covering problem 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 Bin covering problem

In research
Bin covering problem appears in computer 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 Bin covering problem 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
Bin covering problem is common in secondary-school and first-year university syllabi. It links to neighbouring topics Covering problems, Optimization algorithms and methods, so understanding it makes those chapters shorter.
In everyday life
Look for Bin covering problem 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 “Bin covering problem” →

How to study Bin covering problem in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Bin covering problem 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 Bin covering problem out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Bin covering problem in simple terms?

In the bin covering problem, items of different sizes must be packed into a finite number of bins or containers, each of which must contain at least a certain given total size, in a way that maximizes the number of bins used. This problem is a dual of the bin packing problem: in bin covering, the b…

Why does Bin covering problem matter?

Because it connects several computer 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 Bin covering problem?

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 Bin covering problem.

Tags

  • Covering problems
  • Optimization algorithms and methods

Keep exploring