8
Operations Research Letters 21 (1997) 235–242 Semi on-line algorithms for the partition problem Hans Kellerer a;* , Vladimir Kotov b , Maria Grazia Speranza c , Zsolt Tuza d a Institut f ur Statistik, Okonometrie und Operations Research, Universit at Graz, Universit atsstrae 15, A-8010 Graz, Austria b Faculty of Applied Mathematics and Computer Science, University of Minsk, Minsk, 220080, Belarus c Dipartimento Metodi Quantitativi, Universit a degli Studi di Brescia, Facolt a di Economia e Commercio, Corso Mameli 27, I-25122 Brescia, Italy d Computer and Automation Institute, Hungarian Academy of Sciences, Kende u. 13-17, H-1111 Budapest, Hungary Received 1 April 1996; revised 1 October 1997 Abstract The partition problem is one of the basic NP-complete problems. While an ecient heuristic for the optimization version, which is equivalent to minimizing the makespan on two identical machines, is known with worst-case ratio 12 11 , no deterministic heuristic for the on-line problem can have a worst-case ratio lower than 3 2 . In this paper we investigate three dierent semi on-line versions of the partition problem. In the rst case, we assume that a buer of length k is available to maintain k items. In the second case, two parallel processors are available which assign each item independently to the partition sets. The best of the two produced solutions is chosen. Finally, in the third problem the total sum of the items is known in advance. For each version we propose a heuristic and investigate its worst-case ratio. All algorithms have a worst-case ratio of 4 3 which is shown to be the best possible worst-case ratio. c 1997 Elsevier Science B.V. All rights reserved. Keywords: Partition; Scheduling; On-line algorithms; Worst-case ratio 1. Introduction The partition problem is one of the basic NP-complete problems (see [6]). A set A = {1;:::;n} of items is given such that item i has weight a i . (We will often identify items with their weights.) Let w(S )= iS a i denote the weight of a subset S of A. Formulated as a decision problem the question is: can A be partitioned into 2 subsets such that the weights of the subsets are equal? In the optimization version, a partition of the items into two sets A 1 , A 2 has to be found such that the maximum weight of these two sets is minimized. * Corresponding author. E-mail: [email protected] In general, the problem of partitioning items into m sets is equivalent to the classical multiprocessor scheduling problem on m machines. In multiprocessor scheduling n independent jobs have to be scheduled on m identical, parallel machines with the objective of minimizing the makespan (maximum completion time). Thus, approximation algorithms and results for the multiprocessor scheduling problem on 2 machines can be applied to the equivalent problem of partition- ing items into 2 sets. The most popular heuristic for the multiprocessor scheduling problem is the Longest Processing Time algorithm (LPT for short) [8]. The LPT algorithm sorts the tasks in non-increasing or- der of the processing times and assigns them to the machine with the smallest current weight, that is the 0167-6377/97/$17.00 c 1997 Elsevier Science B.V. All rights reserved PII S0167-6377(98)00005-4

Semi on-line algorithms for the partition problem

Embed Size (px)

Citation preview

Page 1: Semi on-line algorithms for the partition problem

Operations Research Letters 21 (1997) 235–242

Semi on-line algorithms for the partition problem

Hans Kellerer a;∗, Vladimir Kotovb, Maria Grazia Speranzac, Zsolt TuzadaInstitut f�ur Statistik, �Okonometrie und Operations Research, Universit�at Graz, Universit�atsstra�e 15, A-8010 Graz, Austria

bFaculty of Applied Mathematics and Computer Science, University of Minsk, Minsk, 220080, BelaruscDipartimento Metodi Quantitativi, Universit�a degli Studi di Brescia, Facolt�a di Economia e Commercio, Corso Mameli 27,

I-25122 Brescia, ItalydComputer and Automation Institute, Hungarian Academy of Sciences, Kende u. 13-17, H-1111 Budapest, Hungary

Received 1 April 1996; revised 1 October 1997

Abstract

The partition problem is one of the basic NP-complete problems. While an e�cient heuristic for the optimization version,which is equivalent to minimizing the makespan on two identical machines, is known with worst-case ratio 12

