Preemptive Scheduling of Independent Jobs on ... - Semantic Scholar

3 downloads 666 Views 209KB Size Report
scheduling of independent jobs on m identical parallel machines subject to a ... of any job Jj on a machine Mi can be interrupted and resumed at any later time ...
c Pleiades Publishing, Ltd., 2010. ISSN 0005-1179, Automation and Remote Control, 2010, Vol. 71, No. 10, pp. 2093–2101. ⃝ c S.V. Sevastyanov, R.A. Sitters, A.V. Fishkin, 2010, published in Avtomatika i Telemekhanika, 2010, No. 10, pp. 90–99. Original Russian Text ⃝

MULTI-MACHINE AND MULTI-STAGE SCHEDULING ENVIRONMENTS

Preemptive Scheduling of Independent Jobs on Identical Parallel Machines Subject to Migration Delays1 S. V. Sevastyanov,∗ R. A. Sitters,∗∗ and A. V. Fishkin∗∗∗ ∗

Sobolev Institute of Mathematics, Siberian Branch, Russian Academy of Sciences, Novosibirsk State University, Novosibirsk, Russia ∗∗ Free University, Amsterdam, Netherlands ∗∗∗ Siemens AG Corporate Technology, Munchen, Germany Received January 12, 2010

Abstract—We present hardness and approximation results for the problem of preemptive scheduling of 𝑛 independent jobs on 𝑚 identical parallel machines subject to a migration delay 𝑑 with the objective to minimize the makespan. We give a sharp threshold on the value of 𝑑 for which the complexity of the problem changes from polynomial time solvable to NP-hard. Next, we give initial results supporting a conjecture that there always exists an optimal schedule with at most 𝑚 − 1 job migrations. Finally, we provide a 𝑂(𝑛) time (1 + 1/ log2 𝑛)-approximation algorithm for 𝑚 = 2. DOI: 10.1134/S0005117910100085

1. INTRODUCTION We consider the problem of scheduling independent jobs on identical parallel machines subject to migration delays so as to minimize the makespan. Formally, there are 𝑚 identical machines 𝑀1 , . . . , 𝑀𝑚 which are used to process 𝑛 jobs, 𝐽1 , . . . , 𝐽𝑛 . Each job 𝐽𝑗 (𝑗 = 1, . . . , 𝑛) has a processing time 𝑝𝑗 . Each machine can process at most one job at a time, and each job can be processed by at most one machine at a time. Preemption with a migration delay 𝑑 is allowed, that is, the processing of any job 𝐽𝑗 on a machine 𝑀𝑖 can be interrupted and resumed at any later time on 𝑀𝑖 , and at least 𝑑 time units later if 𝐽𝑗 migrates to another machine 𝑀𝑘 . The goal is to schedule the jobs so as to minimize the makespan. By extending the three-fold notation [1, 2], we denote this problem as ⟨𝛼 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩, where 𝛼 is either 𝑃 𝑚 (for a fixed number 𝑚 of machines), or 𝑃 (for an arbitrary number of machines). In classical scheduling models the migration of a job is done without a delay constraint. For instance, in [3], while considering problems with preemption the following assumption is made: “interruptions cause no time or other penalties.” However, in production planning, for example, it is natural to reserve some time for the transition of a product from one machine to another. Simply speaking,the transportation of the product takes time. Besides, technical issues might make it necessary to wait for some time after completing the processing of a job (e.g., a heated product might need to cool down first, or a product needs to be dried before its next operation can start). We refine the classical model of identical machines by adding a delay constraint 𝑑, which is independent of the job and the machines. The model under consideration generalizes two basic identical machine scheduling models. If the delay is zero, we obtain the preemptive problem, ⟨𝑃 ∣ 𝑝𝑚𝑡𝑛 ∣ 𝐶max ⟩, which can be solved efficiently 1

This work was supported by the Russian Foundation for Basic Research, project no. 08-01-00370. 2093

2094

SEVASTYANOV et al.

