7
Computers & Operations Research 34 (2007) 2396 – 2402 www.elsevier.com/locate/cor A simple linear time algorithm for scheduling with step-improving processing times Min Ji a, b , Yong He a , T.C.E. Cheng b, a Department of Mathematics, State Key Lab of CAD & CG, Zhejiang University, Hangzhou 310027, China b Department of Logistics,The Hong Kong Polytechnic University, Kowloon, Hong Kong SAR, China Available online 6 October 2005 Abstract We consider the problem of scheduling jobs with step-improving processing times around a common critical date on a single machine to minimize the makespan. For this problem, we present a simple linear time off-line approximation algorithm and prove its worst-case performance guarantee. 2005 Elsevier Ltd. All rights reserved. Keywords: Scheduling; Approximation algorithm; Worst-case ratio 1. Introduction Machine scheduling problems with jobs having start-time-dependent processing times have received increasing attention from the scheduling community over the last decade. For a survey of the research in this area, we refer the reader to Cheng et al. [1]. Recently, Cheng et al. [2] considered the following single-machine scheduling problem with time-dependent processing times: there are n-independent jobs J ={J 1 ,J 2 ,...,J n } with a common critical date d . All the jobs are available for processing at time 0. The processing time of job J j (j = 1,...,n) is specified by two integers a j and b j with 0 b j a j . If job J j is started at some time t<d , then its processing time is a j ; if it is started at some time t d , then its processing time equals a j b j . The goal is to find a non-preemptive schedule to minimize the makespan, i.e., the completion time of the last job. For this problem, Cheng et al. [2] gave an NP-hardness proof, a pseudo-polynomial time algorithm, a fully polynomial time approximation scheme (FPTAS), and an on-line algorithm with a competitive ratio 2 while showing that no on-line algorithm can have a competitive ratio smaller than 2. Most of their algorithmic results are based on two Knapsack problems subject to covering constraints. Recall that the FPTAS of the Knapsack problem is based on the dynamic programming approach, hence it is supposed that all the data are integer. Furthermore, although the FPTAS of the Knapsack problem may run in linear time for a given error bound ε, the formulation and solution approach are quite complex. In this note, we give another algorithm with a worst-case ratio 5 4 . It is very simple and runs in linear time. Moreover, we do not need to assume that all the data are integer. So, our algorithm makes a contribution to both the theory and practice of scheduling. Corresponding author. E-mail addresses: [email protected] (M. Ji), [email protected] (Y. He), [email protected] (T.C.E. Cheng). 0305-0548/$ - see front matter 2005 Elsevier Ltd. All rights reserved. doi:10.1016/j.cor.2005.09.011

A simple linear time algorithm for scheduling with step-improving processing times

  • Upload
    min-ji

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A simple linear time algorithm for scheduling with step-improving processing times

Computers & Operations Research 34 (2007) 2396–2402www.elsevier.com/locate/cor

A simple linear time algorithm for scheduling withstep-improving processing times

Min Jia,b, Yong Hea, T.C.E. Chengb,∗aDepartment of Mathematics, State Key Lab of CAD & CG, Zhejiang University, Hangzhou 310027, China

bDepartment of Logistics, The Hong Kong Polytechnic University, Kowloon, Hong Kong SAR, China

Available online 6 October 2005

Abstract

We consider the problem of scheduling jobs with step-improving processing times around a common critical date on a singlemachine to minimize the makespan. For this problem, we present a simple linear time off-line approximation algorithm and proveits worst-case performance guarantee.� 2005 Elsevier Ltd. All rights reserved.

Keywords: Scheduling; Approximation algorithm; Worst-case ratio

1. Introduction

