Robust Algorithms for Preemptive Scheduling

Report 3 Downloads 171 Views
Robust Algorithms for Preemptive Scheduling Leah Epstein1 and Asaf Levin2 1

Department of Mathematics, University of Haifa, 31905 Haifa, Israel [email protected]. 2 Faculty of Industrial Engineering and Management, The Technion, 32000 Haifa Israel [email protected].

Abstract. Preemptive scheduling problems on parallel machines are classic problems. Given the goal of minimizing the makespan, they are polynomially solvable even for the most general model of unrelated machines. In these problems, a set of jobs is to be assigned to be executed on a set of m machines. A job can be split into parts arbitrarily and these parts are to be assigned to time slots on the machines without parallelism, that is, for every job, at most one of its parts can be processed at each time. Motivated by sensitivity analysis and online algorithms, we investigate the problem of designing robust algorithms for constructing preemptive schedules. Robust algorithms receive one piece of input at a time. They may change a small portion of the solution as an additional part of the input is revealed. The capacity of change is based on the size of the new input. For scheduling problems, the maximum ratio between the total size of the jobs (or parts of jobs) which may be re-scheduled upon the arrival of a new job j, and the size of j, is called migration factor. We design a strongly optimal algorithm with the migration factor 1 for identical machines. Such algorithms avoid idle time and create 1− m solutions where the (non-increasingly) sorted vector of completion times of the machines is minimal lexicographically. In the case of identical machines this results not only in makespan minimization, but the created solution is also optimal with respect to any p norm (for p > 1). We show that an algorithm of a smaller migration factor cannot be optimal with respect to makespan or any other norm, thus the result is best possible in this sense as well. We further show that neither uniformly related machines nor identical machines with restricted assignment admit an optimal algorithm with a constant migration factor. This lower bound holds both for makespan minimization and for any p norm. Finally, we analyze the case of two machines and show that in this case it is still possible to maintain an optimal schedule with a small migration factor in the cases of two uniformly related machines and two identical machines with restricted assignment.

1

Introduction

We study preemptive scheduling on m identical machines with the goals of makespan minimization and minimization of the p norm (for p > 1) of the C. Demetrescu and M.M. Halld´ orsson (Eds.): ESA 2011, LNCS 6942, pp. 567–578, 2011. c Springer-Verlag Berlin Heidelberg 2011 

568

L. Epstein and A. Levin

machine completion times. There are n jobs, where pj , the size (or length) of j, is the processing time of the j-th job on a unit speed machine. The load or completion time of a machine is the last time that it processes any job. In makespan minimization, the goal is to assign the jobs for processing on the machines, minimizing the maximum completion time of any machine. In the minimization of the p norm, the goal is to minimize the p norm of the vector of machine completion times. The set of feasible assignments is defined as follows. In preemptive scheduling, each machine can execute one job at each time, and every job can be run on at most one machine at each time. Idle time is allowed. A job is not necessarily assigned to a single machine, but its processing time can be split among machines. The intervals or time slots in which it is processed do not necessarily have to be consecutive. That is, a job may be split arbitrarily under the constraint that the time intervals, in which it runs on different machines, are disjoint, and their total length is exactly the processing time of the job. Following a recent interest in problems which possess features of both offline and online scenarios, we study preemptive scheduling with bounded migration, which is also called robust preemptive scheduling. The problem is not an offline problem, in the sense that the input arrives gradually, but it is not a purely online problem either, since some reassignment of the input is allowed. In this variant jobs arrive one by one, and when a new job arrives, its processing time becomes known. The algorithm needs to maintain a schedule at all times, but when a new job j arrives, it is allowed to change the assignment of previously assigned jobs in a very restrictive way. More accurately, the total size of all parts of jobs which are moved to different time slots (or to the same time slot on a different machine) should be upper bounded by a constant factor, called the migration factor, times pj , that is, their total size must be at most a constant multiplicative factor away from the size of the new job. Algorithms which operate in this scenario are called robust. We expect a robust algorithm to perform well not only for the entire input, but also for every prefix of the input, comparing the partial output to an optimal solution for this partial input. We stress the fact that in the preemptive variant which we study, at each step the parts of a given job may be scheduled to use different time slots on possibly different machines. When the schedule is being modified, we allow to cut parts of jobs further, and only the total size of part of jobs which are moved either to a different time slot, or to a different machine (or both), counts towards the migration factor. Next, we review possible machine environments. The most general machine environment is unrelated machines [25,24,2]. In this model each job j and machine i have a processing time pi (j) associated with them, which is the total time that j requires if it is processed on i. In the preemptive model, the job can be split into parts, as long as it is not executed in parallel on different machines. If the total time allocated for the job on machine i is ti,j , then in order to complete  ti,j the job the equality m i=1 pi (j) = 1 must be satisfied. In this model the migration factor is not well-defined. We study several important special cases in which the definition of a migration factor is natural. The most basic and natural machine environment is the case of identical machines, for which pi (j) = pj for all i, j