by McNaughtons’s wrap around rule [4]. On the other hand, for large enough delay 𝑑 no job will migrate in the optimal schedule (and so, there is no need in preemption). In this case we obtain the classical non-preemptive problem ⟨𝑃 ∣∣ 𝐶max ⟩ which is strongly NP-hard [5]. An intriguing question is what happens for the intermediate values of 𝑑? When the hard problem becomes easy? Is there a simple rule, like McNaughton’s one, which solves the problem? Is there a good approximation algorithm? Known results. The two-machine non-preemptive problem, ⟨𝑃 2 ∣∣ 𝐶max ⟩, is NP-hard [5]. There is an exact pseudo-polynomial time algorithm for ⟨𝑃 𝑚 ∣∣ 𝐶max ⟩ [6]. Regarding approximation, there is a polynomial time approximation scheme (PTAS) for the general problem, ⟨𝑃 ∣∣ 𝐶max ⟩ [7], that is, a family of approximation algorithms {𝐴𝜀 }𝜀>0 such that, given an instance of the problem and a given accuracy 𝜀 > 0, algorithm 𝐴𝜀 finds a solution within a factor of (1 + 𝜀) of the optimum in time polynomial in the size of the input (for fixed 𝜀). Among the very first papers dedicated to scheduling on identical parallel machines with preemption (problem ⟨𝑃 2 ∣ 𝑝𝑚𝑡𝑛 ∣ 𝐶max ⟩ and its modifications) there are the papers by academician Tanaev and his progenies (see, e.g., [8, 9]), where such questions as bounding the number of interruptions and limitation of the set of time moments at which interruptions may occur in an optimal schedule were investigated. Our problem is closely related to the problem of scheduling unit-length jobs with precedence constraints and equal communication delays, ⟨𝑃 ∣ 𝑝𝑟𝑒𝑐, 𝑝𝑗 = 1, 𝑐𝑗𝑘 = 𝑑 ∣ 𝐶max ⟩, where the precedence relation between two jobs 𝐽𝑗 and 𝐽𝑘 implies that job 𝐽𝑘 starts after job 𝐽𝑗 is completed, and at least 𝑑 time units later if the jobs are processed on different machines. If in a schedule for our problem all preempted parts are integral, then we obtain a schedule for an instance of the above problem with chains-like precedence constraints, ⟨𝑃 ∣ 𝑐ℎ𝑎𝑖𝑛𝑠, 𝑝𝑗 = 1, 𝑐𝑗𝑘 = 𝑑 ∣ 𝐶max ⟩. The version of unit communication delays, ⟨𝑃 ∣ 𝑝𝑟𝑒𝑐, 𝑝𝑗 =( 1, 𝑐𝑗𝑘 =) 1 ∣ 𝐶max ⟩, is well studied. 4 Regarding approximation, Hanen & Munier [10] presented a 73 − 3𝑚 -approximation algorithm. (

)

Lenstra & Veltman [11] showed that there is no 54 − 𝜀 -approximation algorithm unless 𝑃 = 𝑁 𝑃 . Improving these bounds remains one of the most challenging problems in scheduling theory [12]. Far less is known for the general version with large communication delays. Engels et al. [13] considered a version of the problem with tree-like precedence constraints and general communication delays, ⟨𝑃 ∣ 𝑡𝑟𝑒𝑒, 𝑝𝑗 = 1, 𝑐𝑗𝑘,𝑖𝑞 ∣ 𝐶max ⟩, where 𝑐𝑗𝑘,𝑖𝑞 depends on the pair of machines (𝑖, 𝑞) and the pair of jobs (𝑗, 𝑘). They showed that there is a polynomial time algorithm if all 𝑐𝑗𝑘,𝑖𝑘 are bounded by some constant. As soon as communication delays are considered as part of the input, the problem becomes harder to solve. Afrati et al. [14] showed that the two-machine problem with tree-like precedence constraints and equal communication delays, ⟨𝑃 2 ∣ 𝑡𝑟𝑒𝑒, 𝑝𝑗 = 1, 𝑐𝑗𝑘 = 𝑑 ∣ 𝐶max ⟩, is NP-hard. Engels [15] showed that the single-machine problem with chain-like precedence constraints and just two possible delays, ⟨1 ∣ 𝑐ℎ𝑎𝑖𝑛𝑠, 𝑝𝑗 = 1, 𝑐𝑗𝑘 ∈ {0, 𝑑} ∣ 𝐶max ⟩, is NP-hard. Our results. In this paper we add a migration restriction to the classical model of scheduling on identical machines. We present hardness and approximation results. In Section 2 we show that . the sub-problem 𝑋𝜆 of problem 𝑋 = ⟨𝑃 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩ with 𝑚 machines and delays 1 ∑𝑛 𝑛 𝑑 ⩽ 𝜆(Δ − 𝑝max ) (where 𝑝max = max𝑗=1 𝑝𝑗 , 𝐿 = 𝑚 𝑗=1 𝑝𝑗 , and Δ = max{𝑝max , 𝐿}) can be solved in linear time for every 𝜆 ∈ [0, 1] and is strongly NP-hard for each 𝜆 > 1. Thus, we established an exact threshold between easy and hard problems. In Section 3 we investigate properties of the optimal schedule. We show that for the twomachine problem, ⟨𝑃 2 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩, there always exists an optimal schedule which yields at most one preemption, and for the three-machine problem, ⟨𝑃 3 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩, there exists an optimal schedule which yields at most two migrations. This leads to exact pseudopolynomial time algorithms for those problems. We conjecture that there always exists an optimal AUTOMATION AND REMOTE CONTROL

