7
Theoretical Computer Science 412 (2011) 5333–5339 Contents lists available at ScienceDirect Theoretical Computer Science journal homepage: www.elsevier.com/locate/tcs Online batch scheduling on parallel machines with delivery times Yang Fang, Xiwen Lu , Peihai Liu Department of Mathematics, School of Science, East China University of Science and Technology, Shanghai 200237, China article info Article history: Received 25 January 2011 Received in revised form 19 May 2011 Accepted 6 June 2011 Communicated by D.-Z. Du Keywords: Online algorithm Batch scheduling Parallel machines Delivery time abstract We study the online batch scheduling problem on parallel machines with delivery times. Online algorithms are designed on m parallel batch machines to minimize the time by which all jobs have been delivered. When all jobs have identical processing times, we provide the optimal online algorithms for both bounded and unbounded versions of this problem. For the general case of processing time on unbounded batch machines, an online algorithm with a competitive ratio of 2 is given when the number of machines m = 2 or m = 3, respectively. When m 4, we present an online algorithm with a competitive ratio of 1.5 + o(1). © 2011 Elsevier B.V. All rights reserved. 1. Introduction In this paper, we consider the online scheduling problem on m parallel batch machines to minimize the time by which all jobs have been delivered. For each job J j , it has a release time r j , a processing time p j and a delivery time q j . There are m parallel batch machines and sufficient number of vehicles. Once a job finishes its processing on a batch machine, it should be delivered to its destination by a vehicle. Let C j be the completion time on the batch machine of J j , and L j the time by which J j has been delivered, i.e., L j = C j + q j . Our goal is to minimize the time L max , by which all jobs have been delivered, i.e., L max = max j {L j : L j = C j + q j }. This problem can be described as Pm|r j , q j , B, online|L max . In classic machine scheduling problems, a machine can process at most one job at a time. Lee et al. [3] introduced the batch scheduling model. In our paper, the batch model is a burn-in model. A batch machine can process up to B jobs simultaneously as a batch. The processing time of a batch B i is the longest processing time of all jobs in the batch, and jobs in B i have the same beginning time and completion time. Once a batch starts to be processed, we cannot stop it. The batch machine could be bounded B < +∞ if the bound B of each batch size is finite, or unbounded B = +∞ if B is sufficiently large. In this paper, the online setting is over-time. Each job becomes available until its release time which is not known in advance. Once a job J j arrives, all its characteristics are known and it could be considered to be processed. Even the number of jobs n is unknown until the last job has been scheduled. The standard measure of quality of online algorithms is competitive ratio. For minimum optimal problem, an online algorithm is called ρ -competitive if, for any instance, the cost output by the online algorithm is at most ρ times the optimal offline cost. The competitive ratio of an online algorithm is defined as the infimum of all values ρ . Moreover, if there are is not an online algorithm with competitive ratio less than L for some problem, we call the lower bound of this problem as L. If the competitive ratio ρ of an algorithm for this online problem matches the lower bound, i.e. ρ = L, we call the algorithm optimal, or best possible. Hoogeveen and Vestjens [2] first study the online problem 1|r j , q j , online|L max . They show that the lower bound is ( 5 + 1)/2, and give the best possible algorithm. On identical parallel machines, the lower bound could not be smaller Corresponding author. Tel.: +86 21 64253262. E-mail address: [email protected] (X. Lu). 0304-3975/$ – see front matter © 2011 Elsevier B.V. All rights reserved. doi:10.1016/j.tcs.2011.06.011

Online batch scheduling on parallel machines with delivery times

Embed Size (px)

Citation preview

Theoretical Computer Science 412 (2011) 5333–5339

Contents lists available at ScienceDirect

Theoretical Computer Science

journal homepage: www.elsevier.com/locate/tcs

Online batch scheduling on parallel machines with delivery timesYang Fang, Xiwen Lu ∗, Peihai LiuDepartment of Mathematics, School of Science, East China University of Science and Technology, Shanghai 200237, China

a r t i c l e i n f o

Article history:Received 25 January 2011Received in revised form 19 May 2011Accepted 6 June 2011Communicated by D.-Z. Du

Keywords:Online algorithmBatch schedulingParallel machinesDelivery time

a b s t r a c t

We study the online batch scheduling problem on parallel machines with delivery times.Online algorithms are designed on m parallel batch machines to minimize the time bywhich all jobs have been delivered. When all jobs have identical processing times, weprovide the optimal online algorithms for both bounded and unbounded versions of thisproblem. For the general case of processing time on unbounded batch machines, an onlinealgorithm with a competitive ratio of 2 is given when the number of machines m = 2 orm = 3, respectively.Whenm ≥ 4, we present an online algorithmwith a competitive ratioof 1.5 + o(1).