Machine scheduling problems with jobs having start-time-dependent processing times have received increasingattention from the scheduling community over the last decade. For a survey of the research in this area, we refer thereader to Cheng et al. [1]. Recently, Cheng et al. [2] considered the following single-machine scheduling problem withtime-dependent processing times: there are n-independent jobs J = {J1, J2, . . . , Jn} with a common critical date d.All the jobs are available for processing at time 0. The processing time of job Jj (j = 1, . . . , n) is specified by twointegers aj and bj with 0�bj �aj . If job Jj is started at some time t < d, then its processing time is aj ; if it is startedat some time t �d, then its processing time equals aj − bj . The goal is to find a non-preemptive schedule to minimizethe makespan, i.e., the completion time of the last job. For this problem, Cheng et al. [2] gave an NP-hardness proof, apseudo-polynomial time algorithm, a fully polynomial time approximation scheme (FPTAS), and an on-line algorithmwith a competitive ratio 2 while showing that no on-line algorithm can have a competitive ratio smaller than 2. Mostof their algorithmic results are based on two Knapsack problems subject to covering constraints.

Recall that the FPTAS of the Knapsack problem is based on the dynamic programming approach, hence it is supposedthat all the data are integer. Furthermore, although the FPTAS of the Knapsack problem may run in linear time for agiven error bound ε, the formulation and solution approach are quite complex. In this note, we give another algorithmwith a worst-case ratio 5

4 . It is very simple and runs in linear time. Moreover, we do not need to assume that all the dataare integer. So, our algorithm makes a contribution to both the theory and practice of scheduling.

∗ Corresponding author.E-mail addresses: [email protected] (M. Ji), [email protected] (Y. He), [email protected] (T.C.E. Cheng).

0305-0548/$ - see front matter � 2005 Elsevier Ltd. All rights reserved.doi:10.1016/j.cor.2005.09.011

Page 2: A simple linear time algorithm for scheduling with step-improving processing times

M. Ji et al. / Computers & Operations Research 34 (2007) 2396–2402 2397

We use the worst-case ratio to measure the quality of an off-line approximation algorithm. For an instance I , letCA(I) (or briefly CA) denote the makespan produced by an approximation algorithm A, and COPT(I ) (or briefly COPT)denote the makespan produced by an optimal algorithm. Then the worst-case ratio of algorithm A is defined as thesmallest number c such that for any instance I , CA(I)�cCOPT(I ).

2. The simple linear time algorithm

For the considered problem, Cheng et al. [2] gave an on-line algorithm ON with a competitive ratio 2. To improvethe worst-case ratio of the off-line version, we add a preparatory step before invoking algorithm ON. We denote themodified algorithm by algorithm OFF, which is described as follows.

Algorithm OFF:

1. Re-order the jobs such that b1/a1 �b2/a2 � · · · �bn/an. Determine k = min{j |∑ji=1 ai > d}.

2. Process the jobs J1, J2, . . . , Jk−1 before d without introducing any idle time between consecutive jobs. Let Ck−1be the finishing time of job Jk−1.

3. If Ck−1 > d − bk , then process the jobs Jk, . . . , Jn starting from d without introducing any idle time betweenconsecutive jobs. Otherwise, process the jobs Jk, . . . , Jn starting from Ck−1 without introducing any idle timebetween consecutive jobs.

Definition 1. For a given schedule, we call a job straddling if it is started before d and completed after d, a job earlyif it is completed by d, and a job tardy if its starting time is not earlier than d.

Remark. Step 1 can be done in O(n) time, hence OFF still runs in linear time. In fact, to implement Step 1, we justneed to determine k and the set T1 = {pi |bi/ai < bk/ak, i = 1, . . . , n}. Balas and Zemel [3] studied the Knapsackproblem and presented a linear time method for determining the so-called critical item. Recall that for the Knapsackproblem, we are given n items, each with a profit ai and a weight wj , and a knapsack with capacity C. We wish toput items into the Knapsack such that the total weight of the selected items is not greater than C and the total profit ofthe selected items is maximized. By assuming a1/w1 � · · · �an/wn, the critical item is defined as the item s such thats = min{j |∑j

i=1 wi > C}. It is obvious that the method for computing the critical item for the Knapsack problem canbe applied to obtain the straddling job in algorithm OFF for our problem. Hence, we can determine k, and thus T1, inlinear time.