Vol. 71

No. 10

2010

PREEMPTIVE SCHEDULING OF INDEPENDENT JOBS

2095

schedule which yields at most 𝑚 − 1 migrations for ⟨𝑃 𝑚 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩. Further, we show that for any instance of ⟨𝑃 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩ there exists an optimal schedule in which no machine idles until its completion time. In Section 4 we give an algorithm which finds a near-optimal solution for any instance of the twomachine problem. The algorithm outputs either an optimal preemptive schedule, or a near-optimal ( 1 ) schedule (of length at most 1 + log 𝑛 times the optimum) without preemption; in particular, it 2 ( ) outputs the optimal solution if delay 𝑑 is at most 1 − log2 𝑛 Δ. The running time of the algorithm 2 is linear in the number of jobs, 𝑛. As mentioned above, our model is closely related to scheduling with communication delays. Most of the results presented can be directly converted into similar results for ⟨𝑃 ∣ 𝑐ℎ𝑎𝑖𝑛𝑠, 𝑝𝑗 = 1, 𝑐𝑗𝑘 = 𝑑 ∣ 𝐶max ⟩. No results for this model with large communication delays were known before. 2. COMPLEXITY Let OPT denote the optimum, 𝑝max = max𝑛𝑗=1 𝑝𝑗 be the maximum processing time of job, and 1 ∑𝑛 𝐿= 𝑚 𝑗=1 𝑝𝑗 be the average machine load. We define Δ = max{𝑝max , 𝐿}. Then the following evident bounds on the optimum hold Δ ⩽ OPT ⩽ Δ + 𝑝max ⩽ 2Δ.

(1)

Problem ⟨𝑃 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩ will be shortly referred to as problem 𝑋, while 𝑋𝜆 will denote the sub-problem with delays 𝑑 ⩽ 𝜆(Δ − 𝑝max ). McNaughton’s rule. Recall that any instance with 𝑑 = 0 can be solved by using McNaughton’s wrap around rule [4]: select the jobs one by one in some order and sequentially fill up the schedules of machines 𝑀1 , . . . , 𝑀𝑚 within the time interval [0, Δ]. If on a current machine 𝑀𝑖 there is no enough room for the next in turn job, first complete the schedule of 𝑀𝑖 , and only then move the rest of the job to the beginning of the schedule of the next machine 𝑀𝑖+1 . The procedure outputs a schedule of length Δ in 𝑂(𝑛) time. By adopting this result, we can provide the following Theorem 1. The sub-problem 𝑋𝜆 of problem 𝑋 can be solved in linear time for every 𝜆 ∈ [0, 1], and appears to be strongly NP-hard for each 𝜆 > 1. Proof. Let 𝑑 ⩽ Δ − 𝑝max . If Δ = 𝑝max , then 𝑑 = 0 and McNaughton’s rule gives an optimal 1 ∑𝑛 schedule of length Δ. If Δ = 𝐿 = 𝑚 𝑗=1 𝑝𝑗 , then McNaughton’s rule gives a schedule of length 𝐿. Indeed, consider the job 𝐽𝑗 that gets preempted and migrates from a machine 𝑀𝑖 to machine 𝑀𝑖+1 . The gap between the part of job 𝐽𝑗 on machine 𝑀𝑖 and the other part of 𝐽𝑗 on machine 𝑀𝑖+1 is exactly 𝐿 − 𝑝𝑗 , which is at least 𝐿 − 𝑝max ≥ 𝑑. Hence, the delay constraint is satisfied. The running time is linear in the number of jobs, 𝑛. Next, we assume that 𝑑 > Δ − 𝑝max . We provide a hardness result for our problem. We reduce from the strongly NP-hard problem 𝛼-PARTITION [16]: Instance: 𝑘𝛼 positive numbers 𝑒1 , 𝑒2 . . . , 𝑒𝛼𝑘 , 𝐸 ∈ Z+ such that 𝛼𝑘 ∑

𝑒𝑖 = 𝑘𝐸

and

𝑖=1

𝐸 𝐸 < 𝑒𝑖 < 𝛼+1 𝛼−1

for all

𝑖 = 1, . . . , 𝛼𝑘.

(2)

Question: Is there a partition of {1, 2, . . . , 𝛼𝑘} into 𝑘 disjoint subsets 𝑁1 , . . . , 𝑁𝑘 such that ∑

𝑒𝑖 = 𝐸

for all

ℓ = 1, . . . , 𝑘?

𝑖∈𝑁ℓ

AUTOMATION AND REMOTE CONTROL

Vol. 71

No. 10

2010

(3)

2096

SEVASTYANOV et al.