© 2011 Elsevier B.V. All rights reserved.

1. Introduction

In this paper, we consider the online scheduling problem on m parallel batch machines to minimize the time by whichall jobs have been delivered. For each job Jj, it has a release time rj, a processing time pj and a delivery time qj. There are mparallel batch machines and sufficient number of vehicles. Once a job finishes its processing on a batch machine, it shouldbe delivered to its destination by a vehicle. Let Cj be the completion time on the batchmachine of Jj, and Lj the time bywhichJj has been delivered, i.e., Lj = Cj + qj. Our goal is to minimize the time Lmax, by which all jobs have been delivered, i.e.,Lmax = max

j{Lj : Lj = Cj + qj}. This problem can be described as Pm|rj, qj, B, online|Lmax.

In classicmachine scheduling problems, amachine canprocess atmost one job at a time. Lee et al. [3] introduced the batchschedulingmodel. In our paper, the batchmodel is a burn-inmodel. A batchmachine can process up to B jobs simultaneouslyas a batch. The processing time of a batch Bi is the longest processing time of all jobs in the batch, and jobs in Bi have thesame beginning time and completion time. Once a batch starts to be processed, we cannot stop it. The batch machine couldbe bounded B < +∞ if the bound B of each batch size is finite, or unbounded B = +∞ if B is sufficiently large.

In this paper, the online setting is over-time. Each job becomes available until its release time which is not known inadvance. Once a job Jj arrives, all its characteristics are known and it could be considered to be processed. Even the numberof jobs n is unknown until the last job has been scheduled.

The standard measure of quality of online algorithms is competitive ratio. For minimum optimal problem, an onlinealgorithm is called ρ-competitive if, for any instance, the cost output by the online algorithm is at most ρ times the optimaloffline cost. The competitive ratio of an online algorithm is defined as the infimum of all values ρ. Moreover, if there are isnot an online algorithm with competitive ratio less than L for some problem, we call the lower bound of this problem as L.If the competitive ratio ρ of an algorithm for this online problemmatches the lower bound, i.e. ρ = L, we call the algorithmoptimal, or best possible.

Hoogeveen and Vestjens [2] first study the online problem 1|rj, qj, online|Lmax. They show that the lower bound is(√5 + 1)/2, and give the best possible algorithm. On identical parallel machines, the lower bound could not be smaller

∗ Corresponding author. Tel.: +86 21 64253262.E-mail address: [email protected] (X. Lu).

0304-3975/$ – see front matter© 2011 Elsevier B.V. All rights reserved.doi:10.1016/j.tcs.2011.06.011

5334 Y. Fang et al. / Theoretical Computer Science 412 (2011) 5333–5339

than 1.5 (see Vestjens [8]). Hall and Shmoys show that the competitive ratio of the LS algorithm is 2. Liu [5] gives a 1.618-competitive algorithm for two machines.

For the batch version 1|rj, qj, B, online|Lmax, it is easy to see that the lower bound could not be smaller than (√5 + 1)/2

even if pj = 1 and qj = 0 [1,9]. Tian et al. [6] give a 2-competitive algorithm for the unbounded case and a 3-competitivealgorithm for the bounded case. When all jobs’ processing times are the same, i.e. pj = p, they provide optimal algorithmsfor both bounded and unbounded cases with competitive ratios of (

√5 + 1)/2.

Zhang et al. [9] address the problem Pm|rj, B = +∞, online|Cmax. They give a lower bound m+1√2, and present an onlinealgorithm with a competitive ratio of 1 + αm, where αm = (1 − αm)m−1. When all jobs have identical processing times,Zhang et al. [10] show that the lower bound could not be smaller than 1 + βm for the unbounded case and (

√5 + 1)/2 for

the bounded case, where (1 + βm)m+1= 2 + βm. They also provide the optimal algorithms for both cases. For the general

case on unbounded machines, Liu et al. [4] and Tian et al. [7] prove that the lower bound is 1+ (√m2 + 4−m)/2, and give

different optimal algorithms independently. Thus the problem Pm|rj, B = +∞, online|Cmax is settled.Here are some notations used in the paper. For any job set J , denote by r(J), p(J), and q(J), the minimum release time,

the largest processing time, and the largest delivery time of jobs in J , respectively. Let S(Bi) be the beginning time of batchBi. For any batch Bi, denote by J(i)(p(i), q(i)) and J∗(i)(p

(i), q∗

(i)), the longest job and the job having the largest delivery timeof Bi, i.e., p(i) = p(Bi) and q∗