Theorem 2. Algorithm OFF has a worst-case ratio of 54 .

We prove the worst-case ratio by contradiction. Suppose that there exists a counterexample that violates our ratio;hence a minimal counterexample (J, d) with the fewest possible jobs should exist. From now on, we assume that we aredealing with the minimal counterexample I = (J, d). The following three lemmas can be shown by simple algebraicmanipulations.

Lemma 3. Let x, a, b be positive numbers satisfying 0�x�1 and b/a�x. We have (a+(1−x)b)/(b+(1−x)a)� 54 .

Lemma 4. Let x, u1, u2, v1, v2 be positive numbers satisfying u2 �u1 and v1/u1 �v2/u2 �1. We have u1+v2 �u2+v1and (v2 + x)/(u2 + x)�(v1 + x)/(u1 + x).

Lemma 5. Let a, b and x be positive numbers satisfying x < b�a. We have (a − x)/(b − x)�a/b.

Lemma 6. In the minimal counterexample, if a job Jj is early in the OFF schedule, then it cannot be early in theoptimal schedule; and if a job Jj is tardy in the OFF schedule, then it cannot be tardy in the optimal schedule.

Proof. We only prove the first conclusion, as the second conclusion can similarly be proved. If a job Jj is completedby d not only in the OFF schedule but also in the optimal schedule, we can construct a newinstance I ′ from I with

Page 3: A simple linear time algorithm for scheduling with step-improving processing times

2398 M. Ji et al. / Computers & Operations Research 34 (2007) 2396–2402

Fig. 1. Case 1: (i) one of the jobs in {Jk+1, . . . , Jn} is completed after d in the optimal schedule; (ii) all the jobs in {Jk+1, . . . , Jn} are completedby d in the optimal schedule.

I ′ = (J\{Jj }, d = d − aj ). It is obvious that COFF (I ′) = COFF (I) − aj and COPT(I ′)�COPT(I ) − aj . Then,

COFF (I ′)COPT(I ′)

� COFF (I) − aj

COPT(I ) − aj

� COFF (I)

COPT(I )

and hence I ′ is a smaller counterexample, a contradiction. �

Lemma 7. In the minimal counterexample, if a job Jj is straddling in an optimal schedule, then it cannot be early inthe OFF schedule.

Proof. Suppose that Jj is straddling in an optimal schedule and early in the OFF schedule. Then we can concludethat aj �d, otherwise it cannot be early in the OFF schedule. So it is clear that, in the optimal schedule, there is atleast one job Ji that is processed before Jj (i.e., Ji is early in the optimal schedule). Otherwise, Jj can start at timezero, and hence is completed by d in the optimal schedule since aj �d, a contradiction. Then we can obtain a newoptimal schedule by exchanging Jj with Ji , and thus Jj is early too in the new optimal schedule, which contradictsLemma 6. �

Proof of Theorem 2. From the rule of algorithm OFF and Lemmas 6 and 7, we know that:

(a) In the OFF schedule, all the jobs in {J1, . . . , Jk−1} are early and all the jobs in {Jk+1, . . . , Jn} are tardy while Jk

may be straddling or tardy.(b) In the optimal schedule, all the jobs in {J1, . . . , Jk−1} are tardy and the starting time of each job in {Jk+1, . . . , Jn}

must be less than d . Whether the starting time of Jk is less than d in the optimal schedule is unknown.

Three cases are considered according to the assignment of Jk in the OFF schedule and the optimal schedule. �Case 1: Jk is straddling in the OFF schedule and tardy in the optimal schedule (see Fig. 1).Let c1 = ∑k