Given an instance of 𝛼-PARTITION, we construct an instance of our problem as follows. We define the number of machines 𝑚 = 𝛼𝑘, the number of jobs 𝑛 = 𝑚 + 𝑘, and the migration delay 𝑑 = 𝐸/(𝛼 − 1). We next define 𝑚 large jobs 𝐽𝑗 (𝑗 = 1, . . . , 𝑚) with processing times 𝑝𝑗 = 2𝐸 − 𝑒𝑗 , and 𝑘 small jobs 𝐽𝑗 (𝑗 = 𝑚 + 1, . . . , 𝑚 + 𝑘) with equal processing times 𝑝𝑚+1 = ⋅ ⋅ ⋅ = 𝑝𝑚+𝑘 = 𝐸. Then 𝐿 = 2𝐸 > 𝑝max . Thus, we have Δ = 𝐿. It can be seen that the input length of the above construction is polynomial in 𝑘 and 𝛼. Next we show that the instance of 𝛼-PARTITION yields the “YES”-answer if and only if the constructed instance of our problem yields a schedule of length 𝐿. Assume that we have a schedule 𝜎 of length 𝐿. Since 𝑑 = 𝐸/(𝛼 − 1) and 𝐿 = 2𝐸 = 𝐸 + (𝛼 − 1)𝑑 < 𝐸 + 𝛼𝑑, we can conclude that each small job migrates in 𝜎 at most (𝛼−1) times. On the other hand, from (2) 𝐸 we have that 𝑑 = 𝛼−1 > 𝑒𝑖 and 𝑑 + (2𝐸 − 𝑒𝑖 ) > 𝐿 (𝑖 = 1, . . . , 𝑚). This implies that no large job migrates, and hence, each machine processes exactly one large job and should process at least one small job for some time, whereas each small job can be processed by at most 𝛼 machines. Since there are 𝑚 = 𝛼𝑘 machines and 𝑘 small jobs, each small job is processed by exactly 𝛼 machines and no machine processes two different small jobs. This gives a feasible solution for the given instance of 𝛼-PARTITION. Similarly, one can also see that any feasible solution for an instance of 𝛼-PARTITION leads to a schedule of length 𝐿 for the constructed instance of our problem. In the instance we have that 𝑑=

𝛼+1 𝐸 𝛼+1 2 𝐸 = < 𝑒min = 1 + (Δ − 𝑝max ), 𝛼−1 𝛼−1 𝛼+1 𝛼−1 𝛼−1 (

)

𝑚+𝑘 where 𝑒min = min𝑚 𝑗=1 𝑒𝑗 , Δ = 𝐿 = 2𝐸 and 𝑝max = max𝑗=1 𝑝𝑗 = 2𝐸 − 𝑒min . Thus, for any 𝜆 > 1 2 one can find a fixed 𝛼 ∈ Z+ such that 1 + 𝛼−1 ⩽ 𝜆. Hence, the sub-problem 𝑋𝜆 contains the above instance and, thereby, is strongly NP-hard. ⊔ ⊓

3. PROPERTIES OF THE OPTIMAL SCHEDULE Theorem 2. For any instance of the two-machine problem ⟨𝑃 2 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩ there exists an optimal schedule with at most one interruption. Proof. Given an optimal schedule 𝜎 of length OPT, we construct a new optimal schedule 𝜎 ′ as follows. Let 𝐿𝑖 (𝑖 = 1, 2) be the total load of the jobs which completely run on machine 𝑀𝑖 in schedule 𝜎 without migrations (although, maybe, with preemption). We reschedule the jobs of 𝐿1 within interval [0, 𝐿1 ] on 𝑀1 and the jobs of 𝐿2 within interval [OPT − 𝐿2 , OPT] on 𝑀2 , respectively. No interruptions and migrations for these jobs are made, see Fig. 1a. Next we reschedule the jobs that migrate in 𝜎 by using McNaughton’s wrap around rule within intervals [𝐿1 , OPT] and [0, OPT − 𝐿2 ]. This completes the construction. The length of the schedule (a) L1

(b) OPT – pk

OPT

M1

M1

M2

M2 Jk

OPT Jk

L2 Fig. 1. Rescheduling on two machines. AUTOMATION AND REMOTE CONTROL

Vol. 71

No. 10

2010

PREEMPTIVE SCHEDULING OF INDEPENDENT JOBS (a) M1

L1

M2

L2

M3

L3

(c) M1

L1

Jk

M2

L2

Jk

M3

L3

Jk

(b) M1 M2 M3

Jk

2097

J k' Jk Jk'

(d) M1 Jk

L1 L2

Jk

Jk

J k' Jk

M2 M3 Jk'

Jk

Fig. 2. Rescheduling on three machines.