(i) = q(Bi). We also use U(t) to denote the set of all unscheduled jobs available at time t . Letφ = (

√5 − 1)/2.

Inspired by [6,10], we study the problems Pm|rj, pj = p, qj, B < +∞, online|Lmax and Pm|rj, pj = p, qj, B =

+∞, online|Lmax in Sections 2 and 3, and give the optimal online algorithms respectively. In Section 4, we considerPm|rj, qj, B = +∞, online|Lmax. When m = 2, a 2-competitive algorithm H2 is given. Improving from the algorithm H2,we get an algorithm Hm for the case m ≥ 3. And the competitive ratio of Hm is 1.5 + o(1), which is 1.5 when m intends toinfinity.

2. The bounded case with identical processing times

In this section, we assume that all jobs have the same processing times on bounded batch machines. This problem canbe expressed as Pm|rj, pj = p, qj, B < +∞, online|Lmax. A batch is called full if it contains exactly B jobs. Otherwise, it isnon-full. Without loss of generality, we assume that the first job arrives at time 0.

It is well known that, for offline version of bounded batch scheduling problem on a single machine with identical releasetimes, the FBLPT (Full-Batch Longest Processing Time) rule can be used to achieve the minimal makespan. It is also usedto design an online algorithm. Similar to the FBLPT rule, we have the FBLDT (Full-Batch Largest Delivery Times) rule, andprovide an algorithm Hoff based on the FBLDT rule.Hoff : Index the jobs such that q1 ≥ q2 ≥ · · · ≥ qn. Group the first B jobs as a batch, the next B jobs as another batch and soon(The last batch may be non-full). Schedule the batches one by one whenever there is an idle machine.

Theorem 1. For the problem Pm|pj = p, qj, B < +∞|Lmax, the algorithm Hoff is optimal.

Proof. Since all jobs have the same processing times, the job having larger delivery time should be processed earlier. It iseasy to get an optimal schedule matching Hoff by pairwise interchange argument. �

By Theorem 1, it is better to schedule the jobs with larger delivery times. Now we give an online algorithm based on theFBLDT rule. By this algorithm, the schedule begins at t = φp.

Algorithm HB

Set t = φp. Repeat:Apply FBLDT to U(t). If there are more than m batches, then process the first m batches in [t, t + p] among all availablebatches. Otherwise, process all the available batches. Let t = t + p.

Theorem 2. For the problem Pm|rj, pj = p, qj, B < +∞, online|Lmax, Algorithm HB is optimal.

Proof. Let σ andπ be the schedule obtained by AlgorithmHB and an optimal schedule. According to AlgorithmHB, we knowthat any batch in σ starts at (φ + i)p, where i ≥ 0 and is an integer. Let Jl be the first job such that Ll(σ ) = Lmax(σ ), whichstarts at (φ + k)p. Without changing the value obtained by Algorithm HB and increasing the optimal value, we can removeall jobs processed at or after (φ + k)p except Jl. Suppose that rl < (φ + k)p. Otherwise, we have Lmax(σ ) = (φ + k+ 1)p+ qland Lmax(π) ≥ (φ + k + 1)p + ql, which implies that σ is an optimal schedule.

For convenience, we denote by Ii the interval [(φ + i)p, (φ + i + 1)p) (0 ≤ i ≤ k).Let Ix be the last interval before Jl such that during Ix in σ at least one of the following conditions holds:

1. there is at least one idle machine,2. there is at least one non-full batch,3. there is at least one job with a delivery time smaller than ql.

Y. Fang et al. / Theoretical Computer Science 412 (2011) 5333–5339 5335

If Ix exists, let G(l) denote the set which consists of job Jl and all jobs between Ix and Jl in σ . Otherwise, let G(l) denote theset of job Jl and all jobs scheduled before Jl in σ . Due to the definition of Ix, all jobs in G(l) have delivery time no less than ql.We shall refer to Ix as the interference interval for the schedule σ as it may delay the start times of the jobs in G(l).

If Ix exists, then by the definition of G(l), all jobs in G(l) are released after (φ + x)p. We have that Lmax(π) ≥ (φ + x)p +

(k − x)p + ql = (φ + k)p + ql and Lmax(σ ) = (φ + k + 1)p + ql, where k ≥ 1. Hence, we have

Lmax(σ )

Lmax(π)≤

(φ + k + 1)p + ql(φ + k)p + ql

≤ 1 +p

(φ + 1)p= 1 + φ.

Which means that Lmax(σ ) ≤ (1 + φ)Lmax(π).If Ix does not exist, then due to the definition of G(l), we have that Lmax(π) ≥ (k + 1)p + ql and Lmax(σ ) = (φ + k + 1)

