8

Click here to load reader

Extension of algorithm list scheduling for a semi-online scheduling problem

  • Upload
    yong-he

  • View
    217

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Extension of algorithm list scheduling for a semi-online scheduling problem

CEJOR (2007) 15:97–104DOI 10.1007/s10100-006-0003-x

O R I G I NA L PA P E R

Extension of algorithm list schedulingfor a semi-online scheduling problem

Yong He · György Dósa

Published online: 20 August 2006© Physica-Verlag 2006

Abstract A general algorithm, called ALG, for online and semi-online sched-uling problem Pm||Cmax with m ≥ 2 is introduced. For the semi-online version,it is supposed that all job have their processing times within the interval [p, rp],where p > 0, 1 < r ≤ m/m − 1. ALG is a generalization of LS and is optimalin the sense that there is not an algorithm with smaller competitive ratio thanthat of ALG.

Keywords Analysis of algorithm · Scheduling · Semi-online · Competitiveratio

1 Introduction

In the parallel identical machine scheduling problem P||Cmax, we are con-fronted with a sequence J of independent jobs with positive processing timesp1, p2, . . . , pn, that must be scheduled on m parallel and identical machinesP1, . . . , Pm. We identify the jobs with their processing times. The jobs and ma-chines are available at time zero, and no preemption is allowed. The load ofa machine is the sum of the processing times of the jobs assigned to that ma-chine. The objective is to minimize the maximum machine load Cmax, calledmakespan. A scheduling problem is called on-line if it requires to schedule jobs

Y. He (B)Department of Mathematics, Zhejiang University, Hangzhou 310027,People’s Republic of Chinae-mail: [email protected]

G. DósaDepartment of Mathematics, Pannon University, Veszprém, Hungarye-mail: [email protected]

Page 2: Extension of algorithm list scheduling for a semi-online scheduling problem

98 Y. He, G. Dósa

irrevocably on the machines as soon as they are given, without any knowledgeabout jobs that follow later on. If we have full information on the job databefore constructing a schedule, this problem is called off-line. If the problemis semi-online with tightly-grouped processing times, then we know in advancethat all jobs have their processing times between p and rp (p > 0, r ≥ 1).W. l. o. g., we assume that p = 1 by normalization and the jobs come in theorder of p1, p2, . . . , pn in this paper. It is allowed that the jobs with processingtimes p or rp may not come. This semi-online version may have applications inpractice. As pointed out in [4, 11], in many cases, jobs are normally disturbedand it is possible to give acceptable lower and upper bounds for the processingtime of each job. One wishes to get algorithm with smaller competitive ratio byutilizing the semi-online information.

In a worst-case analysis, the performance of an online or a semi-onlinealgorithm is measured by its competitive ratio. For a job sequence J andan algorithm A, let wA(J ) (or shortly wA) denote the makespan producedby the algorithm A and let w∗(J ) (or shortly w∗) denote the optimal make-span in an off-line version. Then the algorithm A is called c-competitive, ifwA(J )/w∗(J ) ≤ c holds for every instance J . An online (or semi-online)scheduling problem has a lower bound c if no online (or semi-online) algorithmcan be c′-competitive with c′ < c. An online (or semi-online) algorithm is calledoptimal if its competitive ratio matches the lower bound of the problem.

For the on-line version of the discussed problem, Graham [6] proposed asimple greedy algorithm list scheduling (LS in short). This algorithm alwaysassigns the incoming job to the machine with minimum current load. Grahamshowed RLS = 2 − 1/m. Faigle, Kern and Turán [7] observed that LS is theoptimal online algorithm for two and three machines. For a large number ofmachines, several algorithms have been proposed which have a slightly smallercompetitive ratio than that of LS algorithm [1, 13], the competitive ratio of anoptimal online algorithm is now known to lie in the interval [1.88, 1.9201] [2].

