Scheduling with Non-Renewable Resources: Minimizing the Sum of Completion Times

The paper considers single-machine scheduling problems with a non-renewable resource. In this setting, we are given a set jobs, each of which is characterized by a processing time, a weight, and the job also has some resource requirement. At fixed points in time, a certain amount of the resource is made available to be consumed by the jobs. The goal is to assign the jobs non-preemptively to time slots on the machine, so that at any time their resource requirement does not exceed the available amounts of resources. The objective that we consider here is the minimization of the sum of weighted completion times. We give polynomial approximation algorithms and complexity results for single scheduling machine problems. In particular, we show strong NP-hardness of the case of unit resource requirements and weights ($1|rm=1,a_j=1|\sum C_j$), thus answering an open question of Gy\"orgyi and Kis. We also prove that the schedule corresponding to the Shortest Processing Time First ordering provides a $3/2$-approximation for the same problem. We give simple constant factor approximations and a more complicated PTAS for the case of $0$ processing times ($1|rm=1,p_j=0|\sum w_jC_j$). We close the paper by proposing a new variant of the problem in which the resource arrival times are unknown. A $4$-approximation is presented for this variant, together with an $(4-\varepsilon)$-inapproximability result.


Introduction
The problem of scheduling with non-renewable resources appears naturally in practical problems where resources like raw materials, energy, or financial constraints are taken into account.These problems are interesting both from the practical and from the theoretical point of view.In the general setting, we are given a set of jobs and a set of machines.Each job is equipped with a requirement vector that encodes the needs of the given job for the different types of resources.There is an initial stock for each resource, and some additional resource arrival times in the future are known together with the arriving quantities.The aim is to find a schedule of the jobs on the machines such that the resource requirements are met.
We will use the standard α|β|γ notation of Graham, Lawler, Lenstra and Kan [4].Grigoriev, Holthuijsen and Van De Klundert [5] extended this notation by adding the restriction rm = r to the β field, meaning that there are r resources (raw materials).In the present paper, we concentrate on problem 1|rm = 1| w j C j , that is, when we have a single machine, a single resource, and the goal is to minimize the weighted sum of completion times.While there is a long list of results on the approximability of the makespan objective, much less is known about the complexity and approximability of the total weighted completion time objective.
Previous work Scheduling problems with resource restrictions were introduced by Carlier [1] and Slowinski [13].Carlier settled the computational complexity of several variants for the sinlge machine case [1].In particular, it was shown that 1|rm = 1| w j C j is NP-hard in the strong sense.This was also proved independently by Gafarov, Lazarev and Wener in [2].Kis [12] showed that the problem remains weakly NP-hard even when the number of resource arrival times is 2. On the positive side, he gave an FPTAS for 1|rm = 1, q = 2| w j C j .A variant of the problem where each job has processing time 1, there are q = n resource arrival times such that t i = iM and b i = M for i = 1, . . ., n, and M = j∈J a j /n is an integer, was considered in [2].Recently, Györgyi and Kis [11] gave polynomial time algorithms for several special cases, and also showed that the problem remains weakly NP-hard even under the very strong assumption that the processing time, the resource requirement and the weight are the same for each job.They also provided a 2-approximation algorithm for this variant, and a polynomial-time approximation scheme (PTAS) when the number of resource arrival times is a constant and the processing time equals the weight for each job, while the resource requirements are arbitrary.
In contrast to the case of total weighted completion objective, much is known about scheduling problems with non-renewable resources for the maximum makespan and maximum lateness objectives.Slowinski [13] studied the preemptive scheduling of independent jobs on parallel unrelated machines with the use of additional renewable and non-renewable resources under financial constraints.Toker, Kondakci and Erkip [14] examined a single machine scheduling problem under non-renewable resource constraint, using the makespan as a performance criterion.Xie [15] generalized this result to the problem with multiple financial resource constraints.Grigoriev, Holthuijsen and Van De Klundert [5] presented polynomial time algorithms, approximations and complexity results for single scheduling machine problems with unit or all equal processing times, and maximum lateness and makespan objectives.In a series of papers [6,7,8,9,10], Györgyi and Kis presented approximation schemes and inapproximability results both for single and parallel machine problems with the makespan and the maximum lateness objectives.In [11], they proposed a bracnh-and-cut algorithm for minimizing the maximum lateness.