p + ql. Thus Lmax(σ ) − Lmax(π) ≤ φp ≤ φLmax(π) which means that Lmax(σ ) ≤ (1 + φ)Lmax(π).Since the lower bound is 1 + φ, Algorithm HB is optimal. �

3. The unbounded case with identical processing times

In this section, we deal with the problem Pm|rj, pj = p, qj, B = +∞, online|Lmax. According to [10], the lower boundcannot be smaller than 1 + βm, where (1 + βm)m+1

= 2 + βm. Since B is infinite, we just need to decide when to startunscheduled jobs. Without loss of generality, we assume that the first job arrives at time 0.

Similar to HB, we consider to start a batch at time [(1 + βm)k − 1]p. Since (1 + βm)m+1= 2 + βm and k ≥ 1, we have

(1 + βm)k+m− 1 = (1 + βm)k−1(2 + βm) − 1 = (1 + βm)k + (1 + βm)k−1

− 1 ≥ (1 + βm)k.

Thus, the batch, which starts at [(1 + βm)k − 1]p, will complete not after [(1 + βm)k+m− 1]p. The algorithm and its

competitive analysis are as follows.

Algorithm H∞

Step1. Set k = 1, t = βmp.Step 2. If |U(t)| > 0, put all jobs of U(t) in batch Bk and start Bk at time t on machine k (modm). Otherwise, Bk = ∅.Step 3. Set k = k + 1, and t = [(1 + βm)k − 1]p. Return to Step 2.

According to Algorithm H∞, batch B(i−1)m+j should be assigned on machine Mj. We have proved that the batch whichstarts at [(1 + βm)k − 1]p will complete before or at the time [(1 + βm)k+m

− 1]p. Therefore, the batch Bk+m can start itsprocessing on the same machine at [(1 + βm)k+m

− 1]p. The beginning time of any batch Bi is [(1 + βm)i − 1]p.

Theorem 3. The competitive ratio of algorithm H∞ is 1 + βm.

Proof. Let σ and π be the schedule produced by H∞ and an optimal schedule. Choose any job Jj, and denote the batchcontaining it by Bk. We have rj > S(Bk−1) (set S(B0) = 0). Note that Lj(σ ) = (1+βm)kp+ qj and Lj(π) ≥ (1+βm)k−1p+ qj.Thus,

Lj(σ )/Lj(π) ≤ 1 + βm, ∀Jj

Therefore, Lmax(σ )/Lmax(π) ≤ 1 + βm.Since the lower bound cannot be smaller than 1 + βm, Algorithm H∞ is optimal. Its competitive ratio is 1 + βm. �

4. The general case on unbounded machines

In this section, we first give a 2-competitive online algorithm for P2|rj, qj, B = +∞, online|Lmax. Then, for the casem ≥ 3,we provide an algorithm with a competitive ratio of 1.5 + o(1), which is not greater than 2.

We partition U(t) into two sets A(t) and B(t).

A(t) = {Jj|qj ≥ αpj, Jj ∈ U(t)},B(t) = {Jj|qj < αpj, Jj ∈ U(t)},

where α depends on m. When m = 2, set α = φ.Now we give an algorithm for P2|rj, qj, B = +∞, online|Lmax. Denote two machines byM1 and M2.

Algorithm H2

(1) WhenM1 is idle and A(t) is not empty, start all jobs in A(t) at t onM1 if t ≥ (1+ φ)r(A(t)) + φp(A(t)). Otherwise, wait.(2) WhenM2 is idle and B(t) is not empty, start all jobs in B(t) at t onM2 if t ≥ (1+ φ)r(B(t)) + φp(B(t)). Otherwise, wait.

5336 Y. Fang et al. / Theoretical Computer Science 412 (2011) 5333–5339

By Algorithm H2, the jobs of A(t) are assigned to be processed on M1 and jobs of B(t) on M2. For convenience, let Aiand Bi be the batch processed on M1 and M2, respectively. By the algorithm, jobs of Bi arrive after S(Bi−1). If S(Bi) =

(1 + φ)r(Bi) + φp(Bi), we call Bi is a regular batch. Otherwise, it is called a non-regular batch. For a non-regular batchBi, S(Bi) = S(Bi−1) + p(Bi−1) and S(Bi) > (1 + φ)r(Bi) + φp(Bi). There are similar definitions and properties for batch Ai onM1.

Denote by σ and π , the schedule produced by H2 and an optimal schedule. We have an important property about theschedule σ according to the following lemma given in [10]:

Lemma 1 ([10]). If Bi is a regular batch, then Bi+1 or Bi+2 is also a regular batch.