The semi-online scheduling problem with tightly-grouped processing timeswas proposed in [10]. For the two machine case, it has been shown that LSis an optimal semi-online algorithm with competitive ratio (1 + r)/2 for any1 ≤ r ≤ 2 and 3/2 for any r > 2. It also can be shown [8] that LS is optimal forany m ≥ 3 and 1 ≤ r ≤ m/(m − 1). In a recent paper [9], the authors presenteda comprehensive analysis on m = 3. They showed that the competitive ratio ofLS is as follows:

⎧⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎩

1 + 2(r − 1)

3, if 1 ≤ r ≤ 3

2,

2 − 3r + 3

, if32

< r ≤ √3,

r + 12

, if√

3 < r ≤ 2,

2 − 1r

, if 2 < r ≤ 3,

53

, if r > 3,

Page 3: Extension of algorithm list scheduling for a semi-online scheduling problem

Extension of algorithm LS for a semi-online scheduling problem 99

It can conclude that LS is optimal only for r ∈ [1, 1.5], [√3, 2] and [6, +∞).Optimal or improved algorithms for the intervals where LS is not optimal weredesigned in the same paper.

The motivation of this note is the following: Due to their simpleness, the clas-sical approximation algorithms for scheduling problems such as LPT, Multifit,LS, etc, are still considered worthwhile in applications. Hence the relaxation andgeneralization of these algorithms which have the same performance guaranteeare of interest. Goldberg and Shapiro [5] considered the relaxation of off-linealgorithm LPT. They created a class of algorithms which have the same worst-case ratio 4/3 − 1/(3m) as that of LPT. In this note, we consider how to relaxonline algorithm LS. An (semi-) online algorithm, called ALG is presented. Itscompetitive ratio is not greater than that of LS, and it reserves more freedom inallocating jobs. This property may be useful if there are some secondary objec-tives. The algorithm which is presented uses the same idea like the algorithm ofKarger et al. [12]. The idea is to choose one of the machines which do not hurtthe competitive ratio.

In the remainder of this note, denote by load(Pi) the current load of machinePi in heuristic.

2 On-line version

On-line algorithm ALG

1. Let k = 1, load(Pi) = 0, i = 1, . . . , m.

2. Let C = ((2m − 1)/m)C1(k), where C1(k) = max{maxi=1,...,kpi,∑k

i=1 pi/m}3. Let I = {i |load(Pi) + pk ≤ C, 1 ≤ i ≤ m}. If I = ∅, then stop.

4. Let i0 be an arbitrary index in I. Allocate job k to the machine Pi0 , letload(Pi0) = load(Pi0) + pk.

5. k = k + 1. If k > n then halt, otherwise go to 2.

Theorem 1 ALG cannot be halted at Step 3, and thus the competitive ratio ofALG cannot be greater than (2m − 1)/m.

Proof Suppose that ALG halts at Step 3. Without loss of generality, it canbe assumed that job pn is the first one which cannot be scheduled by ALG.Thus load(Pi) + pn > C, for all 1 ≤ i ≤ m. Summarizing these inequalities,it follows that

∑ni=1 pi + (m − 1) pn > mC. Then dividing it by m, we get

(∑n

i=1 pi/m) + ((m − 1)/m)pn > C. It implies that C = ((2m − 1)/m)C1(n) =C1(n) + ((m − 1)/m)C1(n) ≥ (

∑ni=1 pi/m) + ((m − 1)/m)pn > C, a

contradiction.

Page 4: Extension of algorithm list scheduling for a semi-online scheduling problem

100 Y. He, G. Dósa

3 Semi-online version with tightly-grouped processing times

The following theorem is from [10].

Theorem 2 Suppose that all jobs have their processing times within interval [1, r],where 1 ≤ r ≤ m/(m − 1). Then applying LS to the problem Pm||Cmax, we havewLS/w∗ ≤ 1 + (((m − 1)(r − 1))/m) and LS is optimal.