Robust Algorithms for Preemptive Scheduling

569

[21,27,6]. We study two additional common models which generalize identical machines. In the model of uniformly related machines [22,20,2,4], machine i has p a speed si > 0, and pi (j) = sji . In the restricted assignment model [3] each job j has a subset of machines Mj associated with it, also called a processing set. Only machines of Mj can process it. We have pi (j) = pj if i ∈ Mj and otherwise pi (j) = ∞. In the offline scenario of preemptive multiprocessor scheduling [27,28,29,25,26,22,20,23,32,18,7], jobs are given as a set, while in the online problem, jobs arrive one by one to be assigned in this order. A job is assigned without any knowledge regarding future jobs. The exact time slots allocated to the job must be reserved during the process of assignment, and cannot be modified later. Idle time may be created during the process of assignment, and as a result, the final schedule may contain idle time as well. Note that in this variant, unlike non-preemptive scheduling, idle time can be beneficial. It is known for a while that the offline preemptive scheduling problem, unlike the non-preemptive variant, can be solved optimally even for more general machine models. First, we discuss makespan minimization, on identical machines and on uniformly related machines [27,22,32]. McNaughton [27] designed a simple algorithm for identical machines (see also [28,29] for alternative algorithms). The study of this problem for related machines started with the work of Liu and Yang [26], as well as the work of [25] who introduced bounds on the cost of optimal schedules, which are the average load (that is, the total size of jobs divided by the total speed of all machines), and m − 1 bounds resulting from the average load which must be achieved by assigning the k largest jobs to the k fastest machines (for 1 ≤ k ≤ m − 1). Horvath et al. [22] proved that the optimal cost is indeed the maximum of those m bounds by constructing an algorithm that uses a large (but polynomial) number of preemptions. Gonzalez and Sahni [20] devised an algorithm that outputs an optimal schedule for which the number of preemptions is at most 2(m − 1). This number of preemptions was shown to be optimal in the sense that there exist inputs for which every optimal schedule involves at least that many preemptions. This algorithm was later generalized and simplified for jobs of limited splitting constraints by Shachnai et al. [32]. Similar results for a wide class of objective functions, including minimization of the p norm, were obtained by Epstein and Tassa [18]. In that work it was shown that while for makespan minimization, the best situation that one can hope for is a flat schedule, where all machines have the same load, this is not necessarily the case for other functions, such as the 2 norm. Note that due to the option of idle time, the problem of maximizing the minimum load (also known as the Santa Claus problem) does not have a natural definition of preemptive schedules, and thus we do not discuss preemptive schedules with respect to this goal. The case of unrelated machines was also shown to admit a polynomial time algorithm. Specifically, Lawler and Labetoulle [23] showed that this problem can be formulated as a linear program that finds the amount of time that each job

570

L. Epstein and A. Levin