This lemma also holds for batches on M1. According to Lemma 1, the consecutive batches Bi and Bi+1 both cannot be non-regular batches. Note that φ+φ2

= 1. If Bi is regular and Bi+1 is not, we have S(Bi)+p(i) = S(Bi+1) > (1+φ)S(Bi)+φp(i+1).

Then, p(i) > φS(Bi) + φp(i+1) ≥ φ2p(i) + φp(i+1). Therefore, (1 − φ2)p(i) > φp(i+1), i.e. p(i) > p(i+1).Let Jv be the first job such that Lv(σ ) = Lmax(σ ). Now we check all possible cases.

Lemma 2. If Jv is processed on M1, Lmax(σ )/Lmax(π) ≤ 2.

Proof. Assume that Jv belongs to batch Al, then Jv = J∗(l).If J(l) = J∗(l) and Al is a regular batch, we have Lmax(σ ) = (1 + φ)(r(Al) + p(l)) + q(l) and Lmax(π) ≥ r(Al) + p(l) + q(l).

Therefore, Lmax(σ )/Lmax(π) ≤ 1 + φ.If J(l) = J∗(l) and Al is a non-regular batch, we have Lmax(σ ) = S(Al−1)+p(l−1)+p(l)+q(l) and Lmax(π) ≥ S(Al−1)+p(l)+q(l).

Therefore, Lmax(σ ) − Lmax(π) ≤ p(l−1) ≤ Lmax(π).Thus, if J(l) = J∗(l) we can get Lmax(σ )/Lmax(π) ≤ 2. We continue our proof under the assumption J(l) is not J∗(l).

Case 1. If Al is regular, then Lmax(σ ) = S(Al) + p(l) + q∗

(l) = (1 + φ)(r(Al) + p(l)) + q∗

(l). For the optimal value, we haveLmax(π) ≥ r(Al)+ p(l) + q(l) ≥ r(Al)+ (1+φ)p(l) and Lmax(π) ≥ r(Al)+ q∗

(l). Thus, 2Lmax(π) ≥ 2r(Al)+ (1+φ)p(l) + q∗

(l) ≥

Lmax(σ ).Case 2. If Al is not regular, then Lmax(σ ) = S(Al−1) + p(l−1) + p(l) + q∗

(l). Note that q(l) ≥ φp(l) and q(l−1) ≥ φp(l−1). For theoptimal value, we have (1) Lmax(π) ≥ S(Al−1) + p(l) + q(l) ≥ φp(l−1) + (1+ φ)p(l); (2) Lmax(π) ≥ r(Al−1) + p(l−1) + q(l−1) ≥

(1 + φ)p(l−1); (3) Lmax(π) ≥ S(Al−1) + q∗

(l).By (1) × φ + (2) × φ2

+ (3), we have

2Lmax(π) ≥ S(Al−1) + φ2p(l−1) + p(l) + φp(l−1) + q∗

(l)

= S(Al−1) + p(l−1) + p(l) + q∗

(l) = Lmax(σ ).

The proof is complete. �

Lemma 3. If Jv is processed on M2, Lmax(σ )/Lmax(π) ≤ 2

Proof. Assume that Jv belongs to batch Bl; then Jv=J∗(l). Obviously, when J(l) = J∗(l), we can get Lmax(σ )/Lmax(π) ≤ 2 bymakingsimilar analysis as Lemma 2. The following proof is under the assumption that J(l) is not J∗(l).Case 1. Bl is regular. Lmax(σ ) = (1 + φ)(r(Bl) + p(l)) + q∗

(l). Note that p∗

(l) ≥ (1 + φ)q∗

(l), we have (1) Lmax(π) ≥ r(Bl) + p∗

(l)+ q∗

(l) ≥ r(Bl) + (2 + φ)q∗

(l) and (2) Lmax(π) ≥ r(Bl) + p(l).By (1) × φ2

+ (2) × (1 + φ), we have

2Lmax(π) ≥ 2r(Bl) + (1 + φ)p(l) + q∗

(l) ≥ Lmax(σ ).

Case 2. Bl is not regular. Lmax(σ ) = S(Bl−1) + p(l−1) + p(l) + q∗

(l). Without changing the value obtained by the algorithm andincreasing the optimal value, we assume that there is only one job J(l−1) (r(Bl−1), p(l−1), 0) in Bl−1. Note that p∗

(l) ≥ (1+φ)q∗

(l)and p(l−1) > p(l).

1. J(l) and J∗(l) are scheduled on the same machine in π . If they are scheduled in the same batch, then Lmax(π) ≥ S(Bl−1) +

p(l) + q∗