is OPT. There is at most one job which gets preempted and migrates from 𝑀2 to 𝑀1 in schedule 𝜎 ′ . Let us prove that so defined schedule 𝜎 ′ is feasible. Assume that some job 𝐽𝑘 migrates in 𝜎 ′ , see Fig. 1b. This job is scheduled in the end of the interval [𝐿1 , OPT] on machine 𝑀1 , and in the beginning of [0, OPT − 𝐿2 ] on 𝑀2 . The time gap between these two parts of 𝐽𝑘 is exactly OPT−𝑝𝑘 . Since 𝐽𝑘 also migrates in the feasible schedule 𝜎, we have 𝑝𝑘 + 𝑑 ⩽ OPT. Hence, the delay constraint is satisfied and the constructed schedule is feasible and optimal. ⊔ ⊓ In the case of three and more machines there exit instances for which the number of preemptions and the number of migrations must differ in the optimal schedule. Let us consider the following example. There are three large jobs 𝐽1 , 𝐽2 , 𝐽3 and one small job 𝐽4 such that Δ = (𝑝1 + 𝑝2 + 𝑝3 + 𝑝4 )/3 = 2𝑑 + 𝑝4 and 𝑝1 = 𝑝2 = 𝑝3 = 2𝑝4 . Then, in order to get a schedule of length Δ, no large job should migrate, while the small job should migrate two times, and one large job should be preempted once. Hence, there must be two migrations and three preemptions in total (since each migration also yields a preemption). Theorem 3. For any instance of ⟨𝑃 3 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩ there exists an optimal schedule with at most two migrations. Proof. Given an optimal schedule 𝜎 of length OPT, we construct a new optimal schedule 𝜎 ′ in two steps. We first construct a pseudo-schedule of length OPT which may be infeasible, and then turn this into a feasible schedule of the same length. Let 𝐿𝑖 (𝑖 = 1, 2, 3) be the total load of the jobs which completely run on machine 𝑀𝑖 in schedule 𝜎. Assume, w.l.o.g., that 𝐿1 ⩽ 𝐿2 ⩽ 𝐿3 . We place the jobs of 𝐿𝑖 within [0, 𝐿𝑖 ] on 𝑀𝑖 for each 𝑖 = 1, 2, 3. No interruptions (as well as migrations) are assumed for those jobs. Then we enumerate the jobs that migrate in 𝜎 in non-increasing order of their lengths, and schedule them within the intervals [𝐿1 , OPT], [𝐿2 , OPT], [𝐿3 , OPT] vacant for machines 𝑀1 , 𝑀2 , 𝑀3 using McNaughton’s wrap-around rule. To that end, we first place the jobs on machine 𝑀2 within the interval [𝐿2 , OPT], next on machine 𝑀1 within [𝐿1 , OPT], and finally on 𝑀3 within [𝐿3 , OPT]. (This will be referred to as a rescheduling procedure for the migrating jobs.) The procedure yields an infeasible schedule 𝜎 ˜ of length OPT. If there is at most one migration in 𝜎 ˜ , then the proof follows directly from the proof of Theorem 2. In what follows, we assume that there are exactly two migrations in 𝜎 ˜ , and modify the pseudoschedule so as to meet the delay constraints. Assume that there is a job 𝐽𝑘 which is processed in 𝜎 ˜ on all machines (see Fig. 2a). Due to the rescheduling procedure, we can conclude that the processing time of 𝐽𝑘 is larger than (OPT − 𝐿2 ) + AUTOMATION AND REMOTE CONTROL

Vol. 71

No. 10

2010

2098

SEVASTYANOV et al.