11 , no deterministicheuristic for the on-line problem can have a worst-case ratio lower than 3

2 .In this paper we investigate three di�erent semi on-line versions of the partition problem. In the �rst case, we assume that

a bu�er of length k is available to maintain k items. In the second case, two parallel processors are available which assigneach item independently to the partition sets. The best of the two produced solutions is chosen. Finally, in the third problemthe total sum of the items is known in advance.For each version we propose a heuristic and investigate its worst-case ratio. All algorithms have a worst-case ratio of 4

3which is shown to be the best possible worst-case ratio. c© 1997 Elsevier Science B.V. All rights reserved.

Keywords: Partition; Scheduling; On-line algorithms; Worst-case ratio

1. Introduction

The partition problem is one of the basicNP-complete problems (see [6]). A set A= {1; : : : ; n}of items is given such that item i has weight ai. (Wewill often identify items with their weights.) Letw(S)=

∑i∈S ai denote the weight of a subset S of A.

Formulated as a decision problem the question is: canA be partitioned into 2 subsets such that the weightsof the subsets are equal? In the optimization version,a partition of the items into two sets A1, A2 has to befound such that the maximum weight of these twosets is minimized.

∗ Corresponding author. E-mail: [email protected]

In general, the problem of partitioning items intom sets is equivalent to the classical multiprocessorscheduling problem on m machines. In multiprocessorscheduling n independent jobs have to be scheduledon m identical, parallel machines with the objectiveof minimizing the makespan (maximum completiontime). Thus, approximation algorithms and results forthe multiprocessor scheduling problem on 2 machinescan be applied to the equivalent problem of partition-ing items into 2 sets. The most popular heuristic forthe multiprocessor scheduling problem is the LongestProcessing Time algorithm (LPT for short) [8]. TheLPT algorithm sorts the tasks in non-increasing or-der of the processing times and assigns them to themachine with the smallest current weight, that is the

0167-6377/97/$17.00 c© 1997 Elsevier Science B.V. All rights reservedPII S0167-6377(98)00005 -4

Page 2: Semi on-line algorithms for the partition problem

236 H. Kellerer et al. / Operations Research Letters 21 (1997) 235–242

smallest sum of the processing times of the alreadyassigned tasks. For the problem on two machines theLPT algorithm has a worst-case ratio of 76 with respectto the optimum and a time complexity of O(n log n),where n is the number of tasks. Among others,Graham [8] has proposed polynomial-time approx-imation schemes for the multiprocessor schedulingproblem. The most e�ective heuristic for the partitionproblem has a worst-case ratio of 1211 and runs in lineartime [10].In the on-line version of the partition problem the

items are not known a priori, but arrive one by one.Each incoming item has to be assigned to a set im-mediately and the decision cannot be changed later,when new information on the subsequent items willbecome available. Algorithms for on-line problems arecalled on-line algorithms. When compared with theon-line problem, the partition problem will be some-times called o�-line. The performance of an on-linealgorithm is measured through the worst-case ratiowith respect to the optimum solution of the o�-lineproblem.On-line problems have a great practical importance,

as it often happens in real world applications that on-line decisions have to be taken, due to the lack ofinformation or the modi�cation of the available infor-mation.In 1966, Graham [7] suggested a simple heuris-

tic to solve the on-line version of the multiprocessorscheduling problem which is called List Scheduling(LS for short) algorithm. The LS algorithm assignsthe incoming item to the set which has minimum cur-rent weight. Graham showed that the LS algorithmconstructs an assignment (a partition) with makespanat most 2− (1=m) times the makespan in an optimumassignment. Several algorithms have been publishedwhich have a better worst-case ratio than the LS algo-rithm. Galambos and Woeginger [5] improve the up-per bound to 2− 1=m− em, where em goes to 0 as mgoes to in�nity. Bartal et al. [2] developed a heuristicwith worst-case ratio of 2 − 1

70 ≈ 1:986. The currentbest result is due to Albers [1]. They give an algo-rithm which achieves a worst-case ratio which is atmost 1.923 for all m.However, Faigle et al. [4] have shown that no de-

