Approximation schemes for machine scheduling with resource (in-)dependent processing times

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php Approximation sch...
3 downloads 0 Views 2MB Size
Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

Approximation schemes for machine scheduling with resource (in-)dependent processing times∗ Klaus Jansen, Marten Maack, Malin Rau Institute of Computer Science, University of Kiel, 24118 Kiel, Germany {kj,mmaa,mra}@informatik.uni-kiel.de Abstract We consider two related scheduling problems: resource constrained scheduling on identical parallel machines and a generalization with resource dependent processing times. In both problems, jobs require a certain amount of an additional resource and have to be scheduled on machines minimizing the makespan, while at every point in time a given resource capacity is not exceeded. In the first variant of the problem the processing times and resource amounts are fixed, while in the second the former depends on the latter. We present asymptotic fully polynomial approximation schemes (AFPTAS) for the problems: For any ε > 0 a schedule of length at most (1 + ε) times the optimum plus an additive term of O(1/ε2 ) is provided, and the running time is polynomially bounded in 1/ε and the input length. Up to now only approximation algorithms with constant approximation ratios were known. 1

Introduction

In this paper we study the two following scheduling problems. First, the (single) resource constrained scheduling problem, where n jobs have to be scheduled on m identical parallel machines, while each job has a certain requirement of one additional limited renewable resource; and second scheduling with resource dependent processing times, where the resource requirement is not fixed and the processing times depend on the resource amount allocated to a job. For both problems the goal is to minimize the makespan,

i.e. the length of the schedule. These problems arise naturally in different contexts, e.g. in highly parallelized computing where simultaneously active jobs share common memory, or in production logistics where additional personnel may speed up certain tasks. From a theoretical perspective on the other hand, the problems are sensible generalizations of classical problems like scheduling on identical parallel machines or bin packing. We study approximation algorithms: A α-approximation algorithm for a minimization problem computes a solution of value A(I) ≤ αOPT(I), where OPT(I) is the optimal value for a given instance I. For some problems the asymptotic approximation ratio limx→∞ sup{A(I)/x|∀I : OPT(I) = x} is of interest. Moreover, a family of algorithms consisting of (1 + ε)-approximation algorithms for each ε > 0 with running time polynomial in the input length (and 1/ε) is called (fully) polynomial time approximation scheme (F)PTAS; and if the asymptotic ratio is concerned it is called asymptotic (F)PTAS or A(F)PTAS.

Related Work The problems studied here are generalizations of the widely studied problem of scheduling on identical parallel machines. As early as 1966 Graham presented his famous list scheduling for this problem, which provides 1 a schedule of length at most (2 − m )OPT(I). Later a PTAS was found by Hochbaum and Shmoys [9] and for the special case that the number of machines is constant an FPTAS is possible [10]. The first result for scheduling jobs on identical machines with additional ∗ Research was in part supported by German Research resources was presented in 1975 by Garey and

Foundation (DFG) project JA 612 /14-2

1526

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

Graham [4]. Given s distinct resources they have shown that the greedy list algorithm delivers a schedule of length at most (s + 2 − (2s + 1)/m)OPT. In the same year Garey and Johnson [5] showed that this problem is NPcomplete even if just one resource is given. By a simple reduction to the partition problem, one can see that there is no algorithm with a better approximation guarantee than 3/2 for this case, unless P = NP. Therefore a PTAS is not possible for this problem (and also for the resource dependent variant), while an A(F)PTAS still can be achieved. Lately, Niemeier and Wiese [17] presented a (2 + ε)-approximation for resource constrained scheduling, and this is the best ratio known so far. In the case that the jobs have unit processing times, we have the problem of bin packing with capacity constraints, for which an AFPTAS was recently presented by Epstein and Levin [3]. If the resource has to be allocated continuously, the problem of strip packing with cardinality constraints is given. Moreover, if we have less jobs than machines, both of the here considered problems are reducible to the problem of scheduling parallel or malleable parallel tasks, for which AFPTAS were presented by Kenyon and R´emila [14] and Jansen [11] respectively. For scheduling with resource dependent processing times the first result was achieved by Grigoriev et al. [7], who studied the unrelated machines variant in which the processing times depend on the machine as well as on the resource assignment. They achieved a 3.75approximation algorithm. This was improved to 3.5 + ε by Kellerer [13] for the identical machine version. Grigoriev et al. [8] presented a 3 + ε-approximation for a version of the problem where the jobs are preassigned to machines, that also works when the processing time functions are encoded more succinctly.

of linear programming and rounding techniques. To solve certain configuration LPs, we apply highly efficient algorithms [6] for the so called max-min resource sharing problem, as was done in [11]. We partition the jobs into wide and narrow jobs based on their resource requirements and apply linear grouping for the wide jobs. To handle the narrow jobs we adapt the notion of windows that was introduced by Epstein and Levin [3]. However, and this is crucial for both our algorithms, we manage to bound the number of windows to be in O(1/ε2 ), via a second elaborate rounding step. This makes the small additive factor possible, and is essential for the generalization to the resource dependent variant. Our results also yield a significantly improved AFPTAS for bin packing with capacity constraints. Both of our algorithms even work for the case when the resource needs to be allocated contiguously.

Scheduling with one additional resource An instance I = (J , m, R) of the resource constrained scheduling problem is given by a number of machines m, a set of n jobs J and a resource limit R ∈ Q. Each job in J is given by a triple (j, p, r) ∈ N × Q2 , where j is its identifier, p its processing time and r its resource amount. In the following we write j ∈ J and mean its identifier and write pj and rj to refer to its processing time and resource amount. The goal is to find mappings μ : J → [m] from jobs to machines and τ : J → Q from jobs to starting times minimizing the makespan maxj∈J (τ (j) + pj ) of this schedule. μ and τ must ensure that at every point in time each machine processes at most one job and the total resource amount of jobs scheduled at this point in time is at most R. For each mapping τ : J → Q, with  Results and methodology We present AFP- (2.1) rj ≤ R, ∀t ∈ Q : TAS for both problems at hand which, given an j:t∈[τ (j),τ (j)+pj )  accuracy ε > 0 and an instance I, produce sched1 ≤ m, ∀t ∈ Q : ules with makespan at most (1 + ε)OPT(I) + (2.2) 2 j:t∈[τ (j),τ (j)+p ) j O(1/ε )pmax and have a running time that is polynomial in the input length and 1/ε. we can generate in polynomial time a mapping We carefully alter and recombine a variety μ : J → [m], which ensures that each machine

1527

2

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

