• No results found

Improved space for bounded-space, on-line bin-packing

N/A
N/A
Protected

Academic year: 2021

Share "Improved space for bounded-space, on-line bin-packing"

Copied!
8
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Improved space for bounded-space, on-line bin-packing

Citation for published version (APA):

Woeginger, G. J. (1985). Improved space for bounded-space, on-line bin-packing. SIAM Journal on Discrete Mathematics, 6(4), 575-581. https://doi.org/10.1137/0406045

DOI:

10.1137/0406045

Document status and date: Published: 01/01/1985

Document Version:

Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers)

Please check the document version of this publication:

• A submitted manuscript is the version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website.

• The final author version and the galley proof are versions of the publication after peer review.

• The final published version features the final layout of the paper including the volume, issue and page numbers.

Link to publication

General rights

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain

• You may freely distribute the URL identifying the publication in the public portal.

If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please follow below link for the End User Agreement:

www.tue.nl/taverne Take down policy

If you believe that this document breaches copyright please contact us at: openaccess@tue.nl

providing details and we will investigate your claim.

(2)

IMPROVED SPACE FOR

BOUNDED-SPACE,

ON-LINE BIN-PACKING*

GERHARD WOEGINGER

Abstract. Theauthorpresents a sequenceof linear-time,bounded-space,on-line, bin-packing algorithms that are basedonthe"HARMONIC"algorithmsHkintroducedbyLeeandLee [J. Assoc. Comput.Mach., 32(1985),pp.562-572].The algorithmsin this paperguarantee theworstcase performance ofHk,whereas they only use O(log logk)insteadofkactivebins.Fork >_- 6, the algorithmsin this paperoutperformallknown heuristics usingkactive bins.Forexample, the authorgives analgorithmthathas worst case ratio lessthan 17 /

l0 andusesonlysix active bins.

Keywords, combinatorial problems,on-line, bin-packing,suboptimalalgorithms AMSsubject classifications. 90B35, 90C27

1. Introduction. Inthe classical one-dimensional bin-packing problem,weare given

alist of itemsL (a,a2, an), eachitemai e(0, 1], andwe mustfind apacking

of these itemsintoaminimum numberof unit-capacity bins. Thisproblem arisesina

wide variety ofcontexts and has been studiedextensively since the early 1970s. Since

the problem of findingan optimal packing isNP-hard, research has concentrated on approximationalgorithms that findnear-optimalpackings.

Let

OPT(L)

andA(L) denote,respectively, the numberofbinsusedby anoptimum

algorithm and thenumber of bins used byaheuristic algorithmAtopackthe input list

L.Then the worstcaseperformance of

A,

denoted by r(A),isdefinedas

lim supA (L)/OPT(L).

OPT(L) L

This ratiois customarily used to measure the performance ofa heuristic bin-packing algorithm.Abin-packing algorithm is called on-lineifitpacks all itemsai solelyonthe

basisof thesizesoftheitemsaj,

=<

j_-< andwithoutany informationon subsequent

items. Abin-packing algorithm usesk-boundedspace if, for eachitema;,the choice of

bins topackit intois restrictedto a setofkorfeweractivebins, whereeachbinbecomes activewhenit receives its first item, but,onceitisdeclared inactive (or

closed),

itcan neverbecome active again.

The latter restrictions (on-line and bounded-space) arisein many applications, as inpacking trucks at a loading dock orin communicating viachannels with bounded buffer size. Essentially, only the following three types of bounded-space, on-line,

bin-packing heuristics havebeen studied:

(i) The Next-k-Fit (NFk, k >_- 2) introduced in [6] simply puts an item ai into

the lowestindexedofkactive binsinto whichitwill fit.Ifnoactive binhasroomforai,

thelowest-indexedactivebinisclosed, andai is putinto anewopened bin. Csirikand

Imreh 2 andMao 8 proved that r(NFk) 17/10

+

3/ Ok 10) holds;

(ii) The k-bounded BestFit (BBF, k

>=

2) introduced in [4] always places an itemintothefullest active bin into whichitwill fit.If noactive binhas enoughroom,a newbin isstarted,andthefullest activebin isclosed.CsirikandJohnson 4]showed in

avery sophisticated proofthat,independently of the valueofk, r(BBFk) 17/10holds;

