Approximate Solutions to Bin Packing Problems
Total Page：16
File Type：pdf, Size：1020Kb
Approximate Solutions to Bin Packing Problems y z Edward G Coffman Jr Janos Csirik Gerhard J Woeginger March Intro duction The following abstract packing problem arises in a wide variety of contexts in the real world A list L ha a a i of items must b e packed into ie partitioned among a minimum 1 2 n cardinality set of bins B B sub ject to the constraint that the the set of items in any bin 1 2 ts within that bins capacity To give just a few of the applications mo deled by bin packing we mention storage allo cation for computer networks assigning advertisements to newspap er columns packing fruit slices into tins assigning commercials to station breaks on television copying a collection of les to several oppy disks packing trucks with a given weight limit and the cuttingsto ck problems of various industries like those pro ducing lumb er and cable Let A denote an arbitrary packing algorithm and let OPT denote an algorithm that pro duces optimal packings Let AL and OPTL denote the numb ers of bins used by algorithms A and OPT To measure worstcase b ehavior the asymptotic worstcase ratio R of algorithm A A is dened by m R lim sup R A A m where m R supfALOPTL j OPTL mg A L This ratio which we shall just call the asymptotic ratio is the p erformance metric of choice for bin packing algorithms the standard ob jectives of bin packing problems are algorithms with small asymptotic ratios Although we fo cus on these ratios comments on absolute ratios R sup fALOPTLg will sometimes b e appropriate Certain classes of algorithms A L have the undesirable prop erty that a small asymptotic ratio is obtained at the exp ense of a large absolute ratio egcbelllabscom Bell Labs Lucent Technologies Mountain Ave Murray Hill NJ USA y csirikinfuszegedhu Department of Computer Science University of Szeged Aradi vertanuk tere H Szeged Hungary Supp orted by the Pro ject u of the AustroHungarian Action Fund z gwoegioptmathtugrazacat Institut fur Mathematik B TU Graz Steyrergasse A Graz Austria Supp orted by the START program YMAT of the Austrian Ministry of Science and by the Pro ject u of the AustroHungarian Action Fund In some applications an a priori upp er b ound on the size of all items is known To gauge the p erformance of approximation algorithms on lists of such items the parametric asymptotic ratio R is intro duced as A m R lim sup R A A m where m R sup fALOPTL j OPTL m and all a L are g i A L The problem dened so far is quite general Implicitly we have allowed the bins B to have i varying capacities and b oth bins and items to b e multidimensional The bulk of this pap er not to mention the bin packing literature is conned to the one dimensional problem with equal bin capacities which we normalize to for convenience in this case any set of items whose total size is at most ts into a bin Corresp ondingly items are always assumed to b e numb ers drawn from an interval for some We keep with these classical assumptions throughout the next section the third and last section will cover more general versions of bin packing We note once and for all that the versions of bin packing of interest to us here are NPhard except where stated otherwise Many extensions and variants have b een instrumental in maintaining the interest in the general area of bin packing We mention a few basic illustrations here others can b e found in the more comprehensive treatment by Coman Galamb os Martello and Vigo Three principal parameters of bin packing problems are the numb er of items the bin capacity and the numb er of bins Cho osing the numb er of bins as the ob jective function gives the classical problem but cho osing one of the two others as the ob jective function also gives interesting problems Multipro cessor scheduling actually predates bin packing and is the problem with a given numb er m of bins and the ob jective of nding the minimum common capacity such that all items of the given list can b e packed into m bins The problem falls more prop erly within scheduling theory and is surveyed in that context in the survey article by Lawler Lenstra Shmoys and Rinno oy Kan The second problem is that of nding a maximum cardinality subset of the given list of items which can b e packed into a given numb er of bins with a given capacity see eg Coman Leung and Ting and Coman and Leung The dual of packing is covering where the item sizes in a bin must sum to at least As a nal variant we mention dual bin packing maximize the numb er of unit capacity bins covered by a given list of items Assmann Johnson Kleitman and Leung The classical problem A bin packing algorithm is called online if it packs every item a solely on the basis of the sizes i of the items a j i ie without any information on subsequent items The decisions j of an online algorithm are irrevo cable packed items cannot b e repacked at later times A bin packing algorithm that can use full knowledge of all items in packing L is called oline Below we cover online algorithms rst and then discuss a numb er of oline algorithms Online algorithms Simple algorithms The simplest approximation algorithm for bin packing is probably the NEXT FIT NF algo rithm NF makes a single scan through the list L and shortsightedly packs the items one after the other into a unique active bin In case an item do es not t into the active bin the bin is closed never to b e used again and an empty bin is op ened and b ecomes the new active bin The running time of NF is linear in the numb er of items packed It is easy to see that 1 1 1 NF has an asymptotic ratio R The list L h i that consists of n pairs NF 2 2 2 1 1 where shows that the asymptotic ratio cannot b e b etter than Moreover 2 n the total contents assigned to two consecutive active bins is always at least and this yields an upp er b ound of on the asymptotic ratio Johnson gave a complete analysis of the parametric asymptotic ratio of NF he showed that for R and for NF R NF An obvious drawback of NF is that it never uses the empty space in closed bins A simple mo dication gives the FIRST FIT FF algorithm FF also makes a single scan through the list L but it never closes an active bin When packing a new item FF puts it into the lowest indexed bin into which it will t A new bin is started only if the item do es not t into any nonempty bin The running time of FF is O n log n and thus greater than the O n running time of NF However FF has a much b etter asymptotic ratio Johnson et al proved the following Let m b e a p ositive integer with m m Then for m R holds and for m R m m holds FF FF Other classical online algorithms are BEST FIT BF WORST FIT WF and ALMOST WORST FIT AWF BF b ehaves like FF except that it puts the next item into the bin into which it will t with the smallest gap left over ties are broken arbitrarily WF puts the next item into a nonempty bin with the largest gap starting a new bin only if this largest gap is not big enough AWF tries rst to put the next item into a nonempty bin with the second largest gap if the item do es not t there then AWF b ehaves like WF All three variants b elong to the class of socalled ANY FIT AF algorithms An AF algorithm scans once through the list L while packing the items It never puts an item a into an empty bin unless the item i do es not t into any partially lled bin Similarly an ALMOST ANY FIT AAF algorithm is an AF algorithm that never puts an item into a partially lled bin with the lowest level unless there is more than one bin having this level or unless the bin of lowest level is the only one that has enough ro om Johnson proved a b eautiful and surprising result An AF algorithm can never have an asymptotic ratio b etter than FF and all AAF algorithms have the same asymptotic ratio as FF these statements hold even for the parametric ratios As an easy consequence we get that the AAF algorithms BF and AWF have asymptotic ratios The asymptotic ratio of the AF algorithm WF however is the same as NF Bounded space online algorithms An online bin packing algorithm is said to use k boundedspace if for each new item the choice of bins into which it may b e packed is restricted to a set of k or fewer active bins A bin b ecomes active when it receives its rst item once a bin is closed it can never b ecome active k AFF ABF ABB H SH Champion k k k k k ABB ABB ABB ABB H SH SH SH SH SH H SH Table Asymptotic ratios for b oundedspace bin packing algorithms rounded to ve decimal places again NEXT FIT uses b oundedspace whereas FF WF and AWF all use unb ounded space There are four very natural b oundedspace bin packing algorithms that are dened via simple packing rules for items and simple closing rules for bins A new item can always b e packed into the lowest indexed bin as in FF or into the bin with the smallest remaining gap as in BF If the new item do es not t into any active bin some active bin has to b e closed in this case one can always cho ose the lowest indexed bin the FIRST bin or the fullest bin the BEST bin The corresp onding four algorithms are called AFF AFB ABB and ABF Here A stands k k k k for Algorithm the second letter denotes the packing rule Best t or First t the third letter denotes the closing rule Best bin or First bin and k is the upp er b ound on the numb er of active bins Algorithm AFF This algorithm was dened under the name NEXTk FIT by Johnson k in Provably tight b ounds were not in hand until almost years later Csirik