terministic on-line algorithm can have a worst-caseratio smaller than 2− 1=m for m=2 and m=3. Thus,there is no deterministic on-line algorithm for the par-

tition problem with worst-case ratio lower than 32 .

The latter result can be easily obtained by consideringthe problem instance in which the �rst two items area1 = a2 = 1 and the third item may be either a3 = 0 ora3 = 2. Form¿4 they gave a lower bound of 1+1=

√2.

Bartal et al. [3] improved this lower bound to 1.837for m large enough.Little is known about the randomized version of the

on-line multiprocessor scheduling problem. In [2] arandomized on-line algorithm for the partition prob-lem is presented which achieves a worst-case bound of43 and it is shown that this bound is optimal. Sgall [14]gives a general lower bound which tends to 1.5819 asm tends to in�nity. Recently, Seiden [13] suggested arandomized algorithm for general m.In practice, problems are often not really on-line

or o�-line but somehow in between. This means that,with respect to the on-line problem, some further in-formation about the items is available or additionalalgorithmic extensions (like in the case of parallel al-gorithms) are possible. This additional information orthe better algorithmic possibilities allow the improve-ment of the performance of the best solution algorithmwith respect to the on-line problem. We call problemsof this class vaguely semi on-line problems. Gener-ally spoken, in a semi on-line version of a problemthe conditions to be considered on-line are in a cer-tain manner relaxed but do not ful�ll the conditions tobe o�-line completely. For example, one may assumethat there are good estimations of the total weight ofitems. Also in many cases the item sizes are normallydistributed and it is possible to give acceptable lowerand upper bounds for the length of a single element.Another possibility is that the size of the incomingitems in a certain time-period is known in advance ora bu�er is available where some of the items can bestored like in warehouse problems or in productionscheduling.Only few algorithms which may be called semi

on-line have been published for discrete optimizationproblems. In [11] the multiprocessor scheduling prob-lem is studied with the following restriction. The tasks(items) have to be assigned to a machine (set) one byone, as in the on-line version. The size of the tasksis not known, but it is known that the items arrive innon-increasing order of the processing times. Thus,algorithms for this problem depend only upon thisrank order data but not on the actual magnitudes. In

Page 3: Semi on-line algorithms for the partition problem

H. Kellerer et al. / Operations Research Letters 21 (1997) 235–242 237

particular they may not depend on the machine loads.A heuristic is presented which has worst-case ratio 4

3for m=2 (partition problem). This bound cannot beimproved by any deterministic algorithm. In [9] thebin packing problem with lookahead (i.e. the next kincoming items are known in advance) is investigatedand in [12] a single machine problem with lookaheadis studied.In this paper we investigate three semi on-line ver-

sions of the partition problem. In the �rst problem,we assume that the items arrive one by one and that abu�er of length k is available to maintain k items. If kitems are stocked in the bu�er, the incoming item caneither be assigned to a set or be stocked in the bu�er.In the latter case one of the items in the bu�er has tobe assigned immediately to a set. In the second prob-lem the items have to be assigned one by one, but twoparallel processors are available for the computationof the solution. One copy is made of each incomingitem and each of the two identical items has to be as-signed to a set by each of the two processors beforethe arrival of the subsequent item. Finally, the best ofthe two solutions independently obtained by the twoprocessors is taken. In the third problem, the itemshave to be assigned to a set upon their arrival, but thetotal weight of the items is known. For each of thesesemi on-line problems we propose an approximationalgorithm. We show that each of the algorithms has aworst-case ratio bounded above by 4

3 . This bound istight in all cases and cannot be improved by any otheralgorithm.In the sequel we will denote by C∗ the value of an

optimal solution of the o�-line problem, and by CH

the value of the heuristic solution.The paper is organized as follows. Section 2 deals

with the �rst semi on-line problem, in which a bu�er ofgiven length is available. In Section 3 the second semion-line problem, in which two parallel processors areavailable, is investigated. Section 4 is devoted to thethird semi on-line problem, in which the total weightof the items is known in advance. Finally, Section 5contains some open problems.

2. Given bu�er length

In this section we assume that the items arrive oneby one and that a bu�er of length k is available to

