BinPacking

BinPacking - Bin Packing Algorithms. - 1. A classical...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Bin Packing Algorithms. ---------------------- 1. A classical problem, with long and interesting history. One of the early problems shown to be intractable. Lends to simple algorithms that require clever analysis. 2. You are given N items, of sizes s1, s2, . .., sN. All sizes are such that 0 < si <= 1. You have an infinite supply of unit size bins. Goal is to pack the items in as few bins as possible. EXAMPLE: 0.2, 0.5, 0.4, 0.7, 0.1, 0.3, 0.8 3. Many many applications: placing data on multiple disks; job scheduling; packing advertisements in fixed length radio/TV station breaks; or storing a large collection of music onto tapes/CD's, etc. 4. Two versions. Online---items arrive one at a time (in unknown order), each must be put in a bin, before considering the next item. Offline--all items given upfront. The online problem would seem more difficult. In fact, it's easy to convince ourselves that a ONLINE algorithm cannot always get the optimal solution. Consider the following input: M "small" items of size 1/2 - e, followed by M "large" items of size 1/2 + e, for any 0 < e < 0.001. The optimal solution is to pack them in pairs (one small, one large); this requires M bins. Now, the ONLINE algorithm doesn't know what's coming down the pipe, or even how long the pipe is. So, for instance, what should it do with the first M small items. If it packs 2 of them in each bin, then it will be stuck when the second half arrives, with M large items. On the other hand, if it puts one small items in each bin in the first half, then we can just stop the input right there, in which case the algorithm would have used twice as many bins as needed. 5. This ad hoc argument is not a proof. But we can turn this into a formal proof, and show the following LOWER BOUND. There exist inputs that can force ANY online bin-packing algorithm to use at least 4/3 times the optimal number of bins. PROOF. An important observation is that because we (the adversary) can truncate the input whenever we like, the algorithm must maintain its guaranteed ratio AT ALL points during its course.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Consider the input sequence: I1, sequence of M small items of size (1/2 - e), followed by I2, sequence of M large items of size (1/2 + e). Let's consider the state of the online algorithm after it has processed I1. Suppose it has used b number of bins. At this point, the optimal solution uses M/2 bins, so if the online algorithm beats 4/3 ratio, it must satisfy: b/(M/2) < 4/3 ==> b/M < 2/3. (*) Now consider the state of the online algorithm after all items have
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/27/2011 for the course CMPSC 130B taught by Professor Suri during the Fall '11 term at UCSB.

Page1 / 6

BinPacking - Bin Packing Algorithms. - 1. A classical...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online