(l). Otherwise, Lmax(π) ≥ S(Bl−1) + p(l) + p∗

(l) ≥ S(Bl−1) + p(l) + q∗

(l). Therefore, Lmax(σ ) − Lmax(π) ≤ p(l−1) ≤

Lmax(π).2. J(l−1) and J∗(l) are scheduled on the samemachine inπ . If they are scheduled in the same batch, then Lmax(π) ≥ p(l−1)+q∗

(l).Otherwise, Lmax(π) ≥ p(l−1) + p∗

(l) ≥ p(l−1) + q∗

(l). Therefore, Lmax(σ ) − Lmax(π) ≤ S(Bl−1) + p(l) ≤ Lmax(π).3. J(l−1) and J(l) are scheduled on the same machine in π . If they are scheduled in the same batch, then Lmax(π) ≥

p(l−1) + S(Bl−1) ≥ p(l−1) + φp(l−1) ≥ p(l−1) + φp(l). Otherwise, Lmax(π) ≥ p(l−1) + p(l) ≥ p(l−1) + φp(l). Sincep(l) ≥ p∗

(l) ≥ (1 + φ)q∗

(l), we can derive that Lmax(π) ≥ p(l−1) + q∗

(l). Therefore, Lmax(σ ) − Lmax(π) ≤ S(Bl−1) + p(l) ≤

Lmax(π).

Hence we get this lemma. �

Theorem 4. The competitive ratio of Algorithm H2 is 2.

Y. Fang et al. / Theoretical Computer Science 412 (2011) 5333–5339 5337

Proof. By Lemmas 2 and 3, we know that the competitive ratio of Algorithm H2 is at most 2. Now we give an instance toshow that the bound is tight. At time 0, two jobs J1(1, φ) and J2(0, 1+ φ) arrive. They are put in the same batch and startedat time φ. In the optimal schedule, J2 is processed before J1 at time 0. Lmax(σ ) = 2(1 + φ), and Lmax(π) = 1 + φ. Therefore,the competitive ratio of Algorithm H2 is 2. �

Similar to the idea of AlgorithmH2, we get the following algorithm. Ifm is odd, letm = 2k+1. Otherwise, letm = 2k+2,where k ≥ 1 and is an integer. Note that ⌈m/2⌉ = k + 1. When m = 2k + 1, α =

k2+k−1k2+2k+1

. Whenm = 2k + 2, α =k+1k+2 .

Algorithm Hm:(1) WhenmachineMj ofM1,M2, . . . ,M⌈m/2⌉ is idle and A(t) = ∅, make decision as follows. If t ≥ (1+ δ)r(A(t))+ δp(A(t)),process all jobs in A(t) at t onMj. Otherwise, wait.(2) When machineMj ofM⌈m/2⌉+1, . . . ,Mm is idle and B(t) = ∅, make decision as follows. If t ≥ (1 + δ)r(B(t)) + δp(B(t)),process all jobs in B(t) at t onMj. Otherwise, wait.Where δ = 1/⌈m/2⌉ and δ = 1/⌊m/2⌋.

Denote by σ and π , the schedule produced by Hm and an optimal schedule. According to Algorithm Hm, we can get thisproperty about σ .

Lemma 4. In σ , any batch Bi scheduled on machine Mj, j = 1, . . . , ⌈m/2⌉, is a regular batch, i.e. S(Bi) = (1+ δ)r(Bi) + δp(Bi).

Proof. Note that ⌈m/2⌉ = k + 1 whether m is an odd number 2k + 1 or an even number 2k + 2. Suppose to the contrarythat there exists at least one non-regular batch on machine Mj, j = 1, . . . , k + 1. Let Bv be the first one, which starts att = S(Bv) > (1 + δ)r(Bv) + δp(Bv). Thus on every machine Mj, j = 1, . . . , k + 1, there is one batch processed in [r(Bv), t].These k + 1 batches start before r(Bv) and complete not before t . For ease of description, we denote these batches byB′

1, . . . , B′

k+1 such that S(B′

1) < S(B′

2) < · · · < S(B′

k+1). Since Bv is the first non-regular batch, the batches B′

1, · · ·, B′

k+1 areregular.

Since Bv is not regular, we have min1≤i≤k+1

{S(B′

i) + p′

(i)} ≥ S(Bv) > (1 + δ)r(Bv) + δp(Bv). By r(Bv) > S(B′

k+1), we derive

that min1≤i≤k+1

{S(B′

i) + p′

(i))} > (1 + δ)S(B′

k+1).

We will prove that S(B′

k+1) > 11−jδ S(B

k+1−j), j = 1, . . . , k. (*)In fact, when j = 1, we have S(B′

k+1) + p′