(OPT − 𝐿1 ), and due to 𝐿1 ⩽ 𝐿2 ⩽ 𝐿3 , it has to be processed on all three machines in schedule 𝜎. This means that job 𝐽𝑘 must migrate at least twice in 𝜎, which implies that 𝑝𝑘 + 2𝑑 ⩽ OPT. Hence, we can modify the pseudo-schedule as shown in Fig. 2b so as to obtain a feasible schedule of length OPT. Now assume that there is a job 𝐽𝑘 which is processed on machines 𝑀2 , 𝑀1 , and another job 𝐽𝑘′ which is processed on machines 𝑀2 , 𝑀3 (see Fig. 2c). Since jobs 𝐽𝑘 and 𝐽𝑘′ both migrate in 𝜎, the delay constraint implies that 𝑝𝑘 + 𝑑 ⩽ OPT and 𝑝𝑘′ + 𝑑 ⩽ OPT. Hence, we can modify the schedule as shown in Fig. 2d. ⊔ ⊓ Theorems 2 and 3 proved above provide a basis for the following Conjecture. For any instance of ⟨𝑃 𝑚 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩ there exists an optimal schedule with at most 𝑚 − 1 migrations. From the example given before Theorem 3 one can see that a simple rule, like McNaughton’s one, cannot be used to find an optimal preemptive schedule, even if almost all information on the optimal schedule is given. Notice also that in our problem, unlike the problem with preemption without delays, there may be more than two interrupted jobs on a machine, and an optimal schedule may have to interrupt the same job more than once. In fact, even more complicated structures can be assumed. Theorem 4. For any instance of problem 𝑋 there exists an optimal schedule in which no machine idles until its completion time. Proof. Let 𝜎 be a schedule which lexicographically minimizes the following three objectives in this order: the makespan, the sum of all job completion times, and minus the sum over all jobs of the mean times under execution, where the∫mean time under execution of a job is the average time at which it is processed, i.e., the integral 𝜒𝑗 (𝑡) 𝑑𝑡, where 𝜒𝑗 (𝑡) = 𝑡 if job 𝐽𝑗 is being processed at time 𝑡, and 𝜒𝑗 (𝑡) = 0 otherwise. Assume that machine 𝑀𝑖 is idle in 𝜎 at some time 𝑡, i.e., no job is processed on 𝑀𝑖 in the open interval (𝑡 − 𝜀, 𝑡) for some 𝜀 > 0, and 𝑀𝑖 does process some job at a later moment. Let job 𝐽𝑗 be the first job that is processed after time 𝑡 on 𝑀𝑖 , and let 𝑝′𝑗 be the remainder of the processing time of that job. If 𝐽𝑗 is not processed on another machine before time 𝑡, then we can reduce its completion time by at least 𝛿 = min{𝜀, 𝑝′𝑗 } without increasing the makespan or changing the schedule of any other job. If job 𝐽𝑗 , before being processed at time 𝑡 on machine 𝑀𝑖 , was processed on another machine 𝑀𝑘 for 𝑝′′𝑗 time units, we move the . processing of the last 𝛿 = min{𝜀, 𝑝′′𝑗 } those units of job 𝐽𝑗 from machine 𝑀𝑘 to machine 𝑀𝑖 in the interval (𝑡−𝜀, 𝑡). We thereby increase the mean time under execution of job 𝐽𝑗 by a positive amount without increasing the completion time of any job (and thus, without increasing the makespan). Hence, 𝜎 is not optimal for the given triple of objectives, which contradicts the choice of 𝜎. ⊔ ⊓ 4. TWO MACHINES: A NEAR-OPTIMAL SCHEDULE IN LINEAR TIME We show that for the two machine problem ⟨𝑃 2 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩ a good near-optimal solution can be found in 𝑂(𝑛) time. At the beginning, we assume that jobs 𝐽1 , . . . , 𝐽𝑛 (𝑛 ⩾ 2) are numbered in non-increasing order of their processing times 𝑝1 ⩾ . . . ⩾ 𝑝{𝑛 . (Afterwards, } it will be 1 ∑𝑛 shown how we can do without this assumption.) So, we have Δ = max 𝑝1 , 2 𝑗=1 𝑝𝑗 as a lower bound on the optimum. Let us first introduce some notation. We use 𝐼𝑘 (𝑘 = 1, . . . , 𝑛) to denote the set of 𝑘 largest jobs {𝐽1 , . . . , 𝐽𝑘 }. Taking the jobs of 𝐼𝑘 as an instance of the non-preemptive problem ⟨𝑃 2 ∣∣ 𝐶max ⟩, we use 𝜎𝑘 to denote its optimal schedule and use 𝑇𝑘 to denote its optimum. Then, we have 𝑇1 ⩽ . . . ⩽ 𝑇𝑛 . AUTOMATION AND REMOTE CONTROL

Vol. 71

No. 10

2010

PREEMPTIVE SCHEDULING OF INDEPENDENT JOBS

2099

Lemma. If OPT > Δ, then OPT = min{𝛾, 𝑇𝑘∗ }, . . where 𝑘∗ = min{𝑘 ∈ {1, . . . , 𝑛} ∣ 𝑇𝑘 > Δ} and 𝛾 = max{Δ, 𝑝𝑘∗ + 𝑑}.

(4)

Proof. First let us show that 𝑇𝑘∗ −1 < OPT ⩽ 𝑇𝑘∗ . The lower bound follows from 𝑇𝑘∗ −1 ⩽ Δ < OPT. To justify the upper bound, it suffices to take the schedule 𝜎𝑘∗ and complete it to a feasible schedule of length 𝑇𝑘∗ for the whole instance by just assigning the remaining jobs to the less loaded machine denoted as 𝑀2 . Since the load of machine 𝑀1 is equal to 𝑇𝑘∗ > Δ, the resulting load of machine 𝑀2 must be less than Δ. So, the length of this schedule is equal to 𝑇𝑘∗ , and OPT ⩽ 𝑇𝑘∗ . Suppose that OPT < 𝑇𝑘∗ . Clearly, it cannot be true, if no job 𝐽𝑖 ∈ 𝐼𝑘∗ migrates in the optimal schedule. Therefore, some of jobs 𝐽𝑖 ∈ 𝐼𝑘∗ must migrate, which implies the lower bound . OPT ⩾ max{Δ, 𝑝𝑘∗ + 𝑑} = 𝛾. Thus, we obtain the following lower bound on the optimum: OPT ⩾ min{𝛾, 𝑇𝑘∗ }.