Our results
The first problem that we consider is 1|rm = 1, a j = 1| C j .The complexity of this problem was posed as an open question in [11].We show that the problem is NP-hard in the strong sense.
In the light of Theorem 1, one might be interested in finding an approximation algorithm for the problem.Given any scheduling problem on a single machine, the Shortest Processing Time First (SPT) schedule orders the jobs by processing times, i.e. p spt −1 (i) ≤ p spt −1 (i+1) for all i.We prove that spt provides a 3/2-approximation.Although the algorithm is merely scheduling according to the SPT order, the analysis if the algorithm is rather involved.
Theorem 2. The SPT schedule gives a 3  2 -approximation for 1|rm = 1, a j = 1| C j , and the approximation guarantee is tight.
The second problem considered is the special case when the processing time is 0 for every job.This setting is a relaxation of those instances where the processing times are short and the resource arrival times are far away from each other.First we give a 6-approximation based on a non-trivial greedy approach.Theorem 3.There exists a 6-approximation for 1|rm = 1, p j = 0| C j w j with running time O(n log(n)).
We give a slightly more complicated (4 + ε)-approximation that illustrates one of the important ideas of the general PTAS.
As a next step toward an efficient approximation algorithm, we present a PTAS for the case of a constant number of resource arrival times.This procedure will be used as a subroutine in our algorithm for the general case.
Finally, we prove the main result of the paper, which is a PTAS for the case of an arbitrary number of resource arrival times.Theorem 6.There exists a PTAS for 1|rm = 1, p j = 0| C j w j .
The last problem that we is another variant of 1|rm = 1, p j = 0| C j w j where the arrival times are unknown.We denote this problem by 1|rm = 1, p j = 0, t i unkown| C j w j .Theorem 7.There exists a (4+ε)-approximation for 1|rm = 1, p j = 0, t i unkown| C j w j with running time polynomial in 1/ε and the input length.Moreover, there is no (4−ε)-approximation algorithm for the problem for any ε > 0.
Organization The rest of the paper is organized as follows.Basic notation and terminology are introduced in Section 2. A strong NP-hardness proof and a 3/2-approximation algorithm for problem 1|rm = 1, a j = 1| C j are given in Section 3. Results on problem 1|rm = 1, p j = 0| C j are discussed in Section 4, where a greedy 6-approximation, a (4 + ε)-approximation, a PTAS for the case of constant resource arrival times, and a PTAS for the general case are presented.We close the paper by proposing a new variant of the problem in which the resource arrival times are unknown.A 4-approximation is presented for this case, together with an (4 − ε)-inapproximability result.

Preliminaries
Throughout the paper, we will use the following notation.We are given a set J of n jobs.Each job j ∈ J has a non-negative integer processing time p j , a non-negative weight w j , and a resource requirement a j .The resources arrive at time points t 1 , . . ., t q , and the amount of resource that arrives at time point t i is denoted by b i .We might assume that q i=1 b i = n j=1 a j holds.We will always assume that t 1 = 0, as this does not effect the approximation ratio of our algorithms.
The jobs should be processed non-preemptively on a single machine.A schedule is an ordering of the jobs, that is, a mapping σ : J → [n], where σ(j) = i means that job j is the ith job scheduled on the machine.The completion time of job j in schedule σ is denoted by C σ j .We will drop the index σ if the schedule is clear from the context.In any reasonable schedule, there is an idle time before a job j only if there is not enough resource left to start j after finishing the last job before the idle period.Hence the completion time of job j is basically determined by the ordering and by the resource arrival times, as j will be scheduled at the first moment when the preceding jobs are already finished and the amount of available resource is at least a j .