(k+1) > (1 + δ)S(B′

k+1), then

p′

(k+1) > δS(B′

k+1) > (1 + δ) · δS(B′

k) + δ2p′

(k+1).

We get p′

(k+1) > δ1−δ

S(B′

k). Therefore,

S(B′

k+1) > (1 + δ)S(B′

k) + δp′

(k+1) >1

1 − δS(B′

k).

Then the inequality (*) is right for j = 1.Now let j ≥ 2 and the inequality (*) is true for 1, . . . , j − 1, then S(B′

k+1) > 11−(j−1)δ S(B

k+2−j). Thus,

S(B′

k+2−j) + p′

(k+2−j) > (1 + δ)S(B′

k+1) >1 + δ

1 − (j − 1)δS(B′

k+2−j).

We have

p′

(k+2−j) >jδ

1 − (j − 1)δS(B′

k+2−j) >jδ

1 − (j − 1)δ[(1 + δ)S(B′

k+1−j) + δp′

(k+2−j)].

This implies that

(1 + δ)(1 − jδ)1 − (j − 1)δ

p′

(k+2−j) >jδ(1 + δ)

1 − (j − 1)δS(B′

k+1−j).

Then, p′

(k+2−j) >jδ

1−jδ S(B′

k+1−j).Therefore,

S(B′

k+2−j) > (1 + δ)S(B′

k+1−j) + δp′

(k+2−j) >1 − (j − 1)δ

1 − jδS(B′

k+1−j).

Reminding of S(B′

k+1) > 11−(j−1)δ S(B

k+2−j), we can get S(B′

k+1) > 11−jδ S(B

k+1−j). Hence the inequality (*) is true.According to the inequality (*) and δ = 1/(k + 1), we have

(1 + δ)S(B′

k+1) − S(B′

1) − p′

(1) >1 + δ

1 − kδS(B′

1) − S(B′

1) − p′

(1)

5338 Y. Fang et al. / Theoretical Computer Science 412 (2011) 5333–5339

= (k + 1)S(B′

1) − p′

(1)

≥ (k + 1)δp′

(1) − p′

(1) = 0.

Therefore, we get (1 + δ)S(B′

k+1) > S(B′

1) + p′

(1), which contradicts

min1≤i≤k+1

{S(B′

i) + p′

(i)} > (1 + δ)S(B′

k+1).

This means that Bv is regular. Therefore, any batch Bi scheduled on machineMj is a regular batch, for j = 1, . . . , k + 1. �

Note that the proof of Lemma 4 has no connection with qj. Hence, by making similar analysis, we can derive that anybatch onMj, j = ⌈m/2⌉ + 1, . . . ,m, is regular. Therefore, we have the following lemma:

Lemma 5. In σ which is produced by Algorithm Hm, any batch is regular.

Let Jv be the first job such that Lv(σ ) = Lmax(σ ). Assuming that Jv belongs to batch Bl, then Jv = J∗(l). Wemake competitiveanalysis by checking all possible cases where Bl is scheduled.

Lemma 6. If Bl is scheduled on Mj, j = 1, . . . , ⌈m/2⌉, then Lmax(σ ) ≤ (1 + R1)Lmax(π), where R1 = (1 + δ)/(1 + α).

Proof. Since Bl is regular, we have Lmax(σ ) = (1 + δ)(r(Bl) + p(l)) + q∗

(l). Since α ≤ 1 and δ ≤ 1, we have αδ + δ ≤ 1 + δ.Then δ ≤ (1 + δ)/(1 + α) = R1.

For the optimal value, we have (1) Lmax(π) ≥ r(Bl) + p(l) + q(l) ≥ r(Bl) + (1+ α)p(l) and (2) Lmax(π) ≥ r(Bl) + q∗

(l). Thenby (1) × R1 + (2), we get

(1 + R1)Lmax(π) ≥ (1 + R1)r(Bl) + (1 + δ)p(l) + q∗

(l)

≥ (1 + δ)r(Bl) + (1 + δ)p(l) + q∗

(l) = Lmax(σ ).

The result holds. �

Lemma 7. If Bl is scheduled on Mj, j = ⌈m/2⌉ + 1, . . . ,m, then Lmax(σ ) ≤ (1 + R2)Lmax(π), where R2 = δ + α/(1 + α).

Proof. Since Bl is regular, we have Lmax(σ ) = (1 + δ)(r(Bl) + p(l)) + q∗

(l). For the optimal value, we have (1) Lmax(π) ≥

r(Bl) + p(l) and (2) Lmax(π) ≥ r(Bl) + p∗

(l) + q∗

(l) ≥1+αα