maintain k items. Therefore, in the case the bu�eris not completely full, an incoming item can eitherbe immediately assigned to a set or be temporarilyassigned to the bu�er. If k items are stocked in thebu�er, the incoming item can either be assigned to aset or be stocked in the bu�er. In this latter case one ofthe items in the bu�er has to be immediately assignedto a set. We call this problem Pk

1 .We consider the following heuristic, referred to as

the H1 algorithm. H1 assigns the �rst k items to thebu�er. Let s1 =w(A1) and s2 =w(A2) be the weightsof the currently produced partition sets. W.l.o.g. weassume that s1¿s2. Let us denote with b1; : : : ; bk theitems in the bu�er and with bk+1 the new incomingitem. Moreover, we set B= {b1; : : : ; bk+1}. If there isany b∈B such that

s1 + b6 23 (s1 + s2 + w(B)); (1)

assign such an item to set A1, i.e. to the set with largestweight. Otherwise, if Eq. (1) fails even for the smallestb∈B, i.e.

s1 + b¿ 23 (s1 + s2 + w(B)) (2)

for all b∈B, assign an arbitrary item of B to set A2,i.e. to the set with smallest weight. Of course, if b isan element of the bu�er, the new item bk+1 is stockedin the bu�er.In the following theorem we show that a bu�er of

length 1 is su�cient to guarantee a worst-case ratioof 43 for heuristicH1. We denote the problem with abu�er of length 1 brie y as P1.

Theorem 1. The worst-case ratio of heuristicH1 ap-plied to problem P1 is

CH

C∗643:

Proof. Suppose the theorem does not hold. Then thereis a minimal counterexample I , i.e. an instance I withminimum number of items such that the heuristic so-lution value is more than 4

3 times greater than the op-timum solution value for I . Let j6n − 1 and let C∗jdenote the optimum solution value for the �rst j − 1items assigned to sets A1; A2 together with the currentelement in the bu�er. Analogously, CHj denotes the

Page 4: Semi on-line algorithms for the partition problem

238 H. Kellerer et al. / Operations Research Letters 21 (1997) 235–242

heuristic solution value for these j elements. By theminimality of n,

CHj =C∗j 6

43 ; j=1; : : : ; n− 1: (3)

Otherwise, we could �nd a counterexample with asmaller number of elements by considering only the�rst j − 1 items plus the item in the bu�er.Let s1 =w(A1) and s2 =w(A2) (s1¿s2) be the

weights of the partition sets just before assigningthe last item of instance I and let a be the elementin the bu�er. The expression (s1 + s2 + a)=2 is anobvious lower bound for the optimum solution. Ifs1 + a6 2

3 (s1 + s2 + a), the bound of43 would be

satis�ed. Hence from the assumption on the coun-terexample, s1 + a¿ 2

3 (s1 + s2 + a) or, equivalentlys1 + a¿2s2. Thus, H1 assigns item a to set A2. Ifs2 = 0, all previous items have been assigned to setA1. Then due to Eq. (1) we get

s16 23 (s1 + a)6

43C

which contradicts the assumption that I is a counterex-ample. Thus, s2¿0 and there is at least one furtheritem of I besides a which was assigned byH1 to theset with smaller weight, which was not necessarilythe current (before the assignment of the last item a)smaller set A2. Let b denote the last of these furtheritems. Let s′1, s

′2 (s

′1¿s

′2) be the weights of the sets

just before assigning item b and let c be the item in thebu�er just after b is assigned. Since H1 tried to puteither item b or item c into the set with larger weightwithout violating (1), we get from Eq. (2)

s′1 + b¿2(s′2 + c) (4)

and

s′1 + c¿2(s′2 + b): (5)

After assigning item b, all items are put into the setwith larger weight until the last item a is assigned.Therefore,

s′2 + b¿s2: (6)

Note that equality would hold in the case b was as-signed to the current smallest set A2. We claim thatitem c can never be assigned to one of the sets untilthe end of the algorithm. Let s′′1 , s

′′2 (s

′′1¿s

′′2 ) be the

weights of the sets in such a situation. We get fromEqs. (5) and (6)

s′′1 + c¿s′1 + c¿2(s

′2 + b)¿2s2¿2s