should spend on each machine, and afterwards, the problem can be solved using an algorithm for open-shop preemptive scheduling. A number of articles considered the online problem for identical and uniformly related machines [6,17,34,16,12,9,10], including many results where algorithms of optimal (constant) competitive ratio were designed. However, it is impossible to design an online algorithm which outputs an optimal solution with respect to makespan [6,31,17,12]. For restricted assignment (and unrelated machines), the lower bound of Ω(log m) given by Azar, Naor and Rom [3] is valid for preemptive scheduling. Thus, it is known for a while that in many of the cases, in order to obtain a robust algorithm which produces an optimal solution, a non-zero migration factor must be used. Another variant of preemptive scheduling which is on the borderline between online and offline algorithms allows to use a reordering buffer of fixed size, where jobs can be stored before they are assigned to time slots on machines [8]. The non-preemptive version of the problem was studied as well (see e.g. [11]). Robust algorithms were studied in the past for scheduling and bin packing problems. The model was introduced by Sanders, Sivadasan and Skutella [30], where several simple strategies with a small migration factor, but an improved approximation ratio, compared to online algorithms [19], were presented, as well as a robust polynomial time approximation scheme (PTAS). The bin packing problem was shown to admit an asymptotic robust PTAS [13] (and even the problem of packing d-dimensional cubes for any d ≥ 2 into unit cubes of the same dimension admits an asymptotic robust PTAS [15]). The problem of maximizing the minimum load on identical machines does not admit a robust PTAS, as was shown by Skutella and Verschae [33]. Although the similarity between the makespan objective and minimizing the p norm, obtaining a robust PTAS for minimizing the p norm of the load vector on identical machines is impossible (a construction similar to the one of [33], using job sizes of an initial batch as in the example of [1], gives a lower bound of 1.00077 for 2 -norm). A similar negative result was shown for bin packing with cardinality constraints [15]. In this version of bin packing an integer parameter t is given, so that in addition to the restriction on the total size of items in a bin, it may contain up to t items. While this problem admits a standard APTAS and an AFPTAS [5,14], it was shown in [15] that it cannot have a robust APTAS. 1 which Our main result is a polynomial time algorithm of migration factor 1− m maintains a strongly optimal solution on identical machines. Such a solution is one where the sorted vector of machine completion times is lexicographically minimal. We show that this result is tight in the sense that no optimal robust algorithm for makespan minimization (or for the minimization of some p norm) can have a smaller migration factor. Being strongly optimal, the algorithm is optimal with respect to makespan minimization and any p norm for p > 1. There are several difficulties in obtaining optimal robust algorithms for preemptive scheduling. First, we note that for an algorithm to run in polynomial time, the number of preemptions must be polynomial. A modification to the schedule must reassign parts of jobs very carefully, without introducing a large number of

Robust Algorithms for Preemptive Scheduling

571

preemptions. For example, if at each step a new preemption is introduced for each part of a job, the resulting number of preemptions would be exponential. Since we are interested in an optimal schedule (or even in a strongly optimal schedule), the structure of the schedule is strict, and the algorithm does not have much freedom. For example, there are jobs that must be assigned to some machine during the entire time that any machine is active. Finally, since no parallelism is allowed, when a part of a job is moved to some time slot, an algorithm must ensure that it is not assigned to any part of this time slot on any of the other m − 1 machines. We also note that all the known optimal preemptive algorithms for minimizing the makespan on identical machines are not robust. In addition to the basic case of identical machines, we study the two other, more general, machine models, which are uniformly related machines and identical machines with restricted assignment. We show that in contrast to the result for identical machines, an optimal robust solution cannot be maintained in the last two machine models. Specifically, we show that the migration factor of any robust algorithm for uniformly related machines is at least m− 1, and the migration factor of any robust algorithm for identical machines with restricted assignment is Ω(m). Thus, the situation is very different from offline algorithms, where the algorithms for more general machine models are more complex, but are based on similar observations. Note that for identical machines, the set of solutions for (preemptive or non-preemptive) scheduling with the goal function of the p norm of machine completion times is the set of strongly optimal schedules with respect to makespan. As stated above, this is not necessarily the case for other machine models [18]. In the full version, we study a relaxation of preemptive scheduling which is fractional assignment. This variant, where jobs can be split arbitrarily among machines (without any restriction on parallelism) is trivial for identical machines and uniformly related machines, but not for restricted assignment, in which case the lower bound of Ω(m) on the migration factor of an optimal robust algorithm is valid. We design an optimal algorithm for fractional assignment of migration factor m − 1. In addition, we study preemptive scheduling for the case of two uniformly related machines and the case of two identical machines with restricted assignment, and design robust optimal preemptive algorithms (with a migration factor of 1) for these cases. For uniformly related machines, the algorithm obtains different schedules for the different norms (since there does not exist one schedule which is optimal for all norms), and uses the best possible migration factor for maintaining an optimal schedule for uniformly related machines. For restricted assignment, since no speeds are present, one output can be optimal for all norms if it is strongly optimal for the makespan, and the algorithm produces such an output. The migration factor of 1 is best possible for robust algorithms which maintain a strongly optimal schedule.

2

An Optimal Robust Algorithm for Identical Machines

In this section we present an algorithm which maintains a strongly optimal 1 schedule for identical machines. The algorithm has a migration factor of 1 − m , which is best possible, as shown in Section 3.

572

L. Epstein and A. Levin