q∗

(l). Then by (1) × (1 + δ) + (2) × α/(1 + α), we can derive that

(1 + R2)Lmax(π) ≥ (1 + δ)(r(Bl) + p(l)) + q∗

(l) = Lmax(σ ).

The result follows. �

Theorem 5. The competitive ratio of Algorithm Hm is

ρ =

ρ1 = 1 +

(k+1)(k+2)k(2k+3) , if m = 2k + 1

ρ2 = 1 +(k+2)2

(k+1)(2k+3) , if m = 2k + 2,

where k ≥ 1 and is an integer.

Proof. Whenm = 2k + 1, δ = 1/(k + 1), δ = 1/k, the competitive ratio of Algorithm Hm is at most

ρ = 1 + max{R1, R2} = 1 + max

11 + α

×k + 2k + 1

,1k

(1 + α)

.

When α =k2+k−1k2+2k+1

, ρ achieves its minimal value

ρ1 = 1 +(k + 1)(k + 2)

k(2k + 3).

Whenm → +∞, ρ1 → 1.5.Whenm = 2k + 2, δ = 1/(k + 1), δ = 1/(k + 1), the competitive ratio of Algorithm Hm is at most

ρ = 1 + max{R1, R2} = 1 + max

11 + α

×k + 2k + 1

,1

k + 1+

α

(1 + α)

.

When α =k+1k+2 , ρ achieves its minimal value

ρ2 = 1 +(k + 2)2

(k + 1)(2k + 3).

Whenm → +∞, ρ2 → 1.5.Similar to the one in Theorem 4, we can present an instance to show that the bound ρ is tight. �

Y. Fang et al. / Theoretical Computer Science 412 (2011) 5333–5339 5339

It is easy to see that ρ < 2 when m ≥ 4. When m = 3, ρ = 2.2 > 2. We can easily make a small modification forAlgorithm Hm for m = 3 : (1) set α = 1; (2) process jobs in A(t) on M1 if t ≥ (1 + δ)r(A(t)) + p(A(t)); (3) process jobs inB(t) on M2 or M3 if t ≥ (1 + δ)r(B(t)) + δ(B(t)), where δ = 1 and δ = 1/2. Then, we can get its competitive ratio as 2 bymaking a similar proof.

Our results in this section can be described as follows:

1. Whenm = 2, upper bound is 2.2. Whenm = 3, upper bound is 2.3. Whenm = 2k + 1, k ≥ 2, upper bound is ρ1 = 1 +

(k+1)(k+2)k(2k+3) .

4. Whenm = 2k + 2, k ≥ 1, upper bound is ρ2 = 1 +(k+2)2

(k+1)(2k+3) .

Whenm tends to +∞, both ρ1 and ρ2 tend to 1.5.

Acknowledgements

This research was supported by the grant 09ZR1407200 of the Science Foundation of Shanghai and the National NaturalScience Foundation of China (No. 11071072).

References

[1] X. Deng, C.K. Poon, Y. Zhang, Approximation algorithms in batch processing, Jounal of Combinatorial Optimizations 7 (2003) 247–257.[2] J.A. Hoogeveen, A.P.A. Vestjean, A best possible deterministic online algorithm for minimizing maximum delivery times on a single machine, SIAM

Journal on Discrete Mathematics 13 (2000) 56–63.[3] C.Y. Lee, R. Uzsoy, L.A. MartinVega, Efficient algorithms for scheduling semiconductor burn-in operations, Operations Research 40 (1992) 764–775.[4] P. Liu, X. Lu, Y. Fang, A best possible deterministic online algorithm for minimizing makespan on parallel batch machines. Journal of Scheduling,

doi:10.1007/s10951-009-0154-4.[5] P. Liu, Personal Communication.[6] J. Tian, R. Fu, J. Yuan, Online scheduling with delivery time on a single batch machine, Theoretical Computer Science 374 (2007) 49–57.[7] J. Tian, T.C.E. Cheng, C.T. Ng, J. Yuan, Online scheduling on unbounded parallel-batch machines to minimize the makespan, Information Processing

Letters 109 (2009) 1211–1215.[8] A.P.A. vestjens, online machine scheduling. Ph.D. Thesis, Department of mathematics and Computing Science, Eindhoven University of Techology,

Eindhoven, The Netherlands, 1997.[9] G. Zhang, X. Cai, C.K. Wong, online algorithms for minimizing makespan on batch processing machines, Naval Research Logistics 48 (2001) 241–258.

[10] G. Zhang, X. Cai, C.K. Wong, Optimal online algorithms for scheduling on parallel batch processing machines, IIE Transactions 35 (2003) 175–181.