′′2 :

Since b is the last item to be assigned to the smallestset, it follows that item c remains always in the bu�erand in fact c is identical to a.Now we distinguish two cases. If s2 + a¿s1, we

obtain from Eqs. (4), (6) and a= c

s2 + a6(s′2 + a) + b¡12 (s

′1 + b) + b

6 32b+

12 s162s1:

But s2 + a¡2s1 is equivalent to

s2 + a¡ 23 (s1 + s2 + a)6C

∗n

which is a contradiction to the assumption that Iis a counterexample. If s2 + a¡s1, the last ele-ment does not increase the value of the solution andagain this is a contradiction to the minimality of thecounterexample.

We show that no deterministic algorithmA for thesemi on-line partition problem Pk

1 for arbitrary k canhave a worst-case ratio, with respect to the optimumsolution value of the o�-line problem, lower than 4

3 .Let us denote byCA the value of the objective functionobtained by algorithmA.

Theorem 2. Any algorithmA for problemPk1 is such

that

CA

C∗¿43

on some problem instance.

Proof. Consider the instance in which a1 = a2 = · · ·=an−1 = �, an= x. Before the arrival of the nth item,any algorithm A must assign to A1 or A2 n − k − 1items, all with weight �. At the time the (n− k − 1)thitem is assigned to a set, k items all with weight �are in the bu�er and the nth item has still to arrive.Let a and b the weights of the two sets at the timewhen n− k − 1 items have been assigned to a set andsuppose a¿b. We consider two cases.Case 1: b6a=2. In this case suppose the last item

has length x=0. Then CA¿a, while, assuming that n

Page 5: Semi on-line algorithms for the partition problem

H. Kellerer et al. / Operations Research Letters 21 (1997) 235–242 239

is odd, it is C∗=(a + b + k�)=26(a + a=2 + k�)=2.It follows:

CA

C∗¿2a

3a=2 + k�→ 43

as n→ ∞.Case 2: b¿a=2. In this case suppose the last item

has length x=2a − b. Then CA¿b + x=2a. Asx=2a− b, it follows

C∗6 a+ b+ x + (k + 1)�2

63a+ (k + 1)�

2:

Therefore,

CA

C∗¿2a

3a=2 + (k + 1)�=2→ 43

as n→ ∞.

Remarks(1) As one can see from Theorems 1 and 2, no im-

provement can be achieved from a worst-casepoint of view, if the capacity of the bu�er is ex-tended from 1 to an arbitrary capacity. For allbu�er lengths we get 43 as best possible worst-case bound.

(2) Our algorithm would fail if we change it suchthat it always checks only whether it can pack thebiggest element in the described way. For exam-ple, the instance a1 = a2 = 1, a3 = · · ·= ak+1 = 0,ak+2 = 2 gives us a heuristic solution which de-viates 50% from the optimum value.

(3) Consider the partitioning problem with look-ahead, i.e. where we know always the size ofthe next k incoming items but we are not ableto store them in a bu�er. For this problem, noalgorithm can guarantee a better worst-case ratiothan for the strict on-line problem, namely 3

2 .This can be shown by considering the instancea1 = a2 = 1, a3 = · · ·= ak+2 = 0, ak+3 = x. If analgorithm assigns a1 and a2 to di�erent sets,choose x=2. If a1 and a2 are put into the sameset, choose x=0. In both cases the ratio betweenthe heuristic solution value and the optimumvalue is greater than or equal to 3

2 . Hence, itis essential for the improvement that a2 can bestored for an arbitrarily long time.

3. Two parallel processors

In this section we consider the items with weightsai as jobs with processing times ai. The jobs arriveone by one and have to be executed on a computerwhich consists of a central server unit and two paral-lel processors. The central server unit makes one copyof each job, as soon as the job arrives. Then, each ofthe copies is sent to one of two parallel processors andeach of the processors assigns the job independentlyto two di�erent sets before the arrival of the subse-quent jobs. After each assignment, the central serverunit may transmit information to the processors. Fi-nally, the best of two produced partitions is chosen.We assume the jobs are numbered in order of arrivaland refer to the time at which job j is executed by theprocessors as time point j. Time point zero is the timeinstant before the arrival of the �rst job. We call thissemi on-line problem P2.In the sequel we describe a heuristic for problem