j=1 aj , d1 = ∑kj=1 bj , c2 = ∑n

j=k+1 aj , d2 = ∑nj=k+1 bj , and suppose d1 = tc1 for some 0� t �1.

Because bj /aj �bi/ai for any j ∈ {1, 2, . . . , k} and i ∈ {k + 1, k + 2, . . . , n}, we get d1/c1 �d2/c2, i.e., d2 � tc2. Wethus have

COFF

COPT= c1 + (c2 − d2)

max{c2, d} + (c1 − d1)� c1 + (1 − t)c2

max{c2, d} + (1 − t)c1� c1 + (1 − t) max{c2, d}

max{c2, d} + (1 − t)c1. (1)

In addition, we have d �Ck−1 + bk = ∑k−1i=1 ai + bk �

∑ki=1 bi = d1 since Jk is straddling in the OFF schedule. It

follows that max{c2, d}/c1 �d1/c1 = t , i.e., max{c2, d}� tc1. Combining it with (1) and Lemma 5, we obtain

COFF

COPT� c1 + (1 − t)tc1

tc1 + (1 − t)c1.

Combining it with Lemma 3, we obtain COFF /COPT � 54 , a contradiction.

Page 4: A simple linear time algorithm for scheduling with step-improving processing times

M. Ji et al. / Computers & Operations Research 34 (2007) 2396–2402 2399

Fig. 2. Case 2: (i) one of the jobs in {Jk, . . . , Jn} is completed after d in the optimal schedule; (ii) all the jobs in {Jk, . . . , Jn} are completed by d inthe optimal schedule.

Case 2: Jk is straddling in the OFF schedule, and its start time is less than d in the optimal schedule (see Fig. 2).Let c1 = ∑k−1

j=1 aj , d1 = ∑k−1j=1 bj , c2 = ∑n

j=k+1 aj , d2 = ∑nj=k+1 bj . Then, we have

COFF

COPT= c1 + ak + (c2 − d2)

max{c2 + ak, d} + (c1 − d1)(2)

and

d �Ck−1 + bk = c1 + bk (3)

since Jk is a straddling job in the OFF schedule. No matter whether max{c2 + ak, d} = c2 + ak or d, from (2), usingthe proof by contradiction, we have

5

4<

COFF

COPT= c1 + (ak + c2) − d2

max{c2 + ak, d} + (c1 − d1)� c1 + d − d2

d + c1 − d1,

i.e., 5d1 > d + c1 + 4d2. It follows that

4d1 > d + c1 − d1. (4)

Combining (3) and (4), we obtain

4d1 > 2c1 + (bk − d1). (5)

We will easily complete the proof of Case 2 by proving the following Propositions 1–4.

Proposition 1. c1 �c2.

Proof. From Eq. (2), we have

c1 + ak + c2 − d2 = COFF �COPT = max{c2 + ak, d} + (c1 − d1)�c2 + ak + c1 − d1 (6)

and thus d1 �d2. Using the same arguments as in Case 1, we can show that

d1

c1� bk

ak

� d2

c2. (7)

It follows that c1 �c2. �

Proposition 2. c1 < ak .

Proof. Combining Proposition 1, (7) and Lemma 4, we get

d2 + ak

c2 + ak

� d1 + ak

c1 + ak

.

Page 5: A simple linear time algorithm for scheduling with step-improving processing times

2400 M. Ji et al. / Computers & Operations Research 34 (2007) 2396–2402

Let d1 + ak = t (c1 + ak) for some t, 0� t �1, then we have

d2 + ak � t (c2 + ak). (8)

So by (2), (8) and d1 = t (c1 + ak) − ak , we have

COFF

COPT= c1 + ak + (c2 − d2)

max{c2 + ak, d} + (c1 − d1)

� c1 + ak + c2 − (t (c2 + ak) − ak)

max{c2 + ak, d} + c1 − (t (c1 + ak) − ak)