Let J denote the sequence of input jobs, and let n = |J|. The instance which t consists of the first t jobs is denoted by It (and so In = J). Let Pt = i=1 pi and pmax = max1≤i≤t pi . We say that a machine i has load Li which is the total t processing times of the fractions of jobs which are assigned to i. Note that if a schedule does not have idle times then the load of a machine is the last time in which it processes a job. First, we sketch the behavior of our algorithm. At the arrival time of a job, we use a simple algorithm, Loads which computes the sorted vector of machine loads in an optimal solution. Algorithm Loads is based on the methods of McNaughton [27] and [22]. The algorithm creates a potential schedule of a simple form (which cannot be used by our algorithm, since it needs to modify its existing schedule rather than creating one from scratch). Loads is a recursive algorithm which assigns the largest remaining job to run non-preemptively on an empty machine, unless the remaining set of jobs can be scheduled in a balanced way. Thus, the sorted vector of completion times has a parameter k, where the k machines of smallest completion time have the exact same completion time. After finding the output of Loads, our algorithm finds which machines have an increased completion time, and the new job is assigned. There may be a time slot in which the job can be scheduled on one machine, but typically some parts of jobs need to be moved to make room for the parts of the new job. We carefully move parts of jobs. In the process it is necessary to make sure that no parts of a job are scheduled to run in parallel (not only parts of the new job), and that parts of jobs are not moved unnecessarily, to avoid an increase in the migration factor. The solution of the static problem for identical machines is relatively simple. The following algorithm was given by McNaughton [27]. The optimal makespan is given by opt = optn = max{ Pmn , pmax n }. The algorithm has an active machine (initialized as the first machine), and keeps assigning jobs there consecutively, starting time zero, until the assignment of a job j would exceed the time optn . In this case only a part of the job is assigned, the algorithm moves on to the next machine as an active machine, and the remainder of j is assigned there, starting time zero. The algorithm does not use idle time. The algorithms which we design in this section do not use idle time either, but they are in fact strongly optimal. The algorithm of McNaughton [27] is not strongly optimal, but strongly optimal algorithms are known even for uniformly related machines [22]. We start with the description of an algorithm Loads which computes a strongly optimal solution optt , for the input It . For an input It , we define an order as follows. For two jobs i, j we say that i is larger than j if pi > pj or if pi = pj and i < j. When we refer to the largest  jobs of an input we refer to this ordering. The algorithm for an input It is recursive, and it outputs a schedule as well as a sequence of loads Lt1 ≤ Lt2 ≤ . . . ≤ Ltm . We initialize a set of indices J = {1, 2, . . . , t}, P = Pt , k = m. 1. Compute pmax = max p , and find a job j such that pj = pmax (ties are broken ∈J

in favor of a job of the smallest index).

Robust Algorithms for Preemptive Scheduling

573

2. If Pk < pmax , let Ltk = pmax , assign job j to machine k (non-preemptively, starting at time zero), J ← J \ {j}, k ← k − 1, P ← P − pj , and apply the algorithm recursively, that is, go to step 1. 3. Otherwise, let Lti = Pk for 1 ≤ i ≤ k, assign the jobs in J using McNaughton’s rule to machines 1, 2, . . . , k with a completion time of Pk and halt. Note that if machine m receives a large job j then the recursive call of the algorithm acts on machines 1, 2, . . . , m − 1 and the jobs It − {j} exactly as it would have acted in the case that this is the complete input. The property that the algorithm is strongly optimal can be proved by induction. If a large job j is assigned to machine m, there must be at least one machine with a completion time of pj (since opt ≥ pj ). The strong optimality of the assignment to machines 1, 2, . . . , m follows by induction. If small jobs are assigned to all machines, then all machines have the equal loads, which is clearly strongly optimal. The algorithm can be implemented using a running time of O(t + m log m). 2.1

Properties of Load Vectors in Strongly Optimal Solutions