P2 which will be referred to as heuristicH2. We callone of the processors the active processor and theother the passive processor. The roles of the activeand passive processors may be interchanged duringthe execution of the algorithm. At time zero we choosean arbitrary processor as the active one. We denoteby P1, P2 the two sets of items produced by the ac-tive processor at some time point i − 1, just after jobi − 1 has been assigned to P1 or P2. We assume thats1 :=w(P1)¿s2 :=w(P2). Analogously, let Q1, Q2 bethe sets produced by the passive processor with cor-responding weights t1¿t2.We consider two cases. If

s2 + ai6 23 (s1 + s2 + ai); (7)

the active processor assigns job i to set P2, and thepassive processor assigns it to set Q1. The roles ofactive and passive processor do not change. Otherwise,if

s2 + ai¿ 23 (s1 + s2 + ai); (8)

the active processor assigns job i still to set P2, but thepassive processor assigns it to setQ2. Then, the currentactive processor becomes passive and vice versa.We show that this procedure guarantees a worst-

case ratio bounded above by 43 .

Page 6: Semi on-line algorithms for the partition problem

240 H. Kellerer et al. / Operations Research Letters 21 (1997) 235–242

Theorem 3. The worst-case ratio of heuristicH2 ap-plied to problem P2 is

CH

C∗643:

Proof. We de�ne as changing points the followingtime points: The �rst changing point is time zero, theother changing points are just the time points whenthe active and the passive processors interchange theirroles. The corresponding items are called changingitems. We denote by C∗‘ the optimum solution valuefor the partition of the jobs a1; : : : ; a‘.We are going to show by induction that at each

time point i the processor which will play the activerole in the next time point – i.e., when item ai+1 ar-rives – produces a partition which does not exceed43C

∗i . In other words, a partition of relative error at

most 43 is produced by the passive processor at eachchanging point, and by the active processor at eachnon-changing point.Of course, for time point zero the assertion is true.

Let i¿0 be arbitrary, and suppose that the upper bound43C

∗i′ is valid for all i

′¡i. Denote by �s1 and �s2 ( �s1¿ �s2)the weights of the sets of the current active processor attime point i, before assigning the item ai. Analogously,we denote the weights of the current passive processorby �t1 and �t2 (�t1¿�t2).Suppose �rst that ai is not a changing item. In this

case,

�s2 + ai6 23 ( �s1 + �s2 + ai)6

43C

∗i

follows immediately by Eq. (7) and by the fact that�s1 + �s2 + ai62C∗i . Observe further that�s16 4

3C∗i−16

43C

∗i ;

as the leftmost inequality is just the induction hypoth-esis for the current active processor, and the rightmostinequality is trivial. Thus,

max( �s1; �s2 + ai)6 43C

∗i ;

yielding the assertion for non-changing points.Suppose next that ai is a changing item. In this

case we recall the situation at the previous changingpoint l, i.e., the time point when the current passiveprocessor changed its role from active to passive. Say,the processor had partition weights s′1 and s

′2 before

time point l and weights t′1 and t′2 after assigning the

item al. As l is a changing point,

s′2 + al¿2s′1;

implying t′1 = s′2 + al, t

′2 = s

′1, and

t′2¡12 t

′1:

As the processor remains passive until the next chang-ing point i, it places all items aj (l¡j¡i) in the�rst partition set, i.e., �t1¿t′1¿2t

′2 = 2�t2. Noting that

�s1 + �s2 = �t1 + �t2, the inequalities

�t1¿ 23 ( �s1 + �s2) and �t2¡ 1

3 ( �s1 + �s2) (9)

follow. Recall now that ai is a changing item, andtherefore,

ai¿2�s2 − �s1¿ �s2¿ 12 ( �s1 + �s2):

Consequently,

C∗i ¿ 12 ( �s1 + �s2 + ai)¿

34 ( �s1 + �s2):

As �t16 �s1 + �s2, and ai is placed in the second partitionset, the �rst set does not exceed 4