Suppose that assumption of Theorem 2 holds in the following. We will showthat if some further consideration on general algorithm ALG is done, thenwe can get a generalized semi-online algorithm, which is still an optimal semi-online algorithm and furthermore the competitive ratio can be sharpened insome special cases.

Let Tl be the first l jobs in the sequence. In the following description of ALG,let C1(l) denote a lower bound of the optimal makespan for Tl, and q(l) denotean upper bound of the competitive ratio if the algorithm is applied for Tl. Theirvalue will be determined later.

Modified ALG algorithm in case pi ∈ [1, r

], 1 ≤ r ≤ m/(m − 1)

1. Let l = 1, load(Pi) = 0 for i = 1, . . . , m.2. Let C = q (l) C1 (l).3. Let I = {i |load(Pi) + pl ≤ C, i ∈ {1, . . . , m}}. If I = ∅, then stop.4. Let i0 be an arbitrary index in I. Allocate job pl to the machine Pi0 , let

load(Pi0) = load(Pi0) + pl.5. l = l + 1. If l > n then halt.6. Update the value of C1 (l) and q (l), and go to 2.

Lemma 3 Let T = {p1, p2, . . . , pn}. Suppose n = mk + j for some 1 ≤ j ≤ m.

1. Let ti be the ith smallest job in {p1, p2, . . . , pn}. Then C1 = (1/j)∑j(k+1)

i=1 ti isa valid lower bound of the optimal makespan.

2. Consider an arbitrary algorithm which schedules the first n − 1 jobs with-out introducing any idle time between consecutive two jobs. We force thealgorithm to schedule the job pn to the machine with minimum current loads. Then the completion time of this machine is w = s + pn. We have w −C1 ≤ (k + 1) (r − 1)((j − 1)/j), if 2j ≥ m + 1; and w − C1 ≤ (k + 1) (r −1)((m − j)/(m − j + 1)), if 2j < m + 1.

Proof

1. In any schedule, there are j machines processing totally at least j (k + 1)

jobs, the total processing time of these jobs is at least∑j(k+1)

i=1 ti, thus its

makespan is at least C1 = (1/j)∑j(k+1)

i=1 ti.2. To prove it, a further notation is required. For every α satisfying 1 ≤ α ≤ j,

denote Sα = ∑α(k+1)

i=(α−1)(k+1)+1 ti, and for every α satisfying j + 1 ≤ α ≤ m,

denote Sα = ∑j(k+1)+(α−j)ki=j(k+1)+(α−j−1)k+1 ti. Then by this notation, we have

Page 5: Extension of algorithm list scheduling for a semi-online scheduling problem

Extension of algorithm LS for a semi-online scheduling problem 101

C1 = 1j

j∑

α=1

Sα . (1)

It is clear that if 1 ≤ α ≤ j, k + 1 ≤ Sα ≤ (k + 1) r holds, and if j + 1 ≤ α ≤ m,k ≤ Sα ≤ kr holds.

Consider an arbitrary algorithm which schedules the first n − 1 jobs withoutintroducing any idle time between consecutive two jobs. Before allocating thelast job pn, there are j − 1 machines which have been already assigned at least(j − 1) (k + 1) jobs. The total processing time of these jobs is at least

∑j−1α=1 Sα ,

thus the‘ total processing time of jobs being assigned to the other machines isat most

Sj +m∑

α=j+1

Sα − pn ≤ Sj + (m − j) kr − pn. (2)

Thus there is a machine among them such that its current load is not greaterthan (1/(m − j + 1))(Sj + (m − j)kr − pn). Since w = s + pn, we get

w ≤ 1m − j + 1

(Sj + (m − j) kr − pn

) + pn

= 1m − j + 1

(Sj + (m − j) kr

) + m − jm − j + 1

pn

≤ 1m − j + 1

(Sj + (m − j) kr

) + m − jm − j + 1

r

= 1m − j + 1

Sj + (m − j) (k + 1)