Given the strongly optimal solution optt , we say that job j is large in optt and it corresponds to machine k, if in optt the job j is assigned to machine k in step 2. Note that in this case k > 1. Otherwise, we say that j is small, and it corresponds to machine κ, which is the final value of k. That is, the last step is a step where Lti was defined to be Pκ for 1 ≤ i ≤ κ (and pj ≤ Pκ ). The following holds due to the construction of the algorithm. Proposition 1. Lti is a monotonically non-decreasing function of i. In what follows, we refer to Lti as the ith completion time of the input It . Lemma 1. Lti is a monotonically non-decreasing function of t. Lemma 2. Let optt and optt−1 be the solutions obtained by the above algorithm for It and It−1 , respectively, and assume that t is a large job in optt which is assigned to machine k. Let kt−1 ≤ m be the maximum index such that = Lt−1 for 1 ≤ i ≤ kt−1 (i.e., the maximum index of a machine that Lt−1 1 i receives small jobs in optt−1 ) and let kt ≤ m be the maximum index such that Lti = Lt1 for 1 ≤ i ≤ kt . Then the following properties hold: 1. kt < k and for k < i ≤ m. 3. kt ≥ kt−1 − 1. 4. Lti = Lt−1 kt−1 ≤ k. 2. Lti = Lt−1 i i+1 for t−1 t kt + 1 ≤ i ≤ k − 1. 5. Lkt +1 ≤ Lkt . Lemma 3. Assume that t is a small job in optt . Let k be the machine index = to which t corresponds. Let kt−1 denote the maximum index j such that Lt−1 1 Lt−1 j . Then k ≥ kt−1 . 2.2

The Procedure Assign

We describe a procedure Assign which will be used by our algorithm. For each new job, Assign is invoked at most once. We will show that the migration factor

574

L. Epstein and A. Levin