3C∗i the ith time

point. In order to prove the upper bound of 43C∗i for

the second set, which will have weight �t2 + ai, wedistinguish two simple cases. If ai6 �s1 + �s2, then fromEq. (9)

�t2 + aiC∗i

¡13 ( �s1 + �s2) + ai12 ( �s1 + �s2 + ai)

and the right-hand side attains its maximum when aiis largest, i.e., ai= �s1 + �s2, yielding

�t2 + ai¡ 43C

∗i :

On the other hand, if ai¿ �s1 + �s2, we clearly haveC∗i = ai, and also �t2¡ 1

3C∗i by Eq. (9); therefore �t2 +

ai¡ 43C

∗i follows.

As in the previous section, we can show that there isno semi on-line algorithm for problem P2 with worst-case ratio better than 4

3 .

Theorem 4. Any algorithmA for problem P2 is suchthat

CA

C∗¿43

on some problem instance.

Page 7: Semi on-line algorithms for the partition problem

H. Kellerer et al. / Operations Research Letters 21 (1997) 235–242 241

Proof. Assume there is an algorithm with worst-caseratio better than 4

3 . Consider an instance where the�rst four items a1; : : : ; a4 are all equal to one. The al-gorithm produces two (not necessarily) di�erent par-titions (call them B1, B2 and C1, C2, respectively) ofa1; : : : ; a4. Item a4 may be the last item to be pro-cessed. Thus, there is least one partition, say B1, B2,with w(B1)=w(B2)= 2. There could also be a sub-sequent job a5 = 2 as the last job. For these �ve jobsthe optimum solution value is 3. Therefore, it mustbe w(C1)= 3 and w(C2)= 1. At the arrival of a �fthitem a5 = 2 the sets B1, B2 change in such a way thatw(B1)= 4 and w(B2)= 2. Since a5 may be the lastitem, we must get w(C1)=w(C2)= 3. The last ele-ment is �nally a6 = 6. The optimum solution value is6 whereas any partition of the algorithm has a maxi-mum weight of at least 8, a contradiction.

4. Known total sum

In this section we assume that the items arrive oneby one and that the total sum w(A) is known in ad-vance. Without loss of generality, we normalize theweights of the items in such a way that w(A)= 2.Moreover, the items are numbered in order of arrival.We call this semi on-line problem P3.The heuristic for problem P3, which we denote

brie y asH3, runs as follows:H3 assigns the incom-ing items to set A1 until there is an item j such thats + aj¿ 2

3 , where s denotes the current weight of A1before the arrival of item j. If s+aj6 4

3 , heuristicH3

assigns j to set A1 and the remaining items to set A2.Otherwise, H3 assigns j to set A2 and the remainingitems to set A1.

Theorem 5. The worst-case ratio of heuristicH3 ap-plied to problem P3 is

CH

C∗643:

Proof. Denote by s the weight of set A1 just before thearrival of the �rst item j such that s+aj¿ 2

3 . Of course,s6 2

3 . Recall that w(A)= 2 and consequently C∗¿1.

If s + aj6 43 , then H3 assigns j to A1 and w(A2)6 4

3holds because of w(A1)¿s+ aj¿ 2

3 . If s+ aj¿43 , the

total weight w of the items arriving after j is less than

23 . This means, that as s6

23 , we obtain w(A1)= s +

w¡ 43 and w(A2)= aj. Then if aj¿s+w, the heuristic

�nds the optimum. Otherwise, the bound holds.

Theorem 6. Any algorithmA for P3 is such that

CA

C∗¿43

on some problem instance.

Proof. Consider the set of instances in which fouritems of weight 13 ;

13 ; a; b arrive such that a + b=

43 .

A heuristic may work on the �rst two items in twodi�erent ways: either both items are assigned to thesame set or they are assigned to two di�erent sets. Asat the time the �rst and the second items arrive thereis no information on the values a and b, the decisionis obviously independent of such values.Case 1: Both items are assigned to the same set.

In this case, take a= b= 23 . The heuristic makespan

is CA¿ 43 , while the optimum is C∗=1. Thus, an

instance exists such that CA=C∗¿ 43 .