Strong NP-completeness
The aim of this section is to prove Theorem 1.
Proof.Recall that all a j and w j values are 1, and each job has an integer processing time p j .The number of resource arrival times is part of the input.
We prove NP-completeness by reduction from the 3-Partition problem.The input contains numbers B ∈ N, n ∈ N, and x j ∈ N (j = 1, . . ., 3n) such that B/4 < x j < B/2 and 3n j=1 x j = nB.A feasible solution is a partition J 1 , . . ., J n of [3n] such that |J i | = 3 and j∈J i x j = B for every i ∈ [n].In contrast to the Partition problem, the 3-partition problem remains NP-complete even when the integers x j are bounded above by a polynomial in n.That is, the problem remains NP-complete even when the numbers in the input are represented as unary numbers [3,.
Let K = 4nB.The reduction to 1|rm = 1, a j = 1| C j involves three types of jobs.
Normal jobs These correspond to the numbers x j in the 3-Partition instance, so there are 3n of them and the processing time p j of the j-th normal job is x j .
Small jobs Their processing time is 1 and there are nK of them.
Large jobs Their processing time is K and there are nK of them.
There are also three types of resource arrivals: Type 1 Three resources arrive at times i(B + K) (i = 0, . . ., n − 1).
Suppose that the 3-Partition instance has a feasible solution J 1 , . . ., J n .We consider the following schedule S: resources of Type 1 are used by normal jobs, such that jobs in J i are scheduled between (i − 1)(B + K) and iB + (i − 1)K (in spt order).Type 2 resources are used by small jobs that start immediately.Type 3 resources are used by the large jobs that also start immediately at the resource arrival times (see Figure 1).
Instead of C j , consider the equivalent shifted objective function (C j − t j − p j ), where t j is the arrival time of the resource used by job j and p j is its processing time -we assume without loss of generality that resources are used by jobs in order of arrival.Note that all terms 0 B B+K (n−1)(B+K) J n large job large job small jobs small jobs of (C j − t j − p j ) are nonnegative.As small jobs and large jobs start immediately at the arrival of the corresponding resource in schedule S, their contribution to the shifted objective function is 0. The jobs in J i have total processing time B, and their contribution to the shifted objective function is two times the processing time of the shortest job plus the processing time of the second shortest job, which is at most B. Hence the schedule S has objective value at most nB.
We claim that if the 3-Partition instance has no feasible solution, then the objective value of any schedule is strictly larger than nB.First, notice that if a large job is scheduled to start before time n(B + K), then (C j − t j − p j ) has a term strictly larger than nB as there is a resource that arrives while the large job is processed and is not used for more than nB time units.Similarly, if the first large job starts at n(B + K) but uses a resource that arrived earlier, then the resource that arrives at n(B + K) is not used for more than nB time units.We can conclude that the first large job uses the resource arriving at n(B + K).
If the first large job does not start at n(B +K), then all large jobs have positive contribution to the objective value, so again, the objective value is larger than nB.We can therefore assume that the large jobs start exactly at n(B + K) + iK (i = 0, . . ., nK − 1) and that there is no idle time before (B + K)n.In particular this means all other jobs are already completed at (B + K)n.
Consider Type 2 resources arriving at i(B + K) + j (j = B, . . ., B + K − 1) for some fixed i.If the first or the second resource is not used immediately, then none of the subsequent ones are, so the objective value is more than nB.Hence, the first resource must be used immediately by a small job.
Suppose that some resource in this interval is used by a normal job.If it is followed by a small job, then we may improve the objective value by exchanging the two.Thus, in this case, we can assume that the last resource of the interval is used by a normal job, and also the Type 1 resources arriving at (i + 1)(B + K) are used by normal jobs.But this is impossible, because normal jobs have processing time at least B/4 + 1, and a small job starts at time To sum up, we can assume that all resources of Type 2 are used immediately by small jobs.This means that normal jobs have to use resources of Type 1, and must exactly fill the gaps of length B between the arrival of resources of Type 2. This is only possible if the 3-partition instance has a feasible solution, concluding the proof of Theorem 1.

Shortest processing time first for unit resource requirements
In the previous section, we have seen that scheduling with a non-renewable resource is strongly NP-hard already for unit resource requirements.Now we show that scheduling the jobs according to an spt ordering provides a 3/2-approximation for the problem with unit weight and unit resource requirements, thus proving Theorem 2.
Theorem 2. The SPT schedule gives a 3  2 -approximation for 1|rm = 1, a j = 1| C j , and the approximation guarantee is tight.Proof.To prove the theorem consider any instance I.We denote the completion times for the spt ordering by C j and their sum by spt.Furthermore, let denote the starting time of the ith job in the spt schedule.Let opt be the optimal schedule for I.We denote the completion times for opt by C j and their sum by opt.Furthermore, let S opt −1 (i) := C opt −1 (i) − p opt −1 (i) denote the starting time of the ith job in the optimal schedule.
Our strategy is to simplify the instance by revealing its structural properties while not decreasing spt opt .This way we get an upper bound for the approximation factor.We first consider the resource arrival times.Claim 8. We may assume that the ith resource arrives at S opt −1 (i) for i = 1, . . ., n.
Proof.As the ith resource is used by job opt −1 (i), the arrival time of that resource is at most S opt −1 (i) .If we move the arrival time of the resource to exactly S opt −1 (i) , then opt does not change and spt cannot decrease.
The next claim shows that we can get rid of the idle times in the optimal schedule.Claim 9. We may assume that there is no idle time in schedule opt, that is, Proof.Suppose that there is some i such that t i > C opt −1 (i−1) .We reduce t(i ) by ∆ = t(i) − C opt −1 (i−1) for all i ≥ i.Then for each i ≥ i, the completion time C opt −1 (i ) decreases by ∆.For each i ≥ i, the completion time C spt −1 (i ) decreases by at most ∆.This follows from the fact that the resource arrival times decrease by ∆ and the completion time of the previous job can decrease by at most ∆ (which can be shown by induction).Hence opt decreases by at least as much as spt.Since spt ≥ opt, the ratio spt opt will not decrease by this change.
Next, we modify the processing times.
Proof.If both schedules start with the same job, then we can remove the job from the instance and decrease b 1 by 1. Then opt decreases by the same amount as spt.We can repeat this until the schedules start with jobs of different processing times.Now p opt −1 (1) > p spt −1 (1) , since spt starts with the shortest job.Decreasing the processing time of job spt −1 (1) to 0 (without changing any arrival time) decreases spt by p spt −1 (1) and opt by at least p spt −1 (1) .We can eliminate idle times in the new optimal schedule as in the proof of Claim 9.
Claim 11.We may assume that p j ∈ {0, 1} for all j ∈ J.
Proof.Let p max = max j∈J p j be the maximum processing time.Scaling the processing times by dividing all processing and arrival times by p max has no effect on spt opt , hence we may assume that p max = 1.Now assume that there is a job j with p = p j ∈ (0, 1).Let p + = min{p j | j ∈ J, p j > p} and p − = max{p j | j ∈ J, p j < p}.Let J p = {j ∈ J | p j = p} be the set of jobs with processing time p.We will show that we can either increase the processing time of all jobs in J p to p + or decrease the processing time of all jobs in J p to p − without decreasing spt opt .For j ∈ J, let h j denote the number of jobs processed after j plus 1 with respect to schedule opt, i.e. h j = n − opt −1 (j) + 1. Changing the processing times of all jobs in J p by some ∆ ∈ [p − − p, p + − p] and adopting the arrival times of the resources will increase opt by ∆ j∈Jp h j .Indeed, every time we change the processing time of one job j, the completion time of j and of all jobs after j will be increased by ∆.Note that ∆ can be negative, which means the completion times can also 'decrease' by |∆|.
Notice that the order of the jobs in the spt schedule is not changed.Consider the spt schedule before the change.Let job j ∈ J be any job, and let j 0 be the the first job that is processed after the last idle time before the starting time of j.Let f j be the number of jobs j ∈ J p with C j ≤ S j 0 .For each of those jobs, the arrival time of the resource needed to start j 0 will be changed by ∆f j .Thus, the starting time of job j 0 in the changed spt schedule is at least S j 0 + ∆f j .Now let g j be the number of jobs j ∈ J p that are processed in the time interval [S j 0 , C j ) before the change.For each of those jobs, the processing time is changed by ∆ and the job is started at or after the new starting time of job j 0 .Thus the new completion time of j is at least C j + ∆f j + ∆g j .Consequently, spt will increase by at least j∈J (f j + g j )∆ if ∆ > 0, and decrease by at most j∈J (f j + g j )|∆| if ∆ < 0.
If j∈J (f j +g j ) j∈Jp h j ≥ spt opt , then increasing the processing times in J p to p + will not decrease spt opt .Otherwise, decreasing the processing times in J p to p − will not decrease spt opt .Each time we apply this operation, the number of distinct processing times decreases by 1. Finally, we get an instance where the only processing times are p min = 0 and p max = 1.
Lastly, we modify the order of the jobs in the optimal solution.If opt and spt process a job of length 0 at the same time, then we can remove the job from the instance and reduce the number of resources that arrive at this time by 1.This will reduce opt and spt by the same amount.
Let t be the time at which schedule spt first starts to process a job of length 1.On one hand, opt does not process jobs of length 0 before t by the above argument.On the other hand, there is no idle time after t in spt, because that would mean idle time in opt.Thus, if we move all jobs of length 0 and their corresponding resource arrivals in opt to time t, then spt does not change but opt decreases.We may thus assume that schedule opt processes every job of length 0 at t.We conclude that opt first processes k 1 jobs of length 1, then k 1 jobs of length 0 and then k 2 jobs of length 1, while spt starts with the jobs of length 0 having a lot of idle time in the beginning and then consecutively processes all jobs of length 1 (see Figure 2).The weighted sums of completion times are then given by opt =

OPT SPT
We get showing that the approximation factor is at most 3 2 .Setting k 2 = k 1 and letting k 1 go to infinity gives us a sequence of instances such that spt opt converges to 3  2 as we have spt = 9 2 k 2 1 + O(k 1 ) and opt = 3k 2 1 + O(k 1 ).This concludes the proof of Theorem 2.
4 The problem 1|rm = 1, p j = 0| C j w j In this section we consider problem 1|rm = 1, p j = 0| C j w j , another special case of 1|rm = 1| C j w j .The problem clearly is NP-hard even for q = 2 as the knapsack problem can be reduced to it.Indeed, maximizing the weight of the items in the knapsack is equivalent to the task of maximizing the weight of jobs that are scheduled at the first resource arrival time.Recall that Kis [12] gave a FPTAS for 1|rm = 1| C j w j when there are two resource arrival times.
First we give a 6-approximation for the problem based on a greedy approach.Next, we give a more complicated 4-approximation that illustrates one of the important ideas of the more general PTAS.Then we provide a PTAS for the case when q, the number of resource arrival times is a constant.This algorithm will be used as a subroutine in the PTAS for the general case.Finally, we prove the main result of the paper which is a PTAS for the case of an arbitrary number of resource arrival times.
Since the processing times are 0, every job is processed at one of the arrival times in any optimal schedule.Thus a schedule can be represented by a mapping π : J → [q], where π(j) denotes the index of the resource arrival time when job j is processed.A schedule is feasible if the resource requirements are met, that is, if for all 1 ≤ k ≤ q.As we assume that i b i = j a j holds, this is equivalent to for all 1 ≤ k ≤ q.Define B k = i≥k b i , and consider the set of jobs that are not processed before a given time point t i .Then (2) says that if the resource requirements of these jobs add up to at least B i , then our schedule is feasible.We will mostly use the second characterization of feasibility, as our algorithms assign the jobs to later time points first.The intuition is that the total weight W i of jobs that are not processed at a time point t i gives a lower bound for their contribution to the objective function.Therefore it is better to approximate W i , rather than the weight of the jobs already processed, given by j∈J w j − W i .

A greedy 6-approximation for arbitrary q
The idea of our first algorithm is to have a balance between adding jobs that have small weights and jobs that have high resource requirements.More precisely, we will assign jobs to the time points going back in time.When we add a job to the set of jobs scheduled after a given time point, we will choose the most inefficient job, i.e. the job minimizing w j /a j among all jobs that have weight at most the weight W of all jobs that have already been chosen up to this point.If there is no job with weight at most W , then we simply choose a job with minimal weight.Intuitively, this rule guarantees that the jobs we choose are not too efficient but their total weight is not too large either.
Input: Jobs J with |J| = n, resource requirements a j , weights w j , resource arrival times t 1 ≤ . . .≤ t q and resource quantities b 1 , . . .b q .
Output: A feasible schedule π.
if there is an unassigned job j with w j ≤ W then 6: Let j be an unassigned job with w j ≤ W minimizing w j /a j .Let j be an unassigned job minimizing w j .
Proof.We claim that Algorithm 1 satisfies the requirements of the theorem.To prove this, we show that at the end of each iteration of the for loop, W is a 6-approximation for the problem of finding a minimum weight job set S consuming at least B i resources.Let opt be the optimum value of this problem.Since the B i 's are monotone decreasing and the algorithm does not consider the B i 's when picking the jobs, it is enough to show that the statement holds for the case q = 2, i = 0.
Consider the last iteration of the while loop when W < opt holds at the beginning of the loop.Since there exists a set of jobs of total weight opt, the value of W at the end of this iteration is bounded by 2 • opt.After this iteration, our algorithm will always pick jobs that are at least as inefficient as any of the jobs picked by the optimum solution.Consequently, the while loop will end at the latest when the weight of the jobs scheduled after this iteration is at least opt.Now consider the last iteration of the while loop.At the beginning of the iteration, we have A < B q−i and W is bounded by 3 • opt by the above.Since there exists a set of jobs of total weight opt, W is at most doubled during the iteration.This means that W is bounded by 6 • opt at the end of the while loop, as stated.
The running time follows by ordering the jobs according to their weight and by using AVL trees for picking j in the while loop.
The following example shows that the bound is tight.We have 5 jobs with weights w 1 = w 2 = 1 − 2ε, w 3 = 1 − ε, w 4 = 1 and w 5 = 3.The resource requirements are a 1 = a 2 = ε/5, a 3 = 1 − ε/2, a 4 = 1 and a 5 = 4.The resource arrival times are t 1 = 0 and t 2 = 1, with resource quantities b 1 = 5 − ε/10 and b 2 = 1.Here the optimum solution is to schedule the job with weight 1 to time point t 2 and all the remaining jobs to time point t 1 .However, our algorithm will schedule the job with weight 1 to time point t 1 and all the remaining jobs to t 2 .

A (4 + ε)-approximation for arbitrary q
Now we give a slightly better approximation for the problem.The algorithm is slightly more complicated than the one presented in Section 4.1, but the proof illustrates one of the important ideas of the general PTAS.Theorem 4.There exists a (4 + ε)-approximation for 1|rm = 1, p j = 0| C j w j with running time polynomial in 1/ε and the input length.
Proof.The idea of the algorithm is as follows.We may assume without loss of generality that resource arrival times are integer.First we shift all resource arrival times to powers of 2. For each time point t = t i in the shifted instance, we apply the FPTAS by Kis [12] to the instance which has only two resource arrival times t 1 and t, and the resource quantity for t is B i .Denote the set of jobs assigned to t this way by S i .Then, going back from the last time point t q to the first one t 1 , we assign all unassigned jobs from S i to t i , i.e. π(j) = max{i : j ∈ S i }.
Claim 12.A solution to I with weighted sum of completion times W can be transformed into a solution of I with weighted sum of completion times at most 2W .Furthermore, any feasible schedule for I also is a feasible schedule for I.
Proof.Let us define s i = min{t i : t i ≤ t i } for i = 1, . . ., q.Let π be the solution for I. Then assigning all jobs that are assigned to time point t i to s i gives us a feasible solution to I .By this change, the completion of any job is at most doubled (recall that each t i is assumed to be integer).
Since the available amount of resources at each time in I is at most as much as in I, a feasible schedule for I is also a feasible schedule for I.
Claim 13.There exists a polynomial time (2 + ε)-approximation algorithm for constant ε for all instances I where the resource arrival times are integer powers of 2.
Proof.We use the procedure that we described, i.e. we solve the instance for each of the time points using an α-approximation provided by [12], where α = 1 + ε.Let π opt be an optimum solution and let J opt k be the set of jobs j with π opt (j) = k.We have for i = 1, . . ., q.Then we get thus the approximation ratio follows.
The theorem follows from the two claims.

PTAS for constant q
The aim of this section is to give a PTAS for the case when the number of resource arrival times is a constant.The algorithm is a generalization of a well known PTAS for the knapsack problem, and will be used later as a subroutine in the PTAS for an arbitrary number of resource arrival times.The idea is to choose a number k ∈ Z + , guess the k heaviest jobs that are processed at each resource arrival time t i , and then determine the remaining jobs that are scheduled at t i in a greedy manner.Since we go over all possible sets containing at most k jobs for each resource arrival time, there is an exponential dependence on the number q of resource arrival times in the running time.
Proof.We claim that Algorithm 2 satisfies the requirements of the theorem.Let π opt be an optimal schedule and define denote the set of jobs assigned to time t i in our solution.In each iteration of the for loop of Step 4, let j i be the last job added to J i if such a job exists.
Assume that we are at the iteration of the algorithm when the subpartition Let W q− denote the value of W at the end of the iteration of the for loop corresponding to i = in Step 4. By Steps 3 and 9, we have As our algorithm always picks the most inefficient job, we also have where J i \ {j i } = J i if j i is not defined for i.
Algorithm 2 PTAS for 1|rm = 1, p j = 0| C j w j when q is a constant.
Input: Jobs J with |J| = n, resource requirements a j , weights w j , resource arrival times t 1 ≤ . . .≤ t q and resource quantities b 1 , . . .b q .
Output: A feasible schedule π.

4:
for i from 0 to q − 2 do 5: for j ∈ S q−i do 6: W ← max{W, min{w j : j ∈ S q−i }} 10: while A < B q−i do 11: if there exists an unassigned job j with w j ≤ W then 12: Let j be an unassigned job with w j ≤ W minimizing w j /a j .
18: Let π be the best schedule found.19: return π Combining these two observations, for = 1, . . ., q we get q i= j∈J i where the first inequality follows from the fact that w j i ≤ W i ≤ W whenever i ≥ .This proves that the schedule that we get is a (1 + q k )-approximation.We get a factor of n qk in the running time for guessing the sets S k .Assigning the remaining jobs can be done in linear time by ordering the jobs and using AVL-trees, thus we get an additional factor of n.In order to get a PTAS, we set k = ε q , concluding the proof of the theorem.

PTAS for arbitrary q
We turn to the proof of the main result of the paper.As in Section 4.2, we shift resource arrival times; here we use powers of 1 + ε, for a suitably small ε.
The proof of the following claim is the same as that of Claim 12.
Claim 14.A solution to I with weighted sum of completion times W can be transformed into a solution of I with weighted sum of completion times at most (1 + ε)W .Furthermore, any feasible schedule for I also is a feasible schedule for I.
Due to the claim, we may assume that the positive arrival times are powers of 1 + ε.For convenience of notation, in this section we will assume that the largest arrival time is 1, and arrival times are indexed in decreasing order, starting with t 0 = 1.That is, t i = (1 + ε) −i (i = 0, . . ., q − 2), and t q−1 = 0. We will also assume that for a given constant r, b q−r−1 = • • • = b q−2 = 0.This can be achieved by adding r dummy arrival times.Theorem 6.There exists a PTAS for 1|rm = 1, p j = 0| C j w j .
Proof.Let us fix an even integer r and ε > 0; we will later assume that r is very large compared to ε −1 .We assume that resource arrival times are as described above, and are indexed in decreasing order.
In the algorithm, we fix jobs at progressively decreasing arrival times, by using the PTAS of the previous section for r + 1 arrival times on different instances except for the first step, when we may use the PTAS for less than r + 1 arrival times.We will run our algorithm r/2 times with slight modifications, and pick the best result.Each run is characterized by a parameter ∈ {1, . . ., r/2}.
In the first step, we consider arrival times t 0 , t 1 , . . ., t r/2+ −1 , 0. We move the resources arriving before t r/2+ −1 to 0, and use the PTAS for r/2 + + 1 arrival times on this instance.We fix the jobs that are scheduled at arrival times t 0 , t 1 , . . ., t −1 .
Consider now the jth step for some j ≥ 2. Define s = (j −2)r/2+ and consider arrival times t s , t s+1 , . . ., t s+r−1 , 0. Move the resources arriving before t s+r−1 to 0, and decrease b s , b s+1 , . . . in this order as needed, so that the total requirement of unfixed jobs equals the total resource.Use the PTAS for r + 1 arrival times on this instance.Fix the jobs that are scheduled at arrival times t s , t s+1 , . . ., t s+r/2−1 .
The algorithm runs while s + r − 1 ≤ q − 2, i.e., jr/2 + ≤ q − 1.Since the smallest r arrival times (except for 0) are dummy arrival times, the algorithm considers all resource arrivals.
The schedule given by the algorithm is clearly feasible, because when jobs at t i are fixed, the total resource requirement of jobs starting no earlier than t i is at least the total amount of resource arriving no earlier than t i .To analyze the approximation ratio, we introduce the following notation: W i is the total weight that the algorithm schedules at t i ; W i is the weight that the algorithm temporarily schedules at t i when i is in the interval [t s+r/2 , t s+r−1 ] (or, in the first step, in the interval [t , t +r/2−1 ]); W * i is the total weight scheduled at t i in the optimal solution.
Since we use the PTAS for r/2 + + 1 arrival times in the first step, we have as the right-hand side is (1 + ε) times the objective value of the feasible solution obtained from the optimal solution by moving jobs arriving before t +r/2−1 to 0. For s = jr/2 + , we compare the output of the PTAS with a different feasible solution: we schedule total weight W i at t i for i = s, s + 1, . . ., s + r/2 − 1, total weight W * i at t i for i = s + r/2 + 1, . . ., s + r − 1, and at t s+r/2 we schedule all jobs that are no earlier than t s+r/2 in the optimal schedule but are no later than t s+r/2 in the PTAS schedule.We get the inequality The sum of these inequalities gives To bound the first term on the right hand side of (3), first we observe that because the left side is at most the value of the PTAS in the first step, while the right side is (1 + ε) times the value of a feasible solution.Similarly, because the left side is at most the value of the PTAS in the (j + 1)-th step, and the right side is (1 + ε) times the value of the following feasible solution: take the optimal solution, move jobs scheduled before t (j+2)r/2+ −1 to 0, and move jobs scheduled after t jr/2+ to t jr/2+ .Adding these inequalities, we get The last expression is at most 4ε times the optimum value if r is large enough.The last term of the right side of ( 3) is too large to get a bound that proves a PTAS.However, we can bound the average of these terms for different values of .The average is which is at most ε times the optimum if r is large enough.To summarize we obtained that for large enough r, the average objective value of our algorithm for = 1, 2, . . ., r/2 is upper bounded by 4ε q−2 i=0 (1 + ε) which is (1+6ε) times the objective value of the optimal solution.This proves that the algorithm that chooses the best of the r/2 runs is a PTAS.

Undetermined resource arrival times
A question one might ask is the following: Given α > 1 and an instance of 1|rm = 1, p j = 0| j C j w j , is there a schedule π such that the set S i = {j : π(j) ≥ i} is an α-approximation to the problem of finding a minimum weight job set S ⊆ J consuming at least B i resources for i = 1, . . ., q?The motivation is that such a solution would also give an α-approximation for the instance.The greedy algorithm of Section 4.1 shows that the answer to the question is yes if α ≥ 6.
Let us consider now a variant of the problem where the arriving resource quantities are given, but the resource arrival times are not known in advance.Then the smallest α for which the answer is 'YES' in the above problem is the best approximation ratio we can achieve.
have to schedule at least one job j 2 < j 1 at or after t j 1 −1 .This argument can be iterated to find a job j 3 < j 2 which is scheduled at or after t j 2 −1 , and so on.
Claim 16.For any β < 4, there exist n and m such that for the sequence j 1 , j 2 , . . .constructed as above, there is some i with Proof.Suppose to the contrary that there is no triple n, m, i satisfying the requirements of the claim.Then βw j i −1 ≥ i+1 k=1 w j k for all n, m, i.If m is large enough, then w j i and w j i −1 are very close to each other, i.e. if 1 m ≤ ε m for some ε m then w j i −1 ≤ w j i + ε m .Thus we get βw j i −1 ≤ βw j i + βε m .By increasing n, the length of our sequence increases as well.Indeed, by the indirect assumption, we have Since we also have w j 1 ≤ 4 and w j ≥ 1 for all jobs j, this implies that the number of elements in the sequence is at least log 5 n.Let us define z i = w j i and z i = i−1 k=1 z k .By the indirect assumption, β(z i + 1 m ) ≥ z i+1 + z i+1 , thus we have We omit the ε m for now to keep the reasoning simple.We claim that z i for some γ > 1 which only depends on β.We have (β − 1)z i − z i − z i+1 ≥ 0, and thus we get 3z i > z i assuming β < 4. Observe that z i z i is minimal if (β − 1)z i − z i = z i+1 .By transforming the equation Using (z i − z i ) 2 ≥ 0, (β − 2) < 2 and z i z i > 0 we get or equivalently Thus γ > 3 β−1 .It follows that there exists some N such that By Claim 16, there exists a time point t i with j:π(j)≥i w j > βB i .By setting t i = 0 (or very close to 0) for i < i and t i = 1 (or very close to 1) for i ≥ i, the schedule can only be a (β − ε)-approximation if we do not know the resource arrival times in advance.

Figure 1 :
Figure 1: The schedule corresponding to a feasible solution of 3-Partition.

Figure 2 :
Figure 2: Schedules opt and spt after the reductions.The 0 length jobs are scheduled in opt to the first resource arrival time when multiple resources arrive.

z
N > 3 and thus we getβz N < 4z N ≤ z N + z N ,contradicting the indirect assumption.