(5)

Let us show that, in fact, (5) holds as an equality. Indeed, if the minimum in (5) is attained at 𝑇𝑘∗ , we can easily construct the schedule of length 𝑇𝑘∗ as shown above, without preemption. Alternatively, if 𝛾 < 𝑇𝑘∗ , we construct a schedule of length 𝛾 as follows: —take the schedule 𝜎𝑘∗ −1 ; it has length 𝑇𝑘∗ −1 ⩽ Δ and no preemptions; —put job 𝐽𝑘∗ to an arbitrary machine (let it be 𝑀1 )—the schedule length becomes at least 𝑇𝑘∗ ; —divide the job 𝐽𝑘∗ into two parts, making the load of machine 𝑀1 to be equal to 𝛾; the positive remainder of the job migrates to machine 𝑀2 ; —put the remaining jobs 𝐽𝑘∗ +1 , . . . , 𝐽𝑛 on machine 𝑀2 . Clearly, the resulting schedule is feasible and its length is equal to 𝛾. ⊔ ⊓ Theorem 5. There exists an algorithm which for any instance of the two-machine problem ⟨𝑃 2 ∣ 𝑝𝑚𝑡𝑛(𝑑𝑒𝑙𝑎𝑦 = 𝑑) ∣ 𝐶max ⟩ with 𝑛 jobs solves the problem to the optimum if delay 𝑑 is at most ( ) 2 1 − log 𝑛 Δ; otherwise, it provides either an optimal preemptive schedule or an approximate non2 preemptive schedule 𝜎 of length at most (

𝐶max (𝜎) ⩽ 1 +

1 log2 𝑛

)

Δ.

(6)

The running time of the algorithm is linear in the number of jobs 𝑛. Proof. Since 𝑘𝑝𝑘 ⩽ Then

∑𝑘

𝑖=1 𝑝𝑖



∑𝑛

𝑖=1 𝑝𝑖

⩽ 2Δ, we have 𝑝𝑘 ⩽ 2Δ/𝑘 for every 𝑘. Put 𝑘′ = ⌈log2 𝑛⌉.

𝑝𝑘 ′ ⩽

2Δ 2 ⩽ Δ. ′ 𝑘 log2 𝑛

(7)

Observe that we can extract the set of jobs 𝐼𝑘′ (i.e., the set of the largest 𝑘′ jobs) from the whole set {𝐽1 , . . . , 𝐽𝑛 } in 𝑂(𝑛) time by means of the standard technique [17], after which its items can be renumbered in non-increasing order of processing times (𝑝1 ≥ ⋅ ⋅ ⋅ ≥ 𝑝𝑘′ ) in 𝑂(log 𝑛 log log 𝑛) = 𝑜(𝑛) ′ time. After this we can compute all the optimums {𝑇1 , . . . , 𝑇𝑘′ } in 𝑂(2𝑘 ) = 𝑂(𝑛) time by the direct enumeration of all subsets of the set {1, 2, . . . , 𝑘′ }. Next, we compare 𝑇𝑘′ and Δ. If 𝑇𝑘′ > Δ, we can conclude that 𝑘∗ ⩽ 𝑘′ and that 𝑘∗ can be found in 𝑂(log 𝑛) comparisons of values {𝑇𝑖 ∣ 𝑖 = 1, . . . , 𝑘′ } with Δ. After that, we construct the optimal schedule (of length OPT = min{𝛾, 𝑇𝑘∗ }), using the schedules 𝜎𝑘∗ −1 and 𝜎𝑘∗ as described in the proof of lemma. AUTOMATION AND REMOTE CONTROL

Vol. 71

No. 10

2010

2100

SEVASTYANOV et al.