Case 2: The �rst two items are assigned to di�erentsets. In this case, take a=1 and b= 1

3 . The heuristicmakespan is CA¿ 4

3 , while the optimum is C∗=1.Again, an instance exists such that CA=C∗¿ 4

3 .

5. Open problems

In this paper we presented three di�erent semi on-line algorithms for the partition problem. It shall be�nished with a collection of open problems.(1) Extend the semi on-line algorithms to the mul-

tiprocessor scheduling problem (partitioningof a set into m sets). Note that for the on-line version of multiprocessor scheduling verycomplicated algorithms have been published andalthough these algorithms are rather close to thelower bounds with the respect to their worst-case behaviour, none of them is tight for largervalues of m. The best known heuristic [1] hasworst-case ratio of 1.923 for all m. Therefore, itis interesting to investigate multiprocessor semion-line problems for which heuristics exist witha worst-case ratio considerably smaller than 2.

(2) Extend the model of two processors to k parallelprocessors and �nd e�ective algorithms for this

Page 8: Semi on-line algorithms for the partition problem

242 H. Kellerer et al. / Operations Research Letters 21 (1997) 235–242

problem. Can we get a worst-case ratio arbitrarilyclose to 1 if the number k of parallel processorsdoes not grow exponentially? Since we do notexpect that it is possible to �nd the best possiblealgorithm for the problem of k parallel proces-sors, we are interested in good lower and upperbounds for the worst-case ratio of heuristics ofthis problem.

Acknowledgements

Research of the third author was supported in partby the CNR (Italian Research Council) under contractno. 94.01464PF74. Research of the fourth author wassupported in part by the grant OTKA T-014549.

References

[1] S. Albers, Better bounds for online scheduling, in Proc.Twenty-Ninth Annual ACM Symposium on Theory ofComputing (1997) 130–139.

[2] Y. Bartal, A. Fiat, H. Karlo�, R. Vohra, New algorithmsfor an ancient scheduling problem, J. Comput. Sys. Sci. 51(1995) 359–366.

[3] Y. Bartal, A. Fiat, Y. Rabani, A better lower bound for on-line scheduling, Inform. Process. Lett. 50 (1994) 113–116.

[4] U. Faigle, W. Kern, G. Tur�an, On the performance of on-line algorithms for particular problems, Acta Cybernetica 9(1989) 107–119.

[5] G. Galambos, G. Woeginger, An on-line scheduling heuristicwith better worst case ratio than Graham’s list scheduling,SIAM J. Comput. 22 (1993) 349–355.

[6] M.R. Garey, D.S. Johnson, Computers and Intractability: AGuide to the Theory of NP-Completeness, Freeman, SanFrancisco, 1979.

[7] R.L. Graham, Bounds for certain multiprocessing anomalies,Bell System Tech. 45 (1966) 1563–1581.

[8] R.L. Graham, Bounds on multiprocessing timing anomalies,SIAM J. Appl. Math. 17 (1969) 263–269.

[9] E.F. Grove, Online binpacking with lookahead, in: Proc. 6thAnnual ACM-SIAM Symp. on Discrete Algorithms, 1995,pp. 430–436.

[10] H. Kellerer, V. Kotov, Y. He, Linear compound algorithmsfor the partitioning problem, submitted for publication, 1996.

[11] W.-P. Liu, J.B. Sidney, A. van Vliet, Ordinal algorithms forparallel machine scheduling, Oper. Res. Lett. 18 (1996) 223–232.

[12] W. Mao, R.K. Kincaid, A look-ahead heuristic for schedulingjobs with release dates on a single machine, Comput. Oper.Res. 10 (1994) 1041–1050.

[13] S. Seiden, Randomized algorithms for that schedulingproblem, in Proc. 5th Workshop on Algorithms and DataStructures, Springer, LNCS1272, pp. 210–223.

[14] J. Sgall, On-line scheduling of parallel jobs, in: I. Privara,B. Rovan, P. Ruzicka (Eds.), Mathematical Foundations ofComputer Science, vol. 841 of Lecture Notes in ComputerScience, Springer, Berlin, 1994, pp. 159–176.