� c1 + ak + (1 − t) max{c2 + ak, d}max{c2 + ak, d} + (1 − t)(c1 + ak)

. (9)

If c1 �ak , then from inequality (7) and Lemma 4, we have c1 + bk �d1 + ak . Combining this inequality and (3), weknow that

max{c2 + ak, d}c1 + ak

� d

c1 + ak

� c1 + bk

c1 + ak

� d1 + ak

c1 + ak

= t . (10)

Combining (9), (10) and Lemma 3, we have COFF /COPT � 54 , a contradiction. Hence, we have established that

c1 < ak . �

Proposition 3. d − ak < d1 + 23ak(d1/c1 − 1).

Proof. Inequality (7) and Proposition 2 imply that

d1 < bk . (11)

Thus, from (5) and (11), we have 4d1 > 2c1 + (bk − d1) > 2c1, i.e.,

d1 > 12 c1. (12)

By (12), we can suppose d1 = t ′c1 for some t ′, 12 < t ′ �1. It implies that d2 � t ′c2 from (7). So from (2), we have

COFF

COPT= c1 + ak + (c2 − d2)

max{c2 + ak, d} + (c1 − d1)� c1 + ak + (1 − t ′)c2

max{c2 + ak, d} + (1 − t ′)c1

= c1 + ak/(2 − t ′) + (1 − t ′)(c2 + ak/(2 − t))

max{c2, d − ak} + ak/(2 − t ′) + (1 − t ′)(c1 + ak/(2 − t ′))

� c1 + ak/(2 − t ′) + (1 − t ′)(max{c2, d − ak} + ak/(2 − t ′))max{c2, d − ak} + ak/(2 − t ′) + (1 − t ′)(c1 + ak/(2 − t ′))

. (13)

It is clear that 1/(2 − t ′) > 23 . So combining it with Lemma 5, we have

COFF

COPT�

c1 + 23ak + (1 − t ′)(max{c2, d − ak} + 2

3ak)

max{c2, d − ak} + 23ak + (1 − t ′)(c1 + 2

3ak). (14)

Suppose that d − ak �d9 + 23ak(d1/c1 − 2), we have max{c2, d − ak}�d − ak �d1 + 2

6ak(d1/c1 − 1). It impliesthat max{c2, d − ak}�(c1 + 2

3ak)d0/c1 − 2/3ak , i.e.,

max{c4, d − ak} + 23ak

c1 + 23ak

� d1

c1= t ′. (15)

We thus have COFF /COPT � 54 by (14), (15) and Lemma 3, a contradiction. The desired result follows. �

Proposition 4. d1 > c1.

Page 6: A simple linear time algorithm for scheduling with step-improving processing times

M. Ji et al. / Computers & Operations Research 34 (2007) 2396–2402 2401

Fig. 3. Case 3: (i) all the jobs in {Jk, . . . , Jn} are completed by d in the optimal schedule; (ii) one of the jobs in {Jk, . . . , Jn} are completed after d

in the optimal schedule.

Proof. From Proposition 3, we have

d − ak < d1 + 2

3ak

(d1

c1− 1

)�d1 + 2

3ak

(bk

ak

− 1

)= d1 + 2

3(bk − ak). (16)

It follows from (3) and (16) that c1 + bk �d < d1 + 23bk + 1

3ak . And we obtain c1 − d1 < 13 (ak − bk), i.e., (1 −

d1/c1)c1 < 13 (ak − bk). Combining with (7), we obtain (1 − bk/ak)c1 < 1

3 (ak − bk). It follows that((ak − bk)/ak)c1 < 1

3 (ak − bk). We obtain 1/c1 > 3/ak since ak �bk . Combining it with inequality (7), we havebk/ak �d1/c1 > (3/ak)d1, i.e., bk > 3d1. Substituting this inequality into (5), we can get d1 > c1. �

