in reply to Bin packing problem variation repost (see[834245])

This sounds like a variation on one of Dr. R. E.D. Woolsey's scheduling problems -- given a list of tasks requiring a constrained resource, what is an optimal schedule to get the most bang for the buck.

The original is set in terms of a machine-shop with five heavy drill-presses: build the proper order of the incoming work so as to keep the presses always busy during the shift (down-tune is to be minimized). But, the presses can not be run for more than seven hours per shift with out maintenance.

The approach (if memory serves) is:

  1. Sort the list in descending order of the amount of resource needed.
  2. Remove the first N items and assign them to the each of the N buckets.
  3. Iteration Loop:
    1. The top work-item is removed from the list, checked against the existing list of buckets, and added to the first bucket that can contain it, subject to the constraint.
    2. If the work-item won't fit any bucket in the current bucket set, then the item starts a new starts a new bucket.
  4. Repeat until the work-list is exhausted.
At the end of the process, you have a list of K buckets with M items in each bucket.

If K is greater than N, the number of servers (machines), then you a) have more work than you can handle and b) a measure of the value of having another server available.

For each bucket, the sum of the resource consumed by the M items gives you that amount of additional work you could perform before running out of gas (the 'head-room').

In addition to giving you an optimal schedule for your servers, this gives you ammunition when Management asks pointed questions. ("Do you really need so many servers?", "Do we have enough capacity?", "How many more servers will we need to add if we double the work load?", etc)

----
I Go Back to Sleep, Now.

OGB

  • Comment on Re: Bin packing problem variation repost (see[834245])

Replies are listed 'Best First'.
Re^2: Bin packing problem variation repost (see[834245])
by SuicideJunkie (Vicar) on Apr 14, 2010 at 18:44 UTC

    Simple greedy algorithms like that have a lot of ways to fail:

    Example 1: 5,3,3,3,2,2 with capacity 9

    Greedy algorithm gets: [5+3] [3+3+2] [2] Optimal is instead: [3+3+3] [5+2+2]

    The problem in general is not easy!

    Additionally, the OP problem involves different requirements; having a small number of large items in the first few bins and a whole lot of small items in the last few bins is undesirable.