m − j + 1r. (3)

From (1), (3) and (1/(k + 1))∑j−1

α=1 Sα ≥ j − 1, it follows that

w − C1 ≤ 1m − j + 1

Sj + (m − j) (k + 1)

m − j + 1r − 1

j

j∑

α=1

= (m − j) (k + 1)

m − j + 1r + 1

m − j + 1Sj − 1

j

j∑

α=1

= k + 1(m − j + 1) j

⎧⎨

⎩j (m − j) r + (2j − m − 1) Sj

k + 1− (m − j + 1)

k + 1

j−1∑

α=1

⎫⎬

≤ k + 1(m − j + 1) j

{

j (m − j) r + (2j − m − 1) Sj

k + 1− (m − j + 1) (j − 1)

}

.

(4)

If 2j − m − 1 ≥ 0, i.e., 2j ≥ m + 1, then substituting Sj/(k + 1) ≤ r into (4),we get w − C1 ≤ (k + 1) (r − 1) ((j − 1)/j).

Page 6: Extension of algorithm list scheduling for a semi-online scheduling problem

102 Y. He, G. Dósa

Otherwise 2j − m − 1 < 0, i.e., 2j < m + 1, substituting (Sj/(k + 1)) ≥ 1 into(4), we get w − C1 ≤ (k + 1) (r − 1) ((m − j)/(m − j + 1)). Now we are ready to prove the following theorem:

Theorem 4 Denote Tl the first l jobs, and suppose l = mk+ j for some 1 ≤ j ≤ m.Let ti be the i-th smallest job in {p1, p2, . . . , pl},

C1 (l) = 1j

j(k+1)∑

i=1

ti,

and let

q (l) = 1 + (r − 1)(j − 1)

j, if 2j ≥ m + 1,

q (l) = 1 + (r − 1)(m − j)m − j + 1

, if 2j < m + 1,

then ALG schedules all jobs.

Remark 5

1. C1 (l) is a step by step actualized lower bound and C1 (l + 1) can be com-puted from C1 (l) by easy calculation. Hence computing C1 (l) requires O(n)

times. On the other hand, computing q (l) requires only O(1) time.2. If Theorem 4 holds, the competitive ratio of the algorithm cannot be greater

than q (l). Furthermore q (l) < 1 + ((m − 1)(r − 1))/m, if j �= 1 and j �= m,and q (l) = 1 + ((m − 1)(r − 1))/m, if j = 1 or j = m.

3. Usually the current job can be allocated not only to one machine in Step 4,thus there is some freedom in choosing the machine to which the currentjob is allocated. It may be useful if there are some secondary objectives.

4. In Step 2, we may use a C′ which is smaller than q (l) C1 (l) to replaceq (l) C1 (l) as an upper bound although sometimes algorithm may stop atStep 3. In this situation we simply increase value of C′ and follow the algo-rithm. If algorithm allocates all jobs with some C′ < q (n) C1 (n) then thepractical performance guarantee is certainly smaller than q (n).

Proof It is enough to prove that ALG cannot be halted at Step 3. Suppose thatthe algorithm halted at Step 3. We can assume that pn is the first job that isnot scheduled. Let the minimum current machine load right before assigningpn by ALG be s. By allocating job pn to the minimum loaded machine, we geta schedule with makespan w = s + pn > C, where C = q (n) C1 (n). Note thatC1 (n) ≥ k + 1. Applying Lemma 3, if 2j ≥ m + 1, we get

wC1 (n)

= 1 + w − C1 (n)

C1 (n)≤ 1 + (k + 1) (r − 1)(j − 1)

jC1 (n)≤ 1 + (r − 1)(j − 1)

j,

(5)

Page 7: Extension of algorithm list scheduling for a semi-online scheduling problem

Extension of algorithm LS for a semi-online scheduling problem 103

and if 2j < m + 1, we get

wC1 (n)

= w − C1 (n)