If 𝑇𝑘′ ⩽ Δ, and hence, either 𝑘∗ > 𝑘′ or 𝑘∗ is undefined, then in the case 𝑑 + 𝑝𝑘′ ⩽ Δ we have OPT = Δ, and the optimal schedule can be obtained by the completion of the schedule 𝜎𝑘′ up to a whole schedule using the linear-time McNaughton’s algorithm. Alternatively, if 𝑑 + 𝑝𝑘′ > Δ, and therefore by (7), ( ) 2 𝑑 > Δ − 𝑝𝑘 ′ ≥ 1 − Δ, log2 𝑛 we take the schedule 𝜎𝑘′ and complete it to a whole non-preemptive schedule 𝜎 for the original instance using the simple list-scheduling algorithm, with the remaining jobs sequenced in an arbitrary order. It can be seen that the length of schedule 𝜎 meets the upper bound 𝐶max (𝜎) ⩽ Δ+ 12 𝑝𝑘 for some 𝑘 > 𝑘′ , which implies 1 𝐶max (𝜎) ⩽ Δ + 𝑝𝑘′ . (8) 2 The desired bound (6) follows from (8) and (7). ⊔ ⊓ REFERENCES 1. Graham, R.L., Lawler, E.L., Lenstra, J.K., and Rinnooy Kan, A.H.G., Optimization and Approximation in Deterministic Scheduling: A Survey, Ann. Discret. Math., 1979, vol. 5, pp. 287–326. 2. Lawler, E.L., Lenstra, J.K., Rinnooy Kan, A.H.G., and Shmoys, D.B., Sequencing and Scheduling: Algorithms and Complexity, in Logist. Product. Inventory, vol. 4 of Handbooks in Operation Research and Management Science, Amsterdam: Elsevier, 1993, pp. 445–522. 3. Tanaev, V.S., Gordon, V.S., and Shafransky, Ya.N., Teoriya raspisanii. Odnostadiinye sistemy (Theory of Scheduling. Single-stage Systems), Moscow: Nauka, 1984. 4. McNaughton, R., Scheduling with Deadlines and Loss Functions, Manage. Sci., 1959, vol. 6, no. 1, pp. 1–12. 5. Karp, R.M., Reducibility among Combinatorial Problems, in Complexity of Computer Computations, Miller, R.E. and Thatcher, J.W., Eds., New York: Plenum, 1972, pp. 85–103. 6. Rothkopf, M.H., Scheduling Independent Tasks on Parallel Processors, Manage. Sci., 1966, vol. 12, no. 5, pp. 437–447. 7. Hochbaum, D.S. and Shmoys, D., A Polynomial Approximation Scheme for Scheduling on Uniform Processors: Using the Dual Approximation Approach, SIAM J. Comput., 1988, vol. 17, no. 3, pp. 539–551. 8. Gordon, V.S. and Tanaev, V.S., Interruptions in Deterministic Systems with Parallel Machines and Arbitrary Release Dates, in Optimization of Collecting, Transmitting and Processing the Analogous and Discrete Information in Local ICS, Proc. of the 1st Joint Soviet-bulgarian Workshop of IEC AS BSSR— IEC BAS, Minsk, 1973, pp. 36–50. 9. Tanaev, V.S., Interruptions in Deterministic Service Systems with Identical Parallel Machines, Izv. Akad. Nauk BSSR, Ser. Fiz.-mat. Nauk, 1973, no. 6, pp. 44–48. 10. Hanen, C. and Munier, A., An Approximation Algorithm for Scheduling Dependent Tasks on 𝑚 Processors with Small Communication Delays, Discret. Appl. Math., 2001, vol. 108, no. 3, pp. 239–257. 11. Hoogeveen, J.A., Lenstra, J.K., and Veltman, B., Three, Four, Five, Six, or the Complexity of Scheduling with Communication Delays, Oper. Res. Lett., 1994, vol. 16, no. 3, pp. 129–137. 12. Schuurman, P. and Woeginger, G.J., Polynomial Time Approximation Algorithms for Machine Scheduling: Ten Open Problems, J. Schedul., 1999, vol. 2, no. 5, pp. 203–213. 13. Engels, D.W., Feldman, J., Karger, D.R., and Ruhl, M., Parallel Processor Scheduling with Delay Constraints, in Proc. of the SODA, Washington, 2001, pp. 577–585. 14. Afrati, F.N., Bampis, E., Finta, L., and Milis, I., Scheduling Trees with Large Communication Delays on two Identical Processors, J. Schedul., 2005, vol. 8, no. 2, pp. 179–190. AUTOMATION AND REMOTE CONTROL

Vol. 71

No. 10

2010

PREEMPTIVE SCHEDULING OF INDEPENDENT JOBS

2101

15. Engels, D.W., Scheduling for Hardware-software Partitioning in Embedded System Design, PhD Thesis, Cambridge: Massachusetts Inst. of Technology, 2000. 16. Garey, M.R. and Johnson, D.S., Computers and Intractability: A Guide to the Theory of NP-completeness, San Francisco: Freeman, 1979. 17. Blum, M., Floyd, R., Pratt, V., Rivest, R., and Tarjan, R., Time Bounds for Selection, J. Comp. Syst. Sci., 1973.

This paper was recommended for publication by A.A. Lazarev, a member of the Editorial Board

AUTOMATION AND REMOTE CONTROL

Vol. 71

No. 10

2010