[So WordPress’s search function has failed me. A search for posts on Bin Packing didn’t turn up this post, so I went ahead and wrote a whole second post for this problem. Since this time my reduction uses 3-Partition instead of Partition (and so is a little less trivial for use as a homework problem), I figured I’d leave it for you as an alternate reduction.

I have been thinking off and on about whether it would be useful when I’m done with this project (years from now) to go back and try to find reductions that can be done easier (or harder) than what I’ve shown here, to give more options that are in the 3-6 difficulty range that I think is best for homework problems. I’m not sure how feasible that task would be, but it’s something I’ll try to keep in mind as I go forward.

Anyway, here’s my post that talks about Bin Packing again:]

On to a new chapter! A4- “Storage and Retrieval”

This first one is a classic problem that I guess I haven’t done yet.

**The problem: **Bin Packing. This is problem SR1 in the appendix.

**The description: **Given a finite set U of items, each with a positive integer size, and positive integers B and K. Can we split U into k disjoint sets such that the sum of the elements in each set is B or less?

**Example: **Suppose U was {1,2,3,4,5,6}, K=4, and B= 6. We want 4 disjoint sets that each sum to 6 or less. For example:

- {1,5}
- {2,4}
- {3}
- {6}

Note that if K = 3, we would need 3 sets instead of 4, and this wouldn’t be solvable.

**The simple reduction: **G&J on page 124 say that Bin Packing contains 3-Partition as a special case. So let’s try reducing from there. Recall the definition of 3-Partition:

Given a set A of 3M elements and an integer B such that the sizes of each element are between B/4 and B/2 and the sum of all of the elements is m*B, can we split A into m disjoint sets that each sum to exactly B?

Keeping in mind that the bounds on the elements in A mean that there are exactly 3 elements in each set in the partition, we can see how this maps easily to the Bin Packing problem:

- U = A
- K = m
- Use the same B

While it is true that the Bin Packing problem allows the sums to be B or less, and the 3-Parittion problem forces the sets to sum to exactly B, the fact that all of the sets have to contain 3 elements and the fact that the sum of all of the element in U is m*B means that if any set in the Bin Packing answer is < B some other set will necessarily be more than B.

**Difficulty: **3. It is basically the same problem, but I think there is enough work needed to justify the reduction that it makes sense as a good easy homework problem.