1 of this procedure is at most 1 − m and the claim regarding the migration factor will follow. The input to Assign consists of the following parameters: a job or a part x of size X of some job, an index of a machine  ≥ 1, a time L ≥ X, a preemptive assignment of a set of jobs to machines 1, 2, . . . , m, a set of times L1 ≤ . . . ≤ L for machines 1, 2,  . . . , , with L ≤ L, such that machine i is free during the time  [Li , L], and L = i=1 Li + X. Machine  may have a part of the job x assigned starting time L, and no other machine has any idle time. This is the only time during which x is possibly assigned. All other machines of indices  + 1, . . . , m are completely occupied during the time [0, L]. After the application of Assign, no machine will have any idle time. Westart with assigning a part of x, of size L − L1 , to machine 1. Note that  ˜ satisfies X ˜ = X−(L−L1 ) = X = i=1 (L−Li ), so the remainder of x with size X  i=2 (L−Li ). Note that no migration was used, and no idle time was introduced. ˜ ≥ X ≥ X. Since L1 ≤ Li for 1 ≤ i ≤ , L − L1 ≥ L − Li for 1 ≤ i ≤ , so X − X  m If  = 1 then we are done. Assume therefore  ≥ 2, in which case the remainder ˜ > 0). We create cells as follows. For 2 ≤ i ≤ −1, if has a positive size (that is, X Li+1 > Li , there are i−1 cells of the time interval [Li , Li+1 ], on machines 2, . . . , i. In addition, there are −1 cells of the interval [L , L] on machines 2, . . . , , if L > −1 L . The total length of all these intervals is i=2 (Li+1 −Li )(i−1)+(L−L)(−1). −1 ˜ Claim. L1 ≥ i=2 (Li+1 − Li )(i − 1) + (L − L )( − 1) = X. −1 We let Δ = i=2 (Li+1 − Li )(i − 1) + (L − L )( − 1), δi = Li+1 − Li for   ˜ ≥ X , we 2 ≤ i ≤  − 1 and δ = L − L . That is, Δ = δi (i − 1). Since X − X  i=2

˜ ≤ (1 − 1 )X ≤ (1 − 1 )X. have Δ = X  m We create stripes from time 0 until time Δ. There are i − 1 stripes of height δi for i = 2, . . . , . The stripes are non-overlapping, and each stripe is created just above the previous one, so that all stripes of one height are consecutive. Consider the stripes in a bottom up manner, and recall that a stripe has a cell associated with it. The total size of parts of jobs that will migrate in one stripe 1 )X. is exactly its height, so the total size of migrating jobs is exactly Δ ≤ (1 − m We next consider one stripe of height δi , of the time interval [α, β] (β −α = δi ) and show how to assign a part of x of length δi during the time [α, β] (possibly preemptively, that is, this part may be split further), while some parts of jobs assigned during this time interval are moved to the cell associated with this stripe, we denote the time slot of this cell by [α , β  ] (β  − α = δi ) and the machine of this cell by q. We first reassign the parts of jobs of cells 2, 3, . . . , q − 1 of the time slot [α , β  ] according to McNaughton’s algorithm. Note that this reassignment of parts of jobs which we schedule in the current application of the Assign procedure, does not increase the migration factor of the algorithm since, until the end of the procedure we need not move the jobs, but only declare the necessary changes in the solution. In the resulting assignment to previous cells in this time slot there are at most n times during (α , β  ] in which a machine preempts a job (or finishes a job). Partition the time (α, β] into maximum length

Robust Algorithms for Preemptive Scheduling

575

time intervals (α + ti , α + ti+1 ], defined for 0 ≤ i ≤ r, where ti < ti+1 , such that t0 = 0 and β = α + tr+1 , and there are no preemptions during (α + ti , α + ti+1 ] and (α + ti , α + ti+1 ], i.e., every machine executes the same jobs during all intervals of this form. Thus the number of such intervals is at most n plus the number of maximal consecutive intervals (α , β  ) ⊆ [α, β] such that there are no preemptions during (α , β  ). For each such interval [α + ti , α + ti+1 ], find a machine which executes a job that is not executed on any machine during [α + ti , α + ti+1 ]. Since machine q has an empty cell initially, and the time slot [α + ti , α + ti+1 ] on it is still empty, there are at most m − 1 jobs running during [α + ti , α + ti+1 ], so there is at least one machine 1 ≤ q  ≤ m running a different job during [α+ ti , α+ ti+1 ], and this part of job is moved from [α+ ti , α+ ti+1 ] on q  to [α +ti , α +ti+1 ] on q. A part of x is assigned during the time [α+ti , α+ti+1 ] on q  .  Corollary 1. If L ≥ X, L ≤ L and L = i=1 Li + X, procedure Assign returns a feasible schedule of the jobs which satisfies the required properties. Lemma 4. The number of preemptions in the solution after n jobs were released, is at most m3 n2 . Moreover, the running time of Assign is polynomial in the input size. 2.3

A Robust Algorithm

We will describe a greedy algorithm for modifying the schedule upon arrival of a job. This algorithm keeps the invariants that there is no idle time, and there are no preemptions after the completion time of the least loaded machine. That is, it receives as an input an arbitrary strongly optimal schedule for It−1 , that has and converts it into a strongly optimal schedule no preemptions after time Lt−1 1 1 for It , using a migration factor of 1 − m . In order to define the assignment of 1 )pt of other jobs we job t and possible migration of a total size of at most (1 − m consider two cases for optt . Case 1. t is a large job in optt . Let k be the machine index to which t corresponds. Let kt−1 , kt ≤ m be as in Lemma 2. We start with the assignment to machine kt + 1. Let b = Ltkt and recall that pt = Ltk . Assign a part of the job t to machine kt +1 during the time [Ltkt , Ltk ]. After we apply the procedure Assign t (see below), the time interval [Lt−1 kt +1 , Lkt ] will be occupied as well (so no idle time would be introduced) and we will change the indexing of machines so that machine kt + 1 becomes machine k, and each machine kt + 2 ≤ i ≤ k becomes machine i − 1 (if kt + 1 = k then no change of indexing is performed). The t−1 t−1 t−1 t−1 new loads of these machines are (Lt−1 kt +2 , . . . , Lk , pt , Lk+1 , Lk+2 , . . . , Lm ) = t t t t t t (Lkt +1 , . . . , Lk−1 , Lk , Lk+1 , Lk+2 , . . . , Lm ). Since kt−1 ≤ kt + 1, these are exactly the sizes of the m − kt largest jobs in {1, 2, . . . , t}. We are left with a part of size b of job t, which needs to be assigned to machines 1, 2, . . . , kt + 1. We invoke the procedure Assign with  = kt + 1, X = b, L = b, and Li = Lt−1 for i 1 ≤ i ≤ kt + 1. By this assignment, no preemptions are introduced after time

576

L. Epstein and A. Levin

Ltkt . By these definitions, X = L and L ≥ L . To show L =  kt +1  t +1 Li recall that b = L = i=1 , so (kt + 1)b = ki=1 Li + b. kt



i=1

Li + X, we

Case 2. t is a small job in optt . Denote by k the machine index to which t corresponds. We invoke the procedure Assign with  = k, X = pt , Li = Lt−1 for i Y  +pt  1 ≤ i ≤  and L =  , where Y denotes the total size of jobs not assigned to machines k + 1, . . . , m in optt−1 . We need to show X ≤ L, L ≥ L , and  L = i=1 Li + X. Since job t is associated with machine  = k (as a small  t job), we have Y +p ≥ pt so L ≥ X. Since L = Ltk , we get L ≥ Lk . Finally, k   L = Y + pt = Y + X. Since Y  is exactly the total size of jobsassigned to machines 1, 2, . . . , k prior to the assignment of job t, we have Y  = i=1 Li . We have proved the following theorem. 1 Theorem 1. There exists a polynomial time algorithm of migration factor 1− m which maintains a strongly optimal schedule on m identical machines with a polynomial number of preemptions.

3

Lower Bounds on the Migration Factor

Identical machines. We show that an optimal algorithm (which is not neces1 sarily strongly optimal) must have a migration factor of at least 1 − m . Recall that this is exactly the migration factor of the algorithm given in Section 2. An optimal algorithm which minimizes the p norm for some 1 < p < ∞ on identical machines is simply a strongly optimal with respect to makespan. Thus, we also find that the algorithm of Section 2 has the optimal migration factor for minimization of any p norm. Proposition 2. Let A be an optimal robust algorithm for preemptive scheduling 1 . on identical machines. The migration factor of A is no smaller than 1 − m Uniformly related machines and restricted assignment. We show the next lower bounds. Theorem 2. Any optimal algorithm for preemptive scheduling on uniformly related machines so as to minimize the makespan or to minimize the p norm has a migration factor of at least m − 1. Theorem 3. Any optimal algorithm to the problem of preemptive scheduling on parallel machines with restricted assignment so as to minimize the makespan has a migration factor of at least m−1 2 . The same holds for the problem of minimizing the p norm. Recall that an algorithm for minimization of the p norm for some 1 < p < ∞ cannot use idle time and must be strongly optimal. Note that the next lower bound does not exclude the option of an algorithm which uses idle time and minimizes the makespan, which has a migration factor of 12 (the lower bounds shown in Proposition 2 and Theorem 3 hold for this case).

Robust Algorithms for Preemptive Scheduling

577

Theorem 4. Any strongly optimal algorithm for preemptive scheduling on two machines with restricted assignment has a migration factor of at least 1. Non-preemptive scheduling. Our work is concerned with preemptive scheduling. The case of non-preemptive scheduling was investigated [30], and it was shown that a migration factor of Ω(m) is required in order to maintain an optimal schedule (even if the computational complexity of the algorithm is not polynomial). We further show that no finite migration factor is possible for nonpreemptive scheduling, even for two identical machines. Consider two identical machines. Let N be a large integer. The first four jobs are of sizes N + 2,N + 1,N − 1, and N − 2. The unique optimal solution assigns the two jobs of sizes N + 2 and N − 2 to one machine and the other two jobs to the other machine. The optimal makespan is 2N . Next, a job of size 6 arrives. The unique optimal solution assigns the three smallest jobs to one machine and the two largest jobs to the other machine, and its makespan is 2N + 3. To achieve this solution, two of the first four jobs must migrate to another machine. We get a migration factor of at least 2N6−1 which can be arbitrarily large. To generalize this example for an arbitrary number of machines m, the initial input is augmented by m − 2 jobs of size 2N . Optimal solutions never combine these jobs with the other jobs. Note that the proof holds both for makespan and for any p norm.

References 1. Alon, N., Azar, Y., Woeginger, G.J., Yadid, T.: Approximation schemes for scheduling. In: Proc. 8th Symp. on Discrete Algorithms (SODA), pp. 493–500. ACM/SIAM (1997) 2. Aspnes, J., Azar, Y., Fiat, A., Plotkin, S., Waarts, O.: On-line load balancing with applications to machine scheduling and virtual circuit routing. Journal of the ACM 44(3), 486–504 (1997) 3. Azar, Y., Naor, J., Rom, R.: The competitiveness of on-line assignments. Journal of Algorithms 18(2), 221–237 (1995) 4. Berman, P., Charikar, M., Karpinski, M.: On-line load balancing for related machines. Journal of Algorithms 35, 108–121 (2000) 5. Caprara, A., Kellerer, H., Pferschy, U.: Approximation schemes for ordered vector packing problems. Naval Research Logistics 92, 58–69 (2003) 6. Chen, B., van Vliet, A., Woeginger, G.J.: An optimal algorithm for preemptive on-line scheduling. Operations Research Letters 18, 127–131 (1995) 7. Correa, J.R., Skutella, M., Verschae, J.: The power of preemption on unrelated machines and applications to scheduling orders. In: Dinur, I., Jansen, K., Naor, J., Rolim, J. (eds.) APPROX 2009. LNCS, vol. 5687, pp. 84–97. Springer, Heidelberg (2009) 8. D´ osa, G., Epstein, L.: Preemptive online scheduling with reordering. SIAM Journal on Discrete Mathematics 25(1), 21–49 (2011) 9. Ebenlendr, T., Jawor, W., Sgall, J.: Preemptive online scheduling: optimal algorithms for all speeds. Algorithmica 53(4), 504–522 (2009) 10. Ebenlendr, T., Sgall, J.: Optimal and online preemptive scheduling on uniformly related machines. Journal of Scheduling 12(5), 517–527 (2009) ¨ 11. Englert, M., Ozmen, D., Westermann, M.: The power of reordering for online minimum makespan scheduling. In: Proc. 48th Symp. Foundations of Computer Science (FOCS), pp. 603–612 (2008)

578

L. Epstein and A. Levin

12. Epstein, L.: Optimal preemptive on-line scheduling on uniform processors with non-decreasing speed ratios. Operations Research Letters 29(2), 93–98 (2001) 13. Epstein, L., Levin, A.: A robust APTAS for the classical bin packing problem. Mathemtical Programming 119(1), 33–49 (2009) 14. Epstein, L., Levin, A.: AFPTAS results for common variants of bin packing: A new method for handling the small items. SIAM Journal on Optimization 20(6), 3121–3145 (2010) 15. Epstein, L., Levin, A.: Robust approximation schemes for cube packing (2010) 16. Epstein, L., Noga, J., Seiden, S.S., Sgall, J., Woeginger, G.J.: Randomized online scheduling on two uniform machines. Journal of Scheduling 4(2), 71–92 (2001) 17. Epstein, L., Sgall, J.: A lower bound for on-line scheduling on uniformly related machines. Operations Research Letters 26(1), 17–22 (2000) 18. Epstein, L., Tassa, T.: Optimal preemptive scheduling for general target functions. Journal of Computer and System Sciences 72(1), 132–162 (2006) 19. Fleischer, R., Wahl, M.: Online scheduling revisited. Journal of Scheduling 3(5), 343–353 (2000) 20. Gonzales, T.F., Sahni, S.: Preemptive scheduling of uniform processor systems. Journal of the ACM 25, 92–101 (1978) 21. Graham, R.L.: Bounds for certain multiprocessing anomalies. Bell System Technical Journal 45, 1563–1581 (1966) 22. Horvath, E.C., Lam, S., Sethi, R.: A level algorithm for preemptive scheduling. Journal of the ACM 24(1), 32–43 (1977) 23. Lawler, E.L., Labetoulle, J.: On preemptive scheduling of unrelated parallel processors by linear programming. Journal of the ACM 25(4), 612–619 (1978) 24. Lenstra, J.K., Shmoys, D.B., Tardos, E.: Approximation algorithms for scheduling unrelated parallel machines. Math. Program. 46, 259–271 (1990) 25. Liu, J.W.S., Liu, C.L.: Bounds on scheduling algorithms for heterogeneous computing systems. In: Rosenfeld, J.L. (ed.) Proceedings of IFIP Congress 1974. Information Processing, vol. 74, pp. 349–353 (1974) 26. Liu, J.W.S., Yang, A.T.: Optimal scheduling of independent tasks on heterogeneous computing systems. In: Proceedings of the ACM National Conference, vol. 1, pp. 38–45. ACM, New York (1974) 27. McNaughton, R.: Scheduling with deadlines and loss functions. Management Science 6, 1–12 (1959) 28. Muntz, R.R., Coffman Jr., E.G.: Optimal preemptive scheduling on two-processor systems. IEEE Transactions on Computers 18(11), 1014–1020 (1969) 29. Muntz, R.R., Coffman Jr., E.G.: Preemptive scheduling of real-time tasks on multiprocessor systems. Journal of the ACM 17(2), 324–338 (1970) 30. Sanders, P., Sivadasan, N., Skutella, M.: Online scheduling with bounded migration. Mathematics of Operations Research 34(2), 481–498 (2009) 31. Sgall, J.: A lower bound for randomized on-line multiprocessor scheduling. Information Processing Letters 63(1), 51–55 (1997) 32. Shachnai, H., Tamir, T., Woeginger, G.J.: Minimizing makespan and preemption costs on a system of uniform machines. Algorithmica 42(3-4), 309–334 (2005) 33. Skutella, M., Verschae, J.: A robust PTAS for machine covering and packing. In: de Berg, M., Meyer, U. (eds.) ESA 2010. LNCS, vol. 6346, pp. 36–47. Springer, Heidelberg (2010) 34. Wen, J., Du, D.: Preemptive on-line scheduling for two uniform processors. Operations Research Letters 23, 113–116 (1998)