Received by theeditorsJune12, 1991; accepted for publication (inrevisedform)September 11, 1992. Partof this work was cardedoutwhiletheauthor was visitingJrzsef Attila University. This workwaspartially supported by the Christian DopplerLaboratorium ftirDiskrete Optimierung.

fTU Graz, Institut ftir Theoretische Informatik, Klosterwiesgasse 32/11, A-8010 Graz, Austria,

(gwoegi@figids02.tu-graz.ac.at).

(3)

576 GERHARD WOEGINGER

(iii) TheHARMONICalgorithm

Hk

7 isbasedonaspecial nonuniform partition

of the interval (0, 1] into ksubintervals (wherethe partitioning points are 1/2, 1/3,

1/k).

To each of these subintervals, there corresponds one active bin, and only

items belonging tothis subinterval are packed into thisbin. Ifsomeitem does not fit

intoitsassignedbin, this binisclosed, andanew bin isused.LeeandLee [7 analysed the worst case ratio of

Hk.

They showed that, as k tends to infinity, r(Hk) tends to

ho

1.69103.

Asummaryof theworstcase ratiosof theseheuristicsforsomesmallvaluesof kis

given in Table 1. Lee and Lee [7] also showed that for any k-bounded-space, on-line, bin-packing algorithmA, r(A)

>=

ho

musthold. That means that, asymptotically,

Hk

is optimal.

In this paper, we present an on-line bin-packing algorithm, called SIMPLIFIED HARMONICk, or

SHk.

Byusingabetter partition of theinterval(0, than

Hk

does,

wegeta worstcase performance ofapproximately

ho

+

10-5whileusing onlynine active

bins!Toreach thisworstcaseperformance,

Hk

hadtouse 43 active bins,whereas

NFk

and

BBFk

cannotevencomebeneath 17/10. Generally,

SHk

hasa worst caseperformance that theHARMONICalgorithmcannotreach by usinganumber of activebinsless than doubly exponentialink.

Furthermore,our heuristic

SH6

hasworst caseratiobeneath 17/10whileusing only sixactive bins. Thiscontradictsaconjecture ofCsirik [1

].

The paper isorganized as follows. Sections 2 and3 present the results on

SHk

for thecasewhere k 3m. Section4 extends theseresults to the other valuesofk, and 5 gives the discussion.

2. The simplified harmonic algorithm. The followingsequence(introduced by

Go-lomb 5 is essentialin the definition andinthe analysis of our algorithm: tl 2,

ti+ ti(ti

+

for

>=

1.

Wewilldefine the algorithm

SHk

only fork 3m, m

>=

1.Wefixthe valueofmforthis

and the next section and consider the following partition

k

of the unit-interval into

TABLE

Asymptotic worst caseratios,roundedtofivedecimal places.

2 2.00000 1.70000 2.00000 2.00000 1.70000 3 1.85000 1.70000 1.75000 1.75000 1.70000 4 1.80000 1.70000 1.72222 1.72222 1.70000 5 1.77500 1.70000 1.70833 1.70000 1.70000 6 1.76000 1.70000 1.70000 1.69444 1.69444 7 1.75000 1.70000 1.69444 1.69388 1.69388 8 1.74286 1.70000 1.69388 1.69106 1.69106 9 1.73750 1.70000 1.69345 1.69104 1.69104 42 1.70732 1.70000 1.69106 1.69103 1.69103 43 1.70714 1.70000 1.69103 1.69103 1.69103 o 1.70000 1.70000 1.69103 1.69103 1.69103 k NFk BBFk Hk SHk Minimum

(4)

k 3m subintervals:

A =(1/2, 11,

Bi

(1/ti, 1/(ti

1)]

fori=2...rn+ 1,

C=(1/(ti+ 1), 1/ti] fori=2...m,

Di

=(1/(ti+l- 1), 1/(ti

+

1)] fori=2...m,

E= (0, 1/tm+l].

The algorithm

SHk

simply proceedsasfollows.Foreachoftheksubintervals, itkeepsa separate activebin. In this bin, onlyitems belonging tothe corresponding subinterval

are packed. Now, ifthe algorithm receives a new item ai to pack, it first classifies ai

accordingtothepartition

k.

Then ittries topackaiintoitscorresponding activebin.

If there isnotenough roominthe bin, thisbinisclosed,a new active bin isopened,and

ai isputinto it.

Sinceitem classification canbedonein O(logk)timeandthereareonlykactive bins atanytime, the algorithmrunsinO(nlogk).

Hence,

ifwetakektobe constant, thetimecomplexity is linear.

3.

Worst

caseanalysis ofsimplified harmonic. Wedefinebelowaweighting function

W(x), which we prove has the followingtwo properties. If W(L) isthe cumulative

weight of the pieces in

L,

then (i) the length of the SHg-packing ofL cannot exceed Wg(L)

+

kand(ii) Wk(L)cannotexceed

I’

timesthe length ofan optimumpacking, where(rememberthat k 3m)

m

tm+l

ti (tm+l 1)

holds. From this, it immediately follows that

SH(L)

k

=<

Wg(L)

=<

I’OPT

(L),and

this yields r(SHk)

=<

Pk.

Definethe weighting function W(x)asfollows:

W(x)

x+

1/2 =-xq-

ti+l-ti+l

ti for 1/2 <x

for 1/ti

<x<=

1/(ti 1)and2

=< =<

m

+

for 1/(ti+l- 1)<x=< 1/tiand2<-i-<m

tin+

-x forx-

-<

1/tm+l.

tin+l--An illustration for this weighting function and for the partition of the unit-interval in

the case wherek 6isgivenin Table 2. The followingobservationimmediatelyfollows from the definition ofthe weighting function.

OBSERVATION 1. For

<=

rnandx

<=

1/ti, Wk(X)/X

<=

(ti

+

)/ti holds. CLAIM 1. Wk(L) >- SHg(L) k.

Proof.

Weshowthat,inthe SH-packing, every closedbinBhas weightatleast 1.

Togetherwiththeklast active bins, this implies theclaim. Wedistinguishthe following

fivecases:

(i) The bin B corresponds to the A-interval. Then it contains a single item of weight greater than 1;

(5)

578 GERHARD WOEGINGER

TABLE2

IllustrationforSH6.Thetworightmostcolumns hoMforclosed bins. Type Interval Weight(x) Contents #Items

A (1/2, 1] x+1/2 >1/2 =1 B2 (1/3, 1/2] x+1/6 >2/3 =3 C2 1/4, 1/31 4x/3 >3/4 3 /92 (1/6, 1/4] 4x/3 >3/4 4, 5 B3 (1/7, 1/61 x+1/42 >6/7 =6 E (0,1/7] 7x/6 >6/7 >6

(ii) The bin

B

correspondstosome Bi-interval, 2

=< =<

m

+

1. Thenit contains exactly ti items, each of size greater than /ti. Consequently,thetotal weightof B

isatleast

(ti- 1)’Wk

+e

>(ti-- 1).

/+

1"

ti+l-(iii) ThebinBcorrespondstosomeCi-interval, 2-< _-<m.Thenitcontains exactly ti items, each of size greater than /(ti

+

).

Thisgivesatotal weight ofat least

(1)

ti+l

li"

Wk

ti

+

ti

1"

ti ti

+

(iv) The bin B corresponds to some Di-interval, 2 -< -< m. Since the bin was

closed, some item in

Di

didnot fitintoit. Therefore Bisatleast ti/(ti

+

full andas theweight functionislinear onthisinterval, the total weightis atleast

ti ti

+

-1;

ti

+

ti

(v) The bin

B

corrrespondstothe E-interval. Analogouslyto(iv), we seethatB

is atleast

tm

+ /

tm

+ full and that the total weight isatleast 1. U]

CLAIM 2. In anypacking

of

L,

the weight

of

any bin is at most

Fk.

Hence,

Wk( L

<=

FkOPT(L) holds.

Proof.

Considersome fixed binBthat contains items q >- q2 >"" qn. We

dis-tinguishtwocases.

qi e (1/ti 1/ ti 1)]fori= 1...m. WedenotebyQthesum’=m+lqi. Obviously, Q < 1/(tm+1 1)holds.Now

W

B

,

Wk

q q -t- -t-

Wk

q i=m+l ti+l

tm+

<=

-Q+

,

ti+l--

+

tm+

"Q"

Itiseasytosee that thelatterexpressionbecomes maximum when

Q

takes its maximum value /(tin+ );in thiscase, theexpressionisexactly

I’.

(ii) Suppose that r -< m is the least such that qi (1/ti, 1/(t 1)], and hence qr

<=

/tr. We denote by

Q

the sum ’]= qi. Obviously, Q < /(tr holds,

(6)

(tr

+

)Q

tr.

Similarly as in(i),thisyields r-1

tr+

Wk(B)

<=

Q

+

,

+

.Q

i=l ti+l-

tr

r-tr

+

r+

<=Z

+

ti tr(tr i= ti < Ik, and theproofofClaim2iscomplete.

LEMMA1. For k 3m, theasymptotic worst case ratio

of

theheuristicSIMPLIFIED

HARMONICk

is

I’k.

Proof.

Claims and2 imply that r(SHk) -<

I’k

holds. To show that theboundis

tight,we present afamily oflists

Ln.

We

define

Olin (tm+ )(tm+ 2).

Nowletn beamultipleofCm.The optimumpacking of ourlistL,willusen

+

bins,

and the SH-packingwill usen

1

bins.Wechoosetwovery smallpositivereals

suchthat

m

+

Olm’. -I- 6 Otm/n.

We

define

Ln

by giving itsoptimumpacking.Inthis packing,wehavebinsof the following

contents:

n

am

timesabinthat contains

1/ti+e(fori ...m), 1/tm+, 1/(tm+2- 1)-(m

+

1)e; (m )n/O/mtimesa binthatcontains

1/ti +e(fori= m), 1/lm+l

q-e,

1/(tm+2-- 1)--(m+ 1)e;

asingle bin containing

n/Ogm)-timesan item of size m

+

am"

Inthe SHk-packing, the packing of theitems of size /ti

+

e, <-_

<=

miseasyto

analyse. Independently of their ordering, they use exactlyn/(t bins. Analogously,

we see that the items of size 1/tm+

+

e are packed into (am ) n/(tm+

bins. Thus, the only interesting items are theitemsthat are -< /tm+ (i.e.,theE-items).

Thesearegivento

SH

inn

cm

"packages" of the following type:

1-(m+

1)e, (m+

tm+l’

tin+z-OOm-times

We showthat

SH

puts eachpackage intoa separatebin. This holds, since the totalsize

ofa package is exactly (tin+, )/tm+

+

6.

Hence,

when the first item of the next

package arrives, itdoesnot fitinto the active bin.Consequently, the bin isclosed,and

thenextpackage is treatedin the same way. Summarizing,

SH

usesa total numberof

n Om n n

ti_

am

tm

+

(7)

580 GERHARD WOEGINGER

4. Main results. Inthissection,weextend the results of the preceding sectionsto

the cases wherek 3m

+

andk 3m 1.TheunderlyingsetT ofpartitioningpoints

of the unit-interval is given by

T=

i= ti

+

ti’

ti-Todefinethe algorithm

SHk

for generalk, wetake thek largest valuesin T.These values partition the interval (0, intok subintervals.

SHk

keeps for each subintervala separateactivebinandproceeds exactly asinthe preceding sections. Itiseasytoverify that fork 3m this indeedleadsto ourold algorithm. Before we can stateour main

theorem,wegive the followingdefinitions,for m >_- l"

m

I3m-I

1

i= ti

tm+

2 tm+l

I3m--ti- (tm+l

)2,

m

t2m+

+

tm+l

+

I3m+l---

--ti

t2m+l(tm+

1)

THEOREM 1. For k

>=

2, theasymptotic worst case ratio

of

theheur&ticSIMPLIFIED

HARMONICk

is

The proofs are analogous to the proofs ofClaims and 2 and to the proofof

Lemma

1.Essentially,weuse the same weighting function again. The only modification concernselementsxinthe smallestinterval(0, a];theseelements always get weight

x

a). The detailsare left tothe reader as an exercise. Some valuesof

Fk

for some

smallkare giveninthefourth column of Table 1.

Finally,wecompare thebehaviourof the heuristics

Hk

and

SH.

Theorem 2in

[7]

statesthat, fork

tm

+ 1,

m

r(Hk)

1

i-- ti--

tm+l--2"

This value is equalto our

I3m

1. Consequently, HARMONIC using

tm+

active bins andSIMPLIFIED HARMONICusing 3m activebinsachievethesame asymp-toticworstcaseratio.Asthe ti grow doubly exponentially, the following theorem holds. THEOREM 2. Toachievetheworstcaseperformance

of

heuristic

HARMONICk

with

k active bins, the heuristic SIMPLIFIED HARMONIC only has to use O(log log

k)

activebins.

5. Discussion. Inthispaper,we deriveda sequence ofnewk-bounded-space,

on-line, bin-packing algorithms called SIMPLIFIEDHARMONICg. For k

>=

6, theworst case behaviourofouralgorithms outperforms all knownheuristics usingkactive bins.

For k

=<

4, the best-known algorithmsarethe

BBFk

dueto Csirikand Johnson. For k 5,

BBF5

and

SH5

both have the sameworstcase performance.

The average performance ofSIMPLIFIED

HARMONICk

suffers from the usual drawback of harmonic algorithms: For

Ln,

arandom listof nitems with sizes chosen independentlyfromauniformdistribution, the average valueH(L) / OPT (L)approaches 1.28987asktendsto (see 3 ),whereas the average value ofNFk(L) / OPT (L) em-pirically approaches 1.Computationalexperimentsperformedonlarge item lists indicate

(8)

There remainsanumberof (seeminglyhard)openquestions.

Whatisthebest possible worstcase performance ofany on-line, bin-packing heuristic using 2-boundedspace? (BBF2 achievesa worst caseratio of17/10.)

(2) What isthe smallest k such that thereexists an on-line, bin-packingheuristic

usingk-bounded space withasymptoticworstcase ratio strictly less than 17/10? (sn6

comesbeneath

17/10

byusing6-bounded space.)

(3) Ifwe only consider algorithms that pack the items by Next-Fit accordingto some fixed partition of(0, into ksubintervals, which partition gives the best worst

case ratio?(Itiseasytoseethat,fork andk 2,in thiscasethe bestpossible worst caseperformanceis2,but fork

>=

3 notight bounds areknown.)

Acknowledgments. I gratefully acknowledge the hospitality ofJrzsefAttila.

Fur-thermore,Ithank Jfinos Csirik,Gbor Galambos,andHannesHassler for several helpful discussions.

REFERENCES

J.CSIRIK,privatecommunication, 1991.

[2] J.CSIRIKANDB. IMREH, Ontheworst-caseperformanceofthe NkF bin-packing heuristic,ActaCybemetica,

9(1989),pp.89-105.

3 J.CSIRIK, J. B. G.FRENK, A. FRIEZE, G. GALAMBOS,ANDA.H. G.RINNOOYKAN, Aprobabilistic analysis

ofthenextfitdecreasing bin packing heuristic,Oper. Res. Lett.,5(1986),pp.233-236.

[4 J.CSIRIKANDD. S. JOHNSON,Boundedspaceon-line binpacking:Bestisbetter than first,inProc.2nd AnnualACM-SIAMSympos.onDiscreteAlgorithms,SanFrancisco,CA, January1991.

[5] S. GOLOMB,Oncertainnon-linearrecurring sequences,Amer.Math. Monthly,70(1963),pp.403-405.

[6] D. S. JOHNSON, Fastalgorithmsforbin packing,J.Comput.SystemSci., 8(1974),pp.272-314.

[7] C. C. LEEANDD. T.LEE, Asimple on-line bin-packing algorithm, J.Assoc.Comput. Mach., 35(1985),

pp.562-572.

8 W. MAO, Tightworst-caseperformance boundsforNext-k-Fitbin packing, SIAMJ.Comput., 22(1993),

Referenties

GERELATEERDE DOCUMENTEN

Following Theorem 4.13, the authors present their main fixed-point theorem which states that the solution of the GCPP over a graph G and partition pair hΣ, P i can be computed

Now that we have sorted the states of the labeled graph according to their outgoing labels and we have computed the little brother pairs, we compute the initial partition pair,

In Margaretha bleef het langst liggen bevestigt de literatuur haar beperkingen in plaats van ze te doorbreken: niet door een gebrek aan vakmanschap bij de schrijfster, maar door

”Wil je overleven dan moet je je eigen koers varen, maar daarnaast open staan voor kritiek.”.. Jos en Margret hebben

MLHD is ontwikkeld voor rationeel gebruik van herbiciden om goede landbouwpraktijk (GAP) in geïntegreerde landbouw te ondersteunen.. Waar mogelijk gebruikt MLHD een meettechniek om

proximation algorithms (section 2). This approach has also the advantage of simplifying the proofs. In section 3 we show that a special class of stopp- ing times generates

Ten eerste moest er een mogelijkheid komen om door middel van post-globale commando's er voor te zorgen dat stukken tekst alleen op het computerscherm worden

Statements of such problems - and various algorithms for solving them - appear to be omnipresent in many recent advanced machine learning applications, and various approaches to