processes at most one job at each point in time. processing time to the schedule. This is done   For  each set of jobs J we define P (J ) = by a further grouping step. After a solution p . with reduced number of windows is found an  j j∈J integral schedule can be computed by adding Theorem 2.1. Let I = (J , m, R) be an in- some processing time to the schedule. stance of the resource constrained scheduling In the second case we do not need to problem. For each ε ∈ (0, 1) there is an algo- partition the jobs by resource amount. This rithm which computes a schedule with makespan makes things much easier, such that we can generate a schedule directly after getting the T ≤ (1 + ε)OPT(I) + O(1/ε2 )pmax , preemptive solution. where pmax is the maximal processing time in Algorithm Given an instance I and ε > 1/m J . The algorithm needs the algorithm can be summarized as follows: O(n(ln(n) + ε−2 )(n1.5356 + mε−4 )) (i) Define ε := ε/5, compute pmax = max{pj |j ∈ J (I)} and construct a rounded operations. instance Isup with at most 1/ε2 wide jobs using linear grouping and excluding the In the following we will call a jobs resource widest group. amount its width and its processing time its (ii) Find a preemptive schedule xpre for Isup height. We differ two cases: first 1/ε < m and with makespan at most (1 + ε )OPTpre . second 1/ε ≥ m. In the first case the jobs are (iii) Transform the obtained configurations into partitioned in wide and narrow jobs, where wide generalized configurations, which are comjobs have a larger resource amount than narrow posed of a configuration part for wide and jobs. The resource amount of the wide jobs is a window part for narrow jobs. rounded by linear grouping, such that we have Reduce the number of different windows (iv) do deal with just O(ε−2 ) different sizes. using a grouping step. For this rounded instance the algorithm x, y¯) for Isup and a (v) Generate a solution (¯ computes a preemptive schedule from a configugeneralized configuration linear program ration LP. Broadly speaking, a configuration is a LPW , wich has at most 4+3/ε2 +|JN | nonselection of jobs, that can run at the same time. zero components, and which is lengthened After that each configuration is partitioned in at most by a factor of (1 + ε ). the wide job part and the narrow job part. The x, y¯), generate an integral sched(vi) Given (¯ space (resource amount and used machines) not ule for I without the group of widest used by the wide jobs will be called window, jobs lengthening the schedule by at most following the notation in [3]. In simplified terms (4 + 3/ε2 )pmax and ε times the previous a window can be seen as the residual space (reschedule length. source and machine number) that is left by a (vii) Add the widest jobs greedily at the end configuration. of the integral schedule obtaining an overBy constructing a preemptive schedule first, all makespan of at most ((1 + ε )3 + instead of solving the LP by Levin and Epstein ε )OPTpre (Isup ) + (5 + 1/ε + 3/ε2 )pmax . [3] directly, we manage to choose each windows width more adjusted to the given instance. This 2.1 First Case: 1/ε < m. improves the number of operations and the Let ε > 0, with 1/ε < m, and an instance makespan of or solution. In particular the I = (J , m, R) be given. W.l.o.g. we assume number of operations needed does no longer that 1/ε ∈ Z and m < n, since else we depend on the variable R or the minimal resource amount besides zero. Nevertheless have the problem of scheduling parallel tasks, the crucial step is to reduce the number of for which an AFPTAS is already known [11].  different window sizes such that it just depends We define ε = ε/5. First we partition the given set of jobs J into a set of wide jobs on ε by simultaneously adding (not too much)

1528

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

JW := {j ∈ J |rj ≥ ε R} with resource amount at least ε R and a set of narrow jobs JN := J \ JW . Now we apply linear grouping, a method introduced by Fernandez de la Vega and Lueker [2] for bin packing and extended by Kenyon and R´emila [14] to strip packing, to round the resource amount of the wide jobs. We interpret each job j as a rectangle with width rj and height pj . We place this rectangles on a vertical stack by order of increasing resource amount. Let PW := P (JW ) be the height of the stack. Now consider the horizontal lines at height iε2 PW . Each job intersecting with one of these lines is divided at this line and split into two new jobs. Define by JW,i the set of jobs, which lie between the lines (i − 1)ε2 PW and iε2 PW . We get G := 1/ε2 many sets JW,i , called groups, where JW,G is the group of jobs with the largest resource amount. Define by Ri := max{rj |j ∈ JW,i } the largest resource amount in group i. Note that Ri ≤ Ri+1 for all i < G. We now generate an instance where the resource amount of the wide jobs is rounded up. Let Jsup be the set containing all jobs from JN and one additional job for each i ∈ {1, . . . G−1} with processing time P (JW,i ) and resource amount Ri and let Isup := (Jsup , m, R). The next step is to generate a preemptive schedule for this rounded up instance. Note that the jobs in JW,G , the jobs with largest resource amount, are scheduled in the last step. We denote by Jsup,W the wide jobs in Isup . Preemptive Schedule In a preemptive schedule each job can be interrupted and restarted at no cost. We even allow wide jobs to be scheduled on more than one machine at the same point in time. This is necessary, since wide jobs with the same rounded resource amount are allowed to be scheduled at the same point in time. We denote its optimum by OPTpre (I). A configuration C ∈ NJ is a multiset of jobs, where C(j) says how often the job j is contained in in the configuration. We allow C(j) ∈ {0, 1}, if j ∈ JN and C(j) ∈ {0, . . . , 1/ε }, if j ∈ JW . A configurationis valid for a given instance I,  if m(C) := j∈J C(j) ≤ m and R(C) := j∈J C(j)rj ≤ R. Denote by CI the set of all

1529

valid configurations of I. An optimal solution of the following linear program LPpre (I) delivers an optimal preemptive schedule for an instance I. The variable xC denotes the processing time of configuration C ∈ CI .  min (2.3) xC (2.4)



C∈CI

C(j)xC ≥ pj ∀j ∈ J

C∈CI

xC ≥ 0 ∀C ∈ CI

(2.5)

Lemma 2.1. For any Instance I and any ε > 0 we can find a solution xpre to LPpre (I) with  (xpre )C ≤ (1 + ε )OPTpre (I) C∈CI

in O(n(ln(n) + ε−2 )(|JW |/ε + n + m/ε4 )) operations. Furthermore a solution with the same objective value and at most |J | + 1 non zero components can be found in O(n2.5356 (ln(n) + ε−2 )) operations. Proof. This can be done solving a max-minresource-sharing problem with the algorithm by Grigoriadis et al. [6]. In the max-min-resource-sharing problem a nonempty convex compact set B and a set of M nonnegative continuous concave functions f : B → RM is given. We are interested in finding the value λ∗ := max{λ|∃x ∈ B∀j ≤ M : fj (x) ≥ λ} and a vector x ∈ B, for which f (x) ≥ λ∗ e holds, where e ∈ RM is the vector which is 1 at each position. When we interpret LPpre as an max-minresource-sharing problem, we define  |C | B := {x ∈ R≥0I | xC = 1} C∈CI

the set of selections of valid configurations with overall makespan 1, where 1 is the normalisation to OPTpre (I). For each j ∈ J we define  xC fj : B → R≥0 , x → C(j) pj C∈CI

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

the fraction of job j that is scheduled in a fractional schedule derived from x. The algorithm by Grigoriadis et al. [6] computes x ∈ B that satisfies fj (x) ≥ (1 − ρ)λ∗ for each j ∈ J and a given ρ. We will choose ρ ∈ O(ε). The algorithm iterates the following steps: Given an initial solution x ˇ the algorithm computes a price vector q = q(ˇ x) ∈ R|J | for ˇ. After that an (1 − δ)the current value x approximative solution x ˆ of the problem max{q T f (x)|x ∈ B} has to be computed, where δ depends linear on ρ. This problem is called block-problem and a solver has to be provided. In the last step of an iteration the new value of the vector x ˇ is set to (1 − τ )ˇ x + τx ˆ ∈ B, where τ ∈ (0, 1) is an appropriate step length. The algorithm needs O(|J |(ln(|J |) + ρ−2 )) of this iterations. We now describe how to solve the blockproblem max{q T f (x)|x ∈ B}. Note that   qj q T f (x) = xC C(j). pj C∈CI

j∈J

Hence to solve the problem it suffices to compute a configuration C ∗ that maximizes  qj C(j) and set xC ∗ := 1 and xC := 0 j∈J pj for all C = C ∗ . So in each coordination step at most one new configuration is added to the solution. To find such a configuration C ∗ we have to solve the following integer linear program ILPkKP (q, JN , JW , m, R):  qj max aj pj j∈J  aj ≤ m j∈J



rj a j ≤ R

j∈J 

aj ∈ {0, 1} ∀j ∈ JN 

aj ∈ {0, . . . , 1/ε } ∀j ∈ JW This ILP is similar to the ILP formulation of the knapsack problem with cardinality constraint (kKP). The difference is that some items can be picked several times. To use the FPTAS described by Mastrolilli and Hutter [16] we have

to duplicate each wide job 1/ε times. The computation of a (1 + δ)-approximate solution takes O(|JW |/ε + |JN | + mδ −4 ) operations. Let a∗ be the obtained solution to the ILP. To get a configuration C ∗ we define C ∗ (j) := a∗j for each j ∈ J. The next step is to scalex such that f (x) ≥ e. By this scaling we have C∈CI C(j)xC ≥ pj for each j ∈ J , which ensures that each job is scheduled.Further it is shown how to choose ρ such that C∈CI xC ≤ (1 + ε )OPTpre (I) holds. Remark 2.1. Let x ∈ B with f (x) ≥ (1 − ρ)λ∗ ˆ := min{fj (x)|j ∈ J }. It holds that and λ  1 1 OPTpre (I) ≥ x ˆ C (1 − ρ) C∈CI λ ˆ ≥ e. and we have f (x/λ) To proof this remark consider a more general definition of λ∗ and B. Let t ∈ R≥0 be a target makespan and:  |C | Bt := {x ∈ R≥0I | xC = t} C∈CI

λ∗t

:= max{λ|∃x ∈ Bt ∀j ≤ M : fj (x) ≥ λ}

Now, let t, t ∈ R≥0 . By making use of the linearity of f it is easy to see that Bt = t/t Bt and λ∗t = t/t λ∗t . This yields: 1  1 1 xC ≤ ˆ 1 − ρ λ∗ λ C∈CI



1 OPTpre (I) 1−ρ

This concludes the proof of the remark. ˆ and set ρ := ε  ∈ So if we scale x by 1/λ 1+ε O(ε), we get the desired properties for x. Since f (x) ≥ e holds, x fulfils equality 2.4 for each j ∈ J . Hence x is a feasible solution to LPpre . Since ρ ∈ O(ε) we need O(n(ln(n) + ε−2 )(|JW |/ε + n + m/ε4 )) operations total, where n = |J |. The algorithm performed O(n(ln(n) + ε−2 )) coordination steps adding at most one configuration in every step. Therefore xpre has at most this amount of non zero components. We reduce this number some more by computing

1530

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

a basic solution to LPpre by using xpre as a start vector. Beling and Megiddo [1] described how to compute a basic solution for the problem Ax = b, x ≥ 0, given a start solution x ¯, where A ∈ Qm×n . Later Ke et al. [12] presented a faster way of rectangular matrix multiplication. Combined it is possible to find a basic solution in O(m1.5356 n) time. Since our linear program is not in standard form, we  have to add|J | variables and the equation C∈CI xC = C∈CI (xpre )C . Further we use just the configurations, which have a non zero component in xpre . Therefore we can compute a basic solution in O(n1.5356 (n(ln(n) + ε−2 ))) ≤ O(n2.5356 (ln(n) + ε−2 )). In total we need O(n(ln(n) + ε−2 )(|JW |/ε + n1.5356 + m/ε4 )) operations to get a basic solution to the linear program.  We now look at the relation between optimal solutions to I and Isup : Let a solution to LPpre (I) and LPpre (Isup ) each be given. Since each group JW,i has the same summed up processing time, we can split that large job in Isup with processing time P (JW,i ) and resource amount Ri and schedule it instead of the jobs in JW,i+1 in the solution to LPpre (I). So for each solution to LPpre (I), we can generate a solution to LPpre (Isup ) with the same makespan, hence it holds that OPTpre (Isup ) ≤ OPTpre (I).

length, we have to give additional structure to this solution. For this purpose we use a special type of containers for the narrow jobs, called windows, which where first introduced by Epstein and Levin [3]. Handling the narrow jobs A window w = (wr , wm ) is a pair consisting of a resource amount R(w) = wr and a number of machines m(w) = wm . In each window w there can be processed m(w) jobs with summed up resource amount R(w) at each point in time. For windows w1 , w2 we write w1 ≤ w2 iff R(w1 ) ≤ R(w2 ) and m(w1 ) ≤ m(w2 ). We split each configuration into the part with wide jobs and the part with narrow jobs. For a given configuration C ∈ CI we denote by C|JW the configuration consisting of all wide jobs in C. For a given set of configurations C ⊆ CI we define CW := {C|JW |C ∈ C}. Note that each configuration in CW contains at most 1/ε items, since each of the wide jobs needs at least ε R resource. A generalized configuration (C, w) is a pair consisting of a configuration C ∈ CW and a window w. (C, w) is valid for an instance I, if m(w) ≤ m − m(C) and R(w) ≤ R − R(C). For a configuration C ∈ CW with R(C) < R we define by w(C) := (R − R(C), m − m(C)) the main window for C. If m(C) = m the main window is given by w(C) = (0, 0). Let W be any set of windows and CW any set of configurations consisting just of wide jobs. In the following a linear program LPW is presented. It describes the relation between generalized configurations and jobs assigned to those. This linear program was first introduced by Epstein and Levin [3] in a similar way.

Let xpre be the (1+ε )-approximate feasible solution to LPpre (Isup ) with at most |Jsup | + 1 non zero components. Since we have |Jsup,W | ≤ LPW (I, CW , W) : ε−2 we can generate this solution in O(n(ln(n)+ ε−2 )(n1.5356 + m/ε4 )) operations. For any solution xpre to LPpre (I  ) denote   C(j)x(C,w) ≥ pj , by Cpre := {C ∈ CI  |(xpre )C > 0} the set (2.6) C∈CW w∈W of configurations with a non-zero component w≤w(C)  in xpre , where (xpre )C denotes the processing yj,w ≥ pj , time of  configuration C in xpre . We define by (2.7) w∈W Ppre := C∈Cpre (xpre )C the processing time of the preemptive schedule. Since the number of configurations in xpre still depends on the input

1531

∀j ∈ JW ∀j ∈ JN

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

(2.8) m(w)



x(C,w) ≥

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php



yj,w , ∀w ∈ W

j∈JN

C∈CW w(C)≥w

(2.9) R(w)



x(C,w) ≥



rj yj,w , ∀w ∈ W

j∈JN

C∈CW w(C)≥w

(2.10)

x(C,w) ≥ 0,

∀C ∈ CW , ∀w ∈ W

(2.11)

yj,w ≥ 0,

∀w ∈ W, ∀j ∈ JN

Again the variable x(C,w) denotes the processing time of the generalized configuration (C, w). The value yj,w indicates which amount of job j is processed in window w. Inequalities (2.6) and (2.7) ensure that for each job there is enough processing time reserved, while equalities (2.8) and (2.9) ensure that in each window there is enough space to schedule the contained jobs. Given a solution x to LPW we define   P (x) := x(C,w) , C∈CW w∈W

w≤w(C)

which is the makespan of x, and  P (w, x) := x(C,w) C∈CW C(w)≥w

processing time is added to more than one generalized configurations processing time and each configuration C  ∈ Cpre has at least one generalized configuration, where its processing time is added to. With a similar argument one can see, that inequality 2.6 holds, since xpre fulfils inequality 2.4. Now we have to ensure that inequalities 2.7 to 2.9 hold. For this purpose we look at each configuration C ∈ Cpre and consider the reduced configuration C|JW and its main window w := w(C|JW ). For each job j ∈ JN we add its processing time in C, which is C(j)(xpre )C , to the window w. In total we get for each window w ∈ W and each job j ∈ JN  y˜j,w := C(j)(xpre )C . C∈Cpre w(C|J )=w W

Since the configuration C was valid and equalities 2.4 hold for xpre the equalities 2.7 to 2.9 hold for (˜ x, y˜).  We define Ppre (C) := x ˜C,w(C) for each C ∈ CW and Ppre (K) := C∈K Ppre (C) for each K ⊆ CW .

x, y˜) to Lemma 2.3. Given a solution (˜ LPW (I, CW , Wpre ), we can find a set W  ⊆ Wpre with |W  | ≤ ε−2 + 2 and a Lemma 2.2. Let xpre be the solution for solution (¯ x, y¯) to LPW (I, CW , W  ), which fulfils LPpre (I) form lemma 2.1. Let Wpre := {w(C)|C ∈ Cpre,W }. We can generate a solution (2.13) P (¯ x) ≤ (1 + ε )Ppre (˜ x, y˜) to LPW (I, Cpre,W , Wpre ), which fulfils and has at most |JN | + |JW | + 2|W| + 1 non (2.12) P (˜ x) = Ppre zero components in O((n + ε−2 )1.5356 nε−2 ) operations. Proof. To generate this solution we simply look at each configuration C ∈ CW and sum up the Proof. The steps to find W  and (¯ x, y¯) are deprocessing time of each configuration C  ∈ Cpre , scribed in the following. The sets, configurations which is reduced to C, meaning C  |JW = C. and sizes defined for these steps are marked in To build a generalized configuration we have the figures 1 and 2. to combine C with a window from Wpre . We To find the set W  we reduce the number of simply choose the main window. Hence we different resource amounts by a further grouping define step. Since we just want to reduce the number  (xpre )C  . x ˜(C,w(C)) := of different resource amounts, we partition the C  ∈Cpre set of generalised configurations by number  C |J =C W of machines in the window. For each i ∈ Equality 2.12 holds for this choice for x ˜, since {1, . . . , m} we define Ki := {C ∈ CW |m(C) = there is no configuration C  ∈ Cpre which i} to denote the set with all configurations using which is the summed up processing time of a window w ∈ W in x.

1532

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

ki ε2 Ppre (C i,k , wi,k ) kε2 Ppre Ki,k x ¯(C i,k ,wi,k +1 ) x ¯(C i,k ,wi,k ) w ˆi,k

x ˜(C,w(C)) s(C(i,3) )

w ˇi,k

Figure 1: A stack of the generalized configurations

Figure 2: The same stack of the generalized in Ki . The grey rectangles represent the configura- configurations as in figure 1. But this time the tions and the blue rectangles represent the windows. windows are shifted ε2 Ppre downwards. One can see The dashed lines are multiplies of ε2 Ppre . that their area fits into the new windows (hatched rectangles). our set W  . We define 

exactly i machines. Since at most 1/ε wide jobs can be part of one configuration, just the sets K1 to K1/ε are not empty. For each of this sets we apply linear grouping: We number the configurations in Ki such that R(Ci,1 ) ≤ R(Ci,2 ) ≤ R(Ci,3 ) . . . holds. Then we stack the configurations defining start positions s(Ci,1 ) := 0 and s(Ci,j ) := s(Ci,j−1 ) + Ppre (Ci,j−1 ) for each j > 1. Furthermore we define a configurations end position e(Ci,j ) := s(Ci,j+1 ). The summed up height of all stacks is Ppre . We want to get about ε−2 windows, so we have to split our stacks in ε−2 pieces total. Therefore we consider in each stack the multiples of ε2 Ppre to group the windows. For each 0 < i ≤ 1/ε we define ki := Ppre (Ki )/(ε2 Ppre ) which is the first multiple of ε2 Ppre with no generalized configuration intersected with. For each k ∈ {1, . . . , ki − 1} there is a configuration C which intersects with kε2 Ppre meaning s(C) < kε2 Ppre ≤ s(C) + Ppre (C). We denote this configuration by C i,k and define wi,k := w(C i,k ) and wi,ki := (0, 0). Further we define the set Ki,k as the set of configurations lying between the configurations C i,k−1 and C i,k . We select all windows intersected by a multiple of ε2 Ppre for

1533

WKi := {w(C i,k )|k ∈ {1, . . . , ki − 1}} the set of chosen windows from Ki . It holds that |WKi | ≤ Ppre (Ki )/(ε2 Ppre ). We define 1/ε 

W :=



WKi ∪ {(0, 0), (R, m)}

i=1

and have   Ppre (Ki ) 

1/ε 

|W | = 2 +

i=1

ε2 P

pre

≤2+

1 ε2

After choosing the set of windows W  the next step is to generate a solution to the LPW , which uses just windows in W  and needs not much further processing time. The crucial step is to shift the windows in each stack exactly ε2 Ppre downwards. Let us consider the configurations C i,k and i,k−1 C . The resource amount of C i,k−1 is less or equal to the resource amount of C i,k . So for each configuration C ∈ Ki,k we have w(C) ≥ wi,k . If we shift the windows ε2 Ppre downwards, the window wi,k is now processed alongside C i,k−1 . The windows above wi,k have a lesser resource amount. We now round up the resource amount

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

of the windows alongside the configurations in this window while the lower part is put into C ∈ Ki,k such that they have the same resource window wi,k−1 . This time we have to split amount as wi,k . We therefore define for each the window at the smallest multiple of ε2 Ppre . 1 ≤ 1/ε , for all k ≤ ki and for each C ∈ Ki,k : We get this number by ε2 Ppre s(C i,k )/ε2 Ppre . Again we have to know which amount of ˜(C,w(C)) x ¯(C,wi,k ) := x window wi,k has to be processed where. Let w ˇi,k = ε2 Ppre s(C i,k )/ε2 Ppre − s(C i,k ) be i,k With configuration C we have to be more care- the processing time of window w i,k which ful. The lower part of this configuration should hast to be scheduled in the window w i,k−1 be alongside window wi,k , the other alongside and w ˆi,k = x ˜(C i,k ,wi,k ) − w ˇi,k the processing wi,k+1 . We have to find the biggest multiple of time of window w , which can stay in w . i,k i,k ε2 Ppre the configuration C i,k was intersected Furthermore we have to know which fraction of i,k 2 by. In case P (C ) > ε Ppre the configuration the total processing time of w is presented by i,k C i,k will be intersected by more than one mul- these two values. We therefore define ϕˆ := i,k 2 tiple of ε Ppre . The biggest multiple is defined w ˆi,k /Ppre (wi,k ) and ϕˇi,k := w ˇi,k /Ppre (wi,k ). We i,k e(C ) by ε2 Ppre  ε2 Ppre . This multiple defines the now know that we have to add ϕˆi,k y˜j,wi,k to height at which the configuration is split. We y¯j,wi,k and ϕˇi,k y˜j,wi,k to y¯j,wi,k−1 . In total we have define for each i ≤ 1/ε and for each k ≤ ki :    y¯j,wi,k := ϕC y˜j,w(C) + ϕˆi,k y˜j,wi,k e(C i,k ) 2 i,k x ¯(C i,k ,wi,k ) := ε Ppre 2 − s(C ) C∈K i,(k+1) ε Ppre + ϕˇi,k+1 y˜j,wi,k+1 x ¯(C i,k ,wi,k+1 ) := x ˜(C i,k ,wi,k ) − x ¯(C i,k ,wi,k ) Finally we need some extra space for the windows, which where shifted below the lowest configuration. In each stack this concerns window parts of total height ε2 Ppre . Since we have 1/ε stacks we need ε Ppre extra space. The windows we need space for, are the widest windows in each stack. Therefore we round them up to the window (R, m). So the configuration (∅, (R, m)) is the configuration, which needs extra space. So we define ˜(∅,(R.m)) + ε Ppre . x ¯(∅,(R,m)) := x In the following is described how to assign the narrow jobs to the round up windows. Lets consider a configuration C ∈ Ki,k+1 . The window w(C) was shifted down, such that it can be rounded up to wi,k . To round this window up, we have to know which amount of it was processed alongside C. This amount is given by ϕC := Ppre (C)/Ppre (w(C)). So for each configuration C ∈ Ki,k+1 and each job j ∈ JN we add ϕC y˜j,w(C) processing time to y¯j,wi,k . Next we consider a window wi,k . In general this has to be split: as one can see in figure 2 the upper part of window wi,k stays in

for each i ≤ 1/ε , k ≤ ki and j ∈ JN . We consider the window (R, m) separately. First we have to round the main windows from all configurations in Ki,1 up to (R, m). Meaning for each i ≤ 1/ε , C ∈ Ki,1 and j ∈ JN we add ϕC y˜j,w(C) to y¯j,(R,m) . Furthermore we have to round up the lower part of window wi,1 to (R, m). Additional jobs which where processed in window (R, m) before stay there. So in total we have y¯j,(R,m) := y˜j,(R,m) 1/ε

+

 i=1

(ϕˇi,1 y˜j,wi,1 +



ϕC y˜j,w(C) )

C∈Ki,1

for all j ∈ JN . (¯ x, y¯) is a solution to LPW (W  ). Using suitable data structures (˜ x, y˜) as well as (¯ x, y¯) can be computed in O((m + log(n)/ε)n) operations. This linear program has |JN | + |Jsup W | + 2|W| constraints and at most |CW ||W| + |JN ||W| ∈ O(|Jsup |/ε2 ) variables. So we can compute a solution with at most |JN | + |Jsup W | + 2|W| + 1 non zero components in O((n + ε−2 )1.5356 nε−2 ) ≤ O(n2.5356 ε−8 ) operations. 

1534

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

Let (¯ x, y¯) be the solution form lemma 2.3 to LPW (Isup , CW , W  ). It can be generated in no more than O(n(ln(n) + ε−2 )(n1.5356 + m/ε4 )) operations total and has at most |JN |+3/ε2 +4 non zero components. Integral Solution We now generate an integral schedule of the jobs in J \ JW,G . The used technique to schedule the wide jobs is similar to the technique used by Kenyon and R´emila [14] to place the wide rectangles into their fractional packing of rectangles. To place the narrow jobs we use a similar argument as was used by Levin and Epstein in [3]. Lemma 2.4. Let (¯ x, y¯) be the solution from lemma 2.3 to LPW (Isup , CW , W  ). There is an integral solution of jobs in J \ JW,G which has a makespan of at most x) + (5 + (1 + ε )(P (¯

1 3 + 2 )pmax ). ε ε

First we modify the solution (¯ x, y¯) to have enough space to schedule the jobs: We define x ˆ(C,w) := x ¯(C,w) + pmax if x ¯(C,w) > 0, and x ˆ(C,w) = 0 otherwise. We denote by Jf rac ⊆ JN the set of fractional scheduled narrow jobs in (¯ x, y¯). For each j ∈ Jf rac and each window w ∈ W we set yˆj,w := 0 and yˆj,(R,m) := pj . Further we add P (Jf rac ) ≤ pmax |Jf rac | to x ˆ(∅,(R,m)) . For every other j ∈ JN \ Jf rac we set yˆj,w = y¯j,w . Since each job j ∈ JN needs a non-zero component, we have at most 3/ε2 + 4 configurations or fractional jobs. For each fractional job and for each configuration we add at most pmax processing time. Hence we have P (ˆ x) ≤ P (¯ x) + (4 + 3/ε2 )pmax . Next we sort the generalized configurations, such that configurations with the same window are scheduled consecutively and number them in ascending order. We iterate over each i < G and all generalized configurations and fill the spaces for the job i ∈ JW,sup , which has a resource amount of Ri , with jobs from JW,i ∩JW , till the height of the configuration, x ¯(C,w) , is reached. Each last job in a configuration is allowed to overlap the border x ¯(C,w) since we have added

1535

pmax extra space. All jobs from JW,i ∩ JW can be placed in the configurations. Additional there is one generalized configuration (C, w) ¯(C,w)is not overlapped by where the border x x(C,w) ≥ a job from JW,i , since (C,w)∈C˜ C(i)¯ P (JW,i ). In this particular configuration we place the job which was intersected by the multiple of ε2 PW in the first linear grouping and which fractions were put in JW,i as well as in JW,i+1 . Since one of its fractions was in JW,i it fits into the reserved space. To place the small jobs we consider each window w ∈ W. Let J (w) be the set of jobs contained in w. We order the jobs in J (w) by decreasing resource amount. Since the generalized configurations containing window w are scheduled consecutively we can build stacks of jobs form J (w) with total processing time between P (w, x ¯) and P (w, x ¯) + pmax and sched¯) ≥ ule  them in window w. Since m(w)P (w, x y ˆ we have to build at most m(w) of j,w j∈JN this stacks. Because we have m(w) free machines in each window there is a free machine for each stack. Consider the jobs Jtop intersecting the ¯). These are the jobs with the bound P (w, x lowest resource amount of their stack. Hence at each point in time the small jobs in the stacks have at least a total resource amount of R(Jtop ) and therefore P (w, x ¯)R(Jtop ) ≤  r p ≤ P (w, x ¯ )R(w). So the jobs in j∈J(w) j j Jtop fit into the window w. We remove the stack the with largest resource amount. Then the summed up resource amount of the jobs at the bottom of the stacks is less than R(Jtop ) since each of this jobs was added right after a job from Jtop . Therefore at each point in time in window w it holds that the resource amount of small jobs is at most R(Jtop ). The stack we removed has a total processing time of at most P (w, x ¯) + pmax . Since we remove this stack in each window, we have to place jobs  with summed up processing time at most w∈W\{(0,0),(R,m)} (P (w, x ¯) + pmax ) ≤ P (¯ x) + ε−2 pmax at the end of the schedule. Since each of this jobs has a resource amount of at most ε R, we can schedule 1/ε of them at the same time. Hence we need an additional

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

processing time of ε P (¯ x) + (1 + ε−1 )pmax . So far our schedule has a makespan of x) + (1 + ε−1 )pmax P (ˆ x) + ε P (¯ 1 3 ≤ (1 + ε )P (¯ x) + (5 +  + 2 )pmax ε ε ≤ (1 + ε )3 OPTpre (I) + O(1/ε2 )pmax . The last step is to add the jobs from JW,G to the schedule. We have P (JW,G ) ≤ ε OP Tpre (I), since P (JW,G ) ≤ ε2 P (JW ) and ε P (JW ) ≤ OP Tpre (I), because at most 1/ε jobs from JW can be scheduled at the same point in time. So if we schedule these jobs one after another at the end of the schedule, we get an integral schedule for I with makespan at most ((1 + ε )3 + ε )OPTpre (I) + O(1/ε2 )pmax ≤(1 + ε)OPT(I) + O(1/ε2 )pmax The number of operations to build the integral schedule is dominated by the number of operations to build the fractional schedule, which is O(n(ln(n) + ε−2 )(n1.5356 + mε−4 )). Since each step we used to manipulate xpre was dominated by this number, this is our total processing time. Note that we stack jobs in container, which resources can be allocated contiguously. So this schedule is feasible for instances, where contiguous resource is required, too. 2.2

Second Case: m ≤ 1/ε.

Let ε > 0 and an Instance I = (J , m, R), with 1/ε ≥ m be given. In this case we do not partition the set of jobs into wide and narrow jobs. We apply the linear grouping to all jobs. Again we get G ≤ 1/ε2 groups Ji . We denote by Jsup the set of jobs, which contains for each i < G one job with processing time P (Ji ) and resource amount max{rj |j ∈ Ji }. We denote by Csup the set of valid configurations of jobs in Jsup . We denote by Isup := (Jsup , m, R) the round up instance. To get a preemptive schedule for Isup we have to solve LPpre (Isup ), while interpreting each job in Jsup as a wide job. By lemma 2.1 we get a solution xpre −2 with O(|Jsup |(ln(|Jsup |)+ε )) = O(ε−4 ) non zero components and C∈Csup (xpre )C ≤ (1 +

ε )OPTpre in O(|Jsup |(ln(|Jsup |) + ε−2 )(|Jsup | + m/ε4 )) operations . Since we have now a polynomial number ˜, of variables, we can construct a solution x which has at most 1/ε2 nonzero components and for which it holds that C∈Csup (xpre )C =  ˜C , in O(|Jsup |1.5356 ε−4 ) operations. C∈Csup x To each of this components we add pmax processing time. Now we place the jobs from Ji for each i < G in the configurations as we placed the wide jobs in the first case. We get a schedule of length at most (1 + ε )OPTpre + ε−2 pmax . The jobs in JG are added in the end of the schedule. These jobs have a total makespan of at most ε OPTpre (I), since P (JG ) ≤ ε2 P (J ) and OPTpre (I) ≥ P (J )/m ≥ ε P (J ). So in the end we have a schedule with a total makespan of at most (1 + ε )OPTpre (I) + ε OPTpre (I) + 1/ε2 pmax ≤ (1 + ε)OPT(I) + O(1/ε2 )pmax . So in both cases we have an algorithm which has the required properties to proof theorem 2.1. 3

Scheduling with resource dependent processing times An instance I˜ for scheduling with resource dependent processing times is given by a set of n jobs J˜, a number of machines m, a resource bound R ∈ Z≥0 , and a set D ⊆ [R]. Furthermore for each job j ∈ J˜ there is a processing time function πj : D → Q>0 ∪ {∞}. The goal is to find for each job j a resource assignment ρj ∈ D, and a starting time tj ∈ N, such that  ρj ≤ R, ∀t ∈ N : j:t∈[tj ,tj +πj (ρj ))

∀t ∈ N :



1 ≤ m,

j:t∈[tj ,tj +πj (ρj ))

minimizing the makespan maxj∈J (tj + πj (ρj )). We set πmax := max{πj (ρ)|∀j ∈ J˜, ρ ∈ D : πj (ρ) < ∞} and denote the makespan of an ˜ Our main result optimal schedule by OPT(I). in this section is an AFPTAS for the resource dependent scheduling problem:

1536

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

Theorem 3.1. There is an algorithm which, (vi) Apply the steps (vi) to (vii) of the fixedgiven an instance I˜ for scheduling with resource resource AFPTAS, yielding a schedule for dependent processing times and a positive numalmost all of the jobs. ber ε > 0, produces a schedule with makespan at (vii) Put the jobs that did not get a unique most: resource allotment on top of the schedule using at most (3/ε2 + 4)πmax extra height. 2 ˜ (1 + ε)OPT(I) + O(1/ε )πmax The running time of the algorithm is polynomi- Preemptive schedule Unlike before, here we ally bounded in n, m, |D| and 1/ε. mean by preemptive, a schedule where the jobs W.l.o.g. we may assume that m ≤ n, because can be interrupted at any time at no cost and otherwise we have the problem of scheduling restarted later, possibly on another processor malleable parallel tasks, for which an appropri- with a different resource-allotment. We denote the length of an optimal preemptive schedule ate AFPTAS is already known [11]. ˜ ˜ The basic idea of the algorithm is to find a for I by OPTpre (I). Like before for a given instance I a configuration C := {j : ρC,j |j ∈ J˜} resource allotment for the jobs and to use the AFPTAS for the fixed-resource variant. Finding is a multiset of jobs from J˜. However, in this a resource allotment that allows analysis is the context we will interpret the multiplicity of a main difficulty here. W.l.o.g. we assume that job as the number of resource-units that are to it. A configuration 1/ε ∈ Z>0 and set ε := ε/8. Like in the fixed- assigned  C will be called resource variant, the AFPTAS works differently valid, if j:ρC,j >0 1 ≤ m, j∈J˜ ρC,j ≤ R, and in the two cases 1/ε < m and 1/ε ≥ m, where ρC,j ∈ D ∪ {0} for each j ∈ J˜. Note that the second case is much simpler. We give a ρC,j = 0 corresponds to the case that the job brief overview of the algorithm for the first case, j is not a part of the configuration. The set of followed by a detailed description and analysis valid configurations is denoted by C. ˜ for both cases, and lastly some concluding The computation of the schedule is done remarks about the scope of the algorithm. via the following LP:  xC min Algorithm Given an instance I˜ and ε > 1/m C∈C˜ the algorithm can be summarized as follows:  1  (i) Compute via max-min resource sharing a xC ≥ 1 ∀j ∈ J˜ πj (ρ) preemptive schedule with length at most ρ∈D C:ρC,j =ρ ˜ (1 + ε )OPTpre (I). xC ≥ 0 ∀C ∈ C˜ (ii) Using the preemptive schedule, define an instance I for the fixed-resource variant, In the following this LP is denoted by LP (I). ˜ pre ˜ for which OPTpre (I) ≤ (1 + ε )OPTpre (I) ˜ It is easy to see, that a solution of LPpre (I) holds. corresponds to a preemptive schedule and vice(iii) Apply the steps (i) to (v) of the fixed- versa. Note that LP (I) ˜ is closely related to pre resource AFPTAS, yielding a solution (¯ x, y¯) the LP used to find a preemptive solution for for the window LP for the rounded instance the fixed-resource variant, and indeed we will I  , that uses at most 1/ε2 + 2 windows. follow the same approach to find an approximate (iv) Compute a unique resource allotment for solution as was done in lemma 2.1. 2 all but at most 3/ε + 4 of the original jobs ˜ that A solution x to LPpre (I) in J˜, which is in some sense compatible Lemma 3.1.   ˜ with both the linear grouping for I and the satisfies C∈C˜ xC ≤ (1 + ε )OPTpre (I) can be windows. found in time O(n3 m2 |D|ε−1 (ε−2 + ln n)). Furthermore a solution with the same objec(v) Use the unique resource allotment to define a new instance for the fixed-resource variant tive value and at most n+1 non zero components x, y˘) of the window LP can be found using O(n2.5356 (ε−2 + ln n) operaand a new solution (˘ that has the same length as (¯ x, y¯). tions.

1537

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

Proof. We present the adaptations that have to be made in the proof of lemma 2.1. First we define a (non-empty convex compact) set:    B := (xC )C∈C˜ xC = 1, xC ≥ 0, C ∈ C˜ C∈C˜

For each j ∈ J˜ we define a non-negative linear function:   1 ˜ fj : R|C| → R>0 , x → xC πj (ρ) ρ∈D

C:ρC,j =ρ

Moreover we set: λ∗ = max{λ|fj (x) ≥ λ, j ∈ J˜, x ∈ B} The algorithm by Grigoriades et al. [6] can be applied to find an x ∈ B that satisfies fj (x) ≥ (1 − γ)λ∗ for each j ∈ J˜. In each iteration of the algorithm a price vector q ∈ Rn is obtained and the following block problem has to be solved approximately with an accuracy γ  that depends linear on γ:    qj fj (x)x ∈ B max j∈J˜

It can be easily seen that an optimum to this problem is obtained at a point x ∈ B with xC ∗ = 1 for a single configuration C ∗ , and xC = 0 for C =

C ∗ . The problem to find such a configuration can be described by the following ILP:   qj xj,ρ (3.14) max πj (ρ) j∈J˜ ρ∈D  (3.15) ρxj,ρ ≤ R j∈J˜ρ∈D

(3.16)



xj,ρ ≤ m



xj,ρ ≤ 1

∀j ∈ J˜

ρ∈D

(3.18)

xj,ρ ∈ {0, 1}

Fixed-resource instance Based on the preemptive schedule we now define an instance I of the problemwith fixed resources. Let x(j,ρ) := 1/πj (ρ) C:ρC,j =ρ xC be the fraction of job j ∈ J˜ that is scheduled with a resource amount of ρ ∈ D according to the preemptive solution. W.l.o.g. we may assume that:  (3.19) x(j,ρ) = 1 ∀j ∈ J˜ : ρ∈D

j∈J˜ ρ∈D

(3.17)

the configuration, with summed up resource allocation at most R; and due to (3.17) every job is scheduled at most once. This problem can be seen as a Multiple-Choice Knapsack Problem with an additional capacity constraint (kMCKP): A variant of the knapsack problem where the items are partitioned into equivalence classes, and only one item from every class may be packed. Moreover, the capacity constraint bounds the number of items that can be packed. A naive application of basic techniques by Lawler [15] provides an FPTAS for this problem with running time O(tk 3 δ −1 ), where t is the number of items to be packed, k the maximum number of items that may be packed, and δ the accuracy. Applied to this case we get a running time of O(n|D|m3 γ −1 ). Scaling x and setting γ = ε /(1 + ε ) we get a solution with the required makespan after O(n(ε−2 + ln n)) iterations. In each iteration there is a numerical overhead of O(n ln ln(nγ −1 )) and the knapsack problem has to be solved. The running time of the FPTAS can be bounded by O(n2 |D|m2 γ −1 ), because m ≤ n, and therefore the overhead can be ignored. Since ε /2 ≤ γ ≤ ε and ε = ε/8, we get the asserted running time. We turn this solution into a basic feasible one in time O(n2.5356 (ε−2 + ln n). 

∀ρ ∈ D, j ∈ J˜

The variables xj,ρ express, whether ρ units of the resource are assigned to a job j in the configuration. The constraint (3.16) and (3.15) guarantee that there are at most m jobs in

Since, if the left side should be larger than one, we can just scale down the x(j,ρ) values. The new set of jobs is defined as J = {(j, ρ)|j ∈ J˜, ρ ∈ D, xj,ρ > 0} with processing time p(j,ρ) := x(j,ρ) πj (ρ) and resource requirement r(j,ρ) = ρ. The machine set and the resource bound stay the same. This instance I has at most (n + 1)m jobs, because in the preemptive solution at most n + 1

1538

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

configurations are used, each containing at most Unique resource allotment The goal in this m jobs. Furthermore note that: section is to find a unique resource allocation rj for almost all the jobs j ∈ J˜ of the original ˜ OPTpre (I) ≤ (1 + ε )OPTpre (I) instance. (3.20) ˜ First case: 1/ε < m Using a linear ≤ (1 + ε )OPT(I) program, we will find a new instance for the The first inequality holds, because (xC ) yields a fixed-resource variant, in which the wide jobs solution for the preemptive version of the fixed- still fit into the linear grouping stack given by resource problem, and the second is obvious. I, and the narrow jobs fit into the windows From here on we have to differentiate the given by (¯ x, y¯). We set u(j,ρ),i := δ(j,ρ),i x(j,ρ) two cases 1/ε < m and 1/ε ≥ m. In both cases for each i ∈ [G] and (j, ρ) ∈ J ; and W,i we will make use of results for the fixed-resource v −1 y¯(j,ρ),w for each (j, ρ) ∈ JN (j,ρ),w := (πj (ρ)) problem. However, the second case is much and w ∈ W  . This yields a solution to the simpler since a unique resource allotment can following LP: be found prior to the application of the AFPTAS  for the fixed-resource variant. Therefore, the πj (ρ)u(j,ρ),i whole algorithm can be applied, while in the first (3.23) (j,ρ)∈J W,i case some steps are conducted before finding a unique resource allotment for all the jobs, and ∀i ∈ [G] ≤ P (JW,i )  some afterwards. (3.24) πj (ρ)v(j,ρ),w First case: 1/ε < m For instance I and (j,ρ)∈JN  ε we now use the steps (i) to (v) of the  x ¯C,w ∀w ∈ W  ≤ m(w) AFPTAS for the fixed-resource problem. By application of linear grouping the set of jobs is C∈C(w)  divided into wide JW and narrow jobs JN . The (3.25) r(j,ρ) πj (ρ)v(j,ρ),w 2 wide jobs are split up into G = 1/ε groups (j,ρ)∈JN JW,i . It may happen that jobs that are part  x ¯C,w ∀w ∈ W  ≤ R(w) of multiple groups are split up correspondingly. C∈C(w) We formally handle this by introducing a factor  δ(j,ρ),i that denotes the fraction of a wide job (3.26)  u(j,ρ),i (j, ρ) ∈ JW that lies in the i’th group in i∈[G] (j,ρ)∈JW,i the linear grouping stack. In the next step   v(j,ρ),w = 1 ∀j ∈ J˜ + a modified instance Isup = (Jsup,W ∪ JN , m, R)  (j,ρ)∈J w∈W with replaced wide jobs is formed, for which N lemma 2.1, and subsequently lemma 2.3 can be (3.27) u(j,ρ),i ≥ 0 ∀i ∈ [G], (j, ρ) ∈ JW,i applied. Summarizing we get: (3.28) v(j,ρ),w ≥ 0 ∀w ∈ W  , ∀(j, ρ) ∈ JN Lemma 3.2. We can obtain a set of windows W  , a set of configurations CW and a basic x, y¯) to LPW (Isup , CW , W  ) The inequality (3.23) holds due to the definition feasible solution (¯ of the linear grouping, since πj (ρ)u(j,ρ),i = with the following properties: δ(j,ρ) p(j,ρ) is exactly the height that job (j, ρ) contributes to the height P (JW,i ) of group i. (3.21) |W  | ≤ 1/ε2 + 2 The next two constraints (3.24) and (3.25) are  2 P (¯ x) ≤ (1 + ε ) OPTpre (Isup ) (3.22) satisfied, because πj (ρ)v(j,ρ),w = y¯(j,ρ),w , and The running time can be bounded by (¯ x, y¯) satisfies the constraints (2.8) and (2.9) of O(nm(ln(nm) + ε−2 )((nm)1.5356 + mε−4 )). LPW . Furthermore it holds that: Proof. The running time is due to lemma 2.1 and |J | ≤ (n + 1)m. All the remaining claims follow from lemma 2.3. 

1539





u(j,ρ),i +

i∈[G] (j,ρ)∈JW,i





v(j,ρ),w

w∈W  (j,ρ)∈JN

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

=



xj,ρ

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

(j,ρ)∈JW

+ =









xj,ρ +



=





xj,ρ +

(πj (ρ))

−1

p(j,ρ)

(πj (ρ))−1 xj,ρ πj (ρ)

(j,ρ)∈JN



xj,ρ +

(j,ρ)∈JW



y¯(j,ρ),w

w∈W 

(j,ρ)∈JN

(j,ρ)∈JW

=



(πj (ρ))−1

(j,ρ)∈JN

(j,ρ)∈JW

=

δ(j,ρ),i

i∈[G]

xj,ρ

(j,ρ)∈JN

xj,ρ = 1

(j,ρ)∈J

(3.19)

This yields (3.26). Next we convert (u, v) into a basic feasible solution for the LP. Now (u, v) has at most G+2|W  |+|J˜| non-zero variables. Furthermore, due to (3.26) and a simple counting argument there are at most G + 2|W  | ≤ 3/ε2 + 4 jobs j ∈ J˜ with more then one non-zero variable from the set {u(j,ρ),i , v(j,ρ),w |ρ ∈ D, i ∈ [G], w ∈ W  } of variables related to j. We will schedule the jobs with more then one non-zero variable separately in the end. The rest of the jobs J¯ yield a new instance I¯ for the fixed-resource variant. For j ∈ J¯ exactly one of the following holds: ∃ρ ∈ D, i ∈ [G] : ∃ρ ∈ D, w ∈ W  :

u(j,ρ),i = 1 v(j,ρ),w = 1

In the first case j is a wide job j ∈ J¯W and in the second it is narrow j ∈ J¯N , while in both cases the processing time and resource requirement are given by pj := πj (ρ) and rj := ρ. Moreover, the wide jobs are uniquely assigned to groups J¯W,i . We define a modified rounded instance I¯sup := (Jsup,W ∪ J¯N , m, R) for I¯ using the old rounded wide jobs and the new narrow jobs. Furthermore, let x ˘C,w := x ¯C,w for each C ∈ CW , and for each j ∈ J¯N let:

pj , if v(j,ρ),w = 1 y˘j,w := 0 , otherwise

x, y¯), and to which lemma 2.4 makespan as (¯ can be applied. It can be computed using O(nmε−2 (nm + ε−2 )1.5356 ) operations. Proof. The generalized configurations keep the same height, hence the makespan stays the same, and, since also the same rounded wide jobs are used, the constraint (2.6) of LPW holds. The constraints (2.8) and (2.9) are satisfied, because v satisfies (3.24) and (3.25), while constraint (2.7) holds by the definition of y˘. Because of (3.23) it holds that P (J¯W,i ) ≤ P (JW,i ) for each i ∈ [G], i.e. the new wide jobs still fit into the linear grouping stack and can therefore be scheduled by the fixed-resource AFPTAS. Also the narrow jobs can be handled, because (2.8) and (2.9) are satisfied. The running time is dominated by the computation of the basic feasible solution. Since the LP has at most O((nm + ε−2 )) constraints and O(nmε−2 ) variables, this can be done in time O(nmε−2 (nm + ε−2 )1.5356 ).  Second case: 1/ε ≥ m In this case it is possible to treat all the jobs as wide jobs. We apply linear grouping and define u as above. This yields a solution for the LP that is given by (3.23), (3.27) and:   (3.29) u(j,ρ),i = 1 ∀j ∈ J˜ i∈[G] (j,ρ)∈JW,i

We transform u into a basic feasible solution and due to the same counting argument there are at most G = 1/ε2 fractional variables. Next, the fractional jobs are removed and the wide jobs defined as above. Due to (3.23) they fit into the linear grouping stack. The integral schedule We can now apply the last steps of the fixed-resource AFPTAS. First case: 1/ε < m We can apply (the proof of) lemma 2.4 to (˘ x, y˘) yielding an integral schedule for almost all the jobs with makespan at most: ((1 + ε )3 + ε )OPTpre (I) + (5 +

1 3 + 2 )pmax ε ε

x, y˘) is a solution Note that pmax ≤ πmax holds. We schedule the Lemma 3.3. It holds that (˘ to LPW (I¯sup , CW , W  ) that has the the same remaining jobs J˜ \ J¯ successively at the end

1540

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

of the schedule, each with an optimal resource assignment. In doing so we add at most |J˜ \ J¯| max min πj (ρ) ≤ (4 + 3/ε2 )πmax j∈J˜ ρ∈D

length to the schedule. Summing up and applying (3.20) we get a makespan of at most: ˜ ((1 + ε )3 + ε )(1 + ε )OPTpre (I) 6 1 + (9 +  + 2 )πmax ε ε ˜ + O(1/ε2 )πmax ≤(1 + ε)OPT(I) The overall running time is polynomial in n, |D| and ε−1 . Due to the previous observations it can be bounded by: m 1 m O n2 |D|(ln(nm) + 2 )((nm)1.5356 + 4 ) ε ε ε This analysis however, is not tight. Second case: 1/ε ≥ m In this case we can apply all the steps of the fixed-resource AFPTAS that follow the linear grouping, yielding a schedule for all but at most G = 1/ε2 jobs. The remaining jobs again are scheduled in the end. The corresponding schedule has a makespan of at most: (1 + 2ε )OPTpre (I) + 2/ε2 pmax ˜ + O(1/ε2 )pmax ≤(1 + 2ε )(1 + ε )OPT(I) ˜ + O(1/ε2 )pmax ≤(1 + ε)OPT(I) The overall running time is obviously smaller than in the first case. Concluding remarks One might note that there are many instances for which πmax is very big. Therefore we want to point out that the above algorithm can be modified such that the πmax -factor can at least be bounded by OPTpre (I). This can be done by changing the computation of the preemptive solution: We guess OPTpre (I) via binary search and only use configurations in which every job has a processing time of at most OPTpre (I). This increases the overall running time only slightly. Furthermore the algorithm will also work for variants of the problem with more succinctly encoded processing time functions, as long as an approximate preemptive schedule can be efficiently computed.

1541

References [1] Peter A. Beling and Nimrod Megiddo. Using fast matrix multiplication to find basic solutions. Theoretical Computer Science, 205(1):307–316, 1998. [2] Wenceslas Fernandez de la Vega and George S. Lueker. Bin packing can be solved within 1+epsilon in linear time. Combinatorica, 1(4):349–355, 1981. [3] Leah Epstein and Asaf Levin. 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. [4] Michael R. Garey and Ronald L. Graham. Bounds for multiprocessor scheduling with resource constraints. SIAM Journal on Computing, 4(2):187–200, 1975. [5] Michael R. Garey and David S. Johnson. Complexity results for multiprocessor scheduling under resource constraints. SIAM Journal on Computing, 4(4):397–411, 1975. [6] Michael D. Grigoriadis, Leonid G. Khachiyan, Lorant Porkolab, and Jorge Villavicencio. Approximate max-min resource sharing for structured concave optimization. SIAM Journal on Optimization, 11(4):1081–1091, 2001. [7] Alexander Grigoriev, Maxim Sviridenko, and Marc Uetz. Machine scheduling with resource dependent processing times. Mathematical programming, 110(1):209–228, 2007. [8] Alexander Grigoriev and Marc Uetz. Scheduling jobs with time-resource tradeoff via nonlinear programming. Discrete optimization, 6(4):414–419, 2009. [9] Dorit S. Hochbaum and David B. Shmoys. Using dual approximation algorithms for scheduling problems theoretical and practical results. Journal of the ACM (JACM), 34(1):144–162, 1987. [10] Ellis Horowitz and Sartaj Sahni. Exact and approximate algorithms for scheduling nonidentical processors. J. ACM, 23(2):317– 327, April 1976. [11] Klaus Jansen. Scheduling malleable parallel tasks: An asymptotic fully polynomial time approximation scheme. Algorithmica, 39(1):59– 81, 2004. [12] ShanXue Ke, BenSheng Zeng, WenBao Han, and Victor Y Pan. Fast rectangular matrix multiplication and some applications. Science in China Series A: Mathematics, 51(3):389– 406, 2008.

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Downloaded 01/28/17 to 37.44.207.12. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php

[13] Hans Kellerer. An approximation algorithm for identical parallel machine scheduling with resource dependent processing times. Operations Research Letters, 36(2):157–159, 2008. [14] Claire Kenyon and Eric R´emila. A nearoptimal solution to a two-dimensional cutting stock problem. Mathematics of Operations Research, 25(4):645–656, 2000. [15] Eugene L. Lawler. Fast approximation algorithms for knapsack problems. Mathematics of Operations Research, 4(4):339–356, 1979. [16] Monaldo Mastrolilli and Marcus Hutter. Hybrid rounding techniques for knapsack problems. Discrete Applied Mathematics, 154(4):640 – 649, 2006. Efficient Algorithms Efficient Algorithms. [17] Martin Niemeier and Andreas Wiese. Scheduling with an orthogonal resource constraint. In Approximation and Online Algorithms, pages 242–256. Springer, 2013.

1542

Copyright © by SIAM. Unauthorized reproduction of this article is prohibited.

Suggest Documents