Proposition 4 contradicts the trivial fact that d1 �c1, therefore we have completed the proof of Case 2.Case 3: Jk is tardy in the OFF schedule, and its start time is less than d in the optimal schedule (see Fig. 3).Let c1 = ∑k−1

j=1 aj , d1 = ∑k−1j=1 bj , c2 = ∑n

j=k aj , d2 = ∑nj=kbj .

Case 3.1: All the jobs in {Jk, . . . , Jn} are completed by d in the optimal schedule (see Fig. 3(i)).For this case, we suppose d2=tc2 for some t, 0� t �1. Using the same arguments as in Case 1, we have d1/c1 �d2/c2

and d1 �(d2/c2)c1 = tc1. From the rule of algorithm OFF, we get

c1 = Ck−1 > d − bk �d − d2 �c2 − d2 = (1 − t)c2. (17)

Therefore,

COFF

COPT= d + (c2 − d2)

d + (c1 − d1)� c2 + (c2 − d2)

c2 + (c1 − d1)� c2 + (c2 − tc2)

c2 + (1 − t)c1.

Combining this inequality with (17), we have the following contradiction:

COFF

COPT� (2 − t)c2

c2 + (1 − t)(1 − t)c2= 2 − t

1 + (1 − t)2 �√

2

4 − 2√

2<

5

4.

Case 3.2: One of jobs in {Jk, . . . , Jn} is completed after d in the optimal schedule (see Fig. 3(ii)).For this case, we assume that job Ji, k� i�n, is straddling in the optimal schedule. Then we have c2 �d + ai − bi ,

i.e., d �(c2 − ai) + bi �d2. We suppose d2 = td for some t, 0� t �1. Using the same arguments as in Case 1, we haved1/c1 �d2/c2 and d1 �(d2/c2)c1 �(d2/d)c1 = tc1. From the rule of algorithm OFF, we get

c1 = Ck−1 > d − bk �d − d2 = (1 − t)d . (18)

Therefore,

COFF

COPT= d + (c2 − d2)

c2 + (c1 − d1)� d + (c2 − td)

c2 + (c1 − tc1)� d + (1 − t)d

d + (1 − t)c1.

Combining this inequality with (18), we have

COFF

COPT� (2 − t)d

d + (1 − t)(1 − t)d= 2 − t

1 + (1 − t)2 �√

2

4 − 2√

2<

5

4,

a contradiction again.

Page 7: A simple linear time algorithm for scheduling with step-improving processing times

2402 M. Ji et al. / Computers & Operations Research 34 (2007) 2396–2402

In summary, we have shown that algorithm OFF has a worst-case ratio no greater than 54 . To show that the worst-case

ratio cannot be smaller than 54 , we consider the following instance: I = ({J1, J2}, d) with a1 = 4, b1 = 2 − ε, a2 = 2,

b2 = 1 and d = 2, where ε is a sufficiently small positive number. It is not difficult to obtain that COFF (I) = 5 andCOPT(I ) = 4 + ε. Thus, the worst-case ratio tends to 5

4 when ε tends to 0. �

Acknowledgements

We are grateful for the constructive comments of an anonymous referee on an earlier version of this paper. Thiswork was supported in part by the National Natural Science Foundation of China under Grant numbers (10271110,60021201); the Teaching and ResearchAward Program for OutstandingYoung Teachers in Higher Education Institutionsof the MOE, China; and The Hong Kong Polytechnic University under Grant number G-T997.

References

[1] Cheng TCE, Ding Q, Lin BMT. A concise survey of scheduling with time-dependent processing times. European Journal of Operational Research2004;152:1–13.

[2] Cheng TCE, He Y, Hoogeveen H, Ji M, Woeginger GJ. Scheduling with step-improving processing times. Operations Research Letters 2005, toappear.

[3] Balas E, Zemel E. An algorithm for large zero-one knapsack problems. Operations Research 1980;28:1130–54.