C1 (n)+ 1 ≤ 1 + (k + 1) (r − 1)(m − j)

(m − j + 1) C1 (n)≤ 1 + (r − 1)(m − j)

m − j + 1.

(6)

Thus we have that w ≤ q (n) C1 (n) = C < w, a contradiction. It is clear that w∗ ≥ C1 (n), we obtain

Corollary 6

wALG

w∗ ≤ 1 + (r − 1)j − 1

j, if n = mk + j and 2j − m − 1 ≥ 0,

wALG

w∗ ≤ 1 + (r − 1)m − j

m − j + 1, if n = mk + j and 2j − m − 1 < 0,

the overall competitive ratio of ALG is 1 + (((m − 1) (r − 1))/m) and thus isoptimal.

Proof We only need to show that the example given in [7] proves the optimalityof ALG. For completeness, we do it as follows. In fact, note that the competitiveratio of the algorithm is smaller than 1 + (r − 1) (m − 1)/m, if j �= 1, and j �= m,thus for any sharp counterexample n = mk+j, j = 1, or j = m must hold. Let forany m ≥ 2 the job sequence is Tm = {1, 1, . . . , 1, r, r, . . . , r}, where the number ofjobs with processing time 1 is exactly m, and the number of the other jobs withprocessing time r is (m − 1)2. (In this case j = 1.) For example T2 = {1, 1, r},and T3 = {1, 1, 1, r, r, r, r}. The jobs are coming in this order. It is clear that theoptimal makespan is m because r ≤ m/(m − 1). On the other hand, for anyschedule, if the first m jobs are allocated to at most m − 1 machines, then thereis not more incoming job, and the competitive ratio is at least 2. If the 1’s areallocated to different machines, then the next (m − 1)2 = m (m − 2) + 1 jobsare allocated to m machines, thus there is a machine to which at least m − 1further jobs are allocated. Thus the makespan is at least 1 + (m − 1) r, and thecompetitive ratio is at least (1 + (m − 1) r)/m = 1 + ((m − 1) (r − 1))/m.

References

Albers S (1999) Better bounds for on-line scheduling. SIAM J Comput 29(2):459–473Albers S (2002) On randomized online scheduling. In: Proceedings of the 34th ACM symposium

on theory of computing. Montreal, pp 134–143Coffman EE Jr, Garey MR, Johnson DS (1981) An application of bin-packing to multiprocessor

scheduling. SIAM J Comput 7:1–17Dósa G, He Y (2004) Semi-Online Algorithms for Parallel Machine Scheduling Problems. Com-

puting 72:355–363Goldberg RR, Shapiro J (2001) Extending Graham’s result on scheduling to other heuristic. Oper

Res Lett 29:149–153Graham RL (1969) Bounds on multiprocessor timing anomalies. SIAM J Appl Math 17:416–429

Page 8: Extension of algorithm list scheduling for a semi-online scheduling problem

104 Y. He, G. Dósa

Faigle U, Kern W, Turán G (1989) On the performance of on-line algorithm for particular problems.Acta Cybern 9:107–119

He Y (2000) The optimal on-line parallel machine scheduling. Comput Math Appl 39:117–121He Y, Dósa G (2005) Semi-online scheduling jobs with tightly-grouped processing times on three

identical machines. Discrete Appl Math 150:140–159He Y, Zhang G (1999) Semi on-line scheduling on two identical machines. Computing 62:179–187Kellerer H, Kotov V, Speranza MG, Tuza Z (1997) Semi on-line algorithms for the partition prob-

lem. Oper Res Lett 21:235–242Karger DR, Phillips SJ, Torng E (1996) A better algorithm for an ancient scheduling problem. J

Algorithms 20 (2):400–430Sgall J (1998) On-line scheduling. On-line algorithms: the state of art. Lecture Notes in Computer

Sciences, vol 1442, Springer, Berlin Heidelberg New York, pp 196–231