Optimal Algorithms for Scheduling under Time-of-Use Tariffs

We consider a natural generalization of classical scheduling problems in which using a time unit for processing a job causes some time-dependent cost which must be paid in addition to the standard scheduling cost. We study the scheduling objectives of minimizing the makespan and the sum of (weighted) completion times. It is not difficult to derive a polynomial-time algorithm for preemptive scheduling to minimize the makespan on unrelated machines. The problem of minimizing the total (weighted) completion time is considerably harder, even on a single machine. We present a polynomial-time algorithm that computes for any given sequence of jobs an optimal schedule, i.e., the optimal set of time-slots to be used for scheduling jobs according to the given sequence. This result is based on dynamic programming using a subtle analysis of the structure of optimal solutions and a potential function argument. With this algorithm, we solve the unweighted problem optimally in polynomial time. For the more general problem, in which jobs may have individual weights, we develop a polynomial-time approximation scheme (PTAS) based on a dual scheduling approach introduced for scheduling on a machine of varying speed. As the weighted problem is strongly NP-hard, our PTAS is the best possible approximation we can hope for.


Introduction
One of the classical operations research problems is the Production Planning problem. It appears in almost any introductory course in Operations Research [11,19]. In its deterministic form a production plan at lowest total cost is required to meet known demands in the next few weeks, given holding cost for keeping inventory at the end of the week, and with unit production cost varying over the weeks. It is a very early example of a problem model in which unit cost, or tariffs, for production, service, labor, energy, etc., vary over time.
Nowadays, new technologies allow direct communication of a much larger variety of time-ofuse tariffs to customers. E.g. in energy practice electricity prices can differ largely over the hours. Producers or providers of these resources use these variable pricing more and more to spread demand for their services, which can save enormously on the excessive costs that are usually involved to serve high peak demands. Customers are persuaded to direct their use of the scarce resources to time slots that are offered at cheaper rates. From the provider's point of view variable pricing problems have been studied quite extensively. For instance, revenue management is a well established subfield of operations research [20].
As in the Production Planning problem, in this paper we advocate models from the point of view of the user of the resources, who may take advantage from variable pricing by traveling, renting labor, using electricity, etc. at moments at which these services are offered at a lower price. This point of view forms a rich class of optimization problems in which next to classical objectives, the cost of using services needs to be taken into account.
This widely applicable framework is particularly well suited for scheduling problems, in which jobs need to be scheduled over time. Processing jobs requires labor, energy, computer power, or other resources that often exhibit variable tariffs over time. It leads to the natural generalization of scheduling problems, in which using a time slot incurs certain cost, varying over time, which we refer to as utilization cost that must be paid in addition to the actual scheduling cost. However natural and practicable this may seem, there appears to be very little theoretical research on such scheduling models. The only work we are aware of is by Wan and Qi [21], Kulkarni and Munagala [14], Fang et al. [9] and Chen and Zhang [3], where variable tariffs concern the cost of labor or the cost of energy.
The goal of this paper is to expedite the theoretical understanding of fundamental scheduling problems within the framework of time-varying costs or tariffs. We contribute optimal polynomialtime algorithms and best possible approximation algorithms for the fundamental scheduling objectives of minimizing the sum of weighted completion times and the makespan.

Problem definition
We first describe the underlying classical scheduling problems. We are given a set of jobs J := {1, . . . , n} where every job j ∈ J has a given processing time p j ∈ N and possibly a weight w j ∈ Q ≥0 . The objective is to find a preemptive schedule on a single machine such that the total (weighted) completion time, j∈J w j C j , is minimized; here C j denotes the completion time of job j. Preemption means that the processing of a job may be interrupted at any time and can continue at any time later at no additional cost. In the three-field scheduling notation [10], this problem is denoted as 1 | pmtn | w j C j . We also consider makespan minimization on unrelated machines, R | pmtn | C max , where we are given a set of machines M , and each job j ∈ J has an individual processing time p ij ∈ N for running on machine i ∈ M . The objective is to find a preemptive schedule that minimizes the makespan, that is, the completion time of the latest job.
In this paper, we consider a generalization of these scheduling problems within a time-of-use tariff model. We assume that time is discretized into unit-size time slots. We are given a tariff or cost function e : N → Q ≥0 , where e(t) denotes the tariff for processing job(s) at time slot [t, t + 1). We assume that e is piecewise constant. I.e., we assume that the time horizon is partitioned into given intervals I k = [s k , d k ) with s k , d k ∈ N, k = 1, . . . , K, within which e has the same value e k . To ensure feasibility, we assume that d K ≥ j∈J min i∈M p ij .
Given a schedule S, let y(t) be a binary variable indicating if any processing is assigned to time slot [t, t + 1). The utilization cost of S is E(S) = t e(t)y(t). That means, for any time unit that is used in S we pay the full tariff, even if the unit is only partially used. We also emphasize that in the makespan problem in which we have multiple machines, a time slot paid for can be used by all machines. This models applications in which paying for a time unit on a resource gives access to all units of the resource, e.g., all processors on a server.
The overall objective is to find a schedule that minimizes the scheduling objective, j∈J w j C j resp. C max , plus the utilization cost E. We refer to the resulting problems as 1 | pmtn | w j C j + E and R | pmtn | C max + E. We emphasize that the results in this paper also hold if we minimize any convex combination of the scheduling and utilization cost.

Related work
Scheduling with time-of-use tariffs (aka variable time slot cost) has been studied explicitly by Wan and Qi [21], Kulkarni and Munagala [14], Fang et al. [9] and Chen and Zhang [3]. In their seminal paper, Wan and Qi [21] consider several non-preemptive single machine problems, which are polynomial-time solvable in the classical setting, such as minimizing the total completion time, lateness, and total tardiness, or maximizing the weighted number of on-time jobs. These problems are shown to be strongly NP-hard when taking general tariffs into account, while efficient algorithms exist for special monotone tariff functions. In particular, the problem 1 | | C j + E is strongly NP-hard, and it is efficiently solvable when the tariff function is increasing or convex non-increasing [21]. Practical applications, however, often require non-monotone tariff functions, which lead to wide open problems in the context of preemptive and non-preemptive scheduling. In this paper, we answer complexity and approximability questions for fundamental preemptive scheduling problems.
Kulkarni and Munagala [14] focus on a relevant but different problem in an online setting, namely online flow-time minimization using resource augmentation. Their main result is a scalable algorithm that obtains a constant performance guarantee when the machine speed is increased by a constant factor and there are only two distinct unit tariffs. They also show that, in this online setting, for an arbitrary number of distinct unit tariffs there is no constant speedup-factor that allows for a constant approximate solution. For the problem considered in this paper, offline scheduling without release dates, Kulkarni and Munagala [14] observed a relation to universal sequencing on a machine of varying speed [8] which implies the following results: a pseudo-polynomial 4approximation for 1 | pmtn | w j C j + E, which gives an optimal solution in case that all weights are equal, and a constant approximation in quasi-polynomial time for a constant number of distinct tariffs or when using a machine that is processing jobs faster by a constant factor.
Fang et al. [9] study scheduling on a single machine under time-of-use electricity tariffs. They do not take the scheduling cost into account, but only the energy cost. It also differs from our approach since the schedule is made by the provider and not by the user of the energy. In their model the time horizon is divided into K regions, each of which has a cost c k per unit energy. For processing jobs the dynamic variable speed model is used; that is, the energy consumption is s α per unit time if jobs are run at speed s, whence, within region k, the energy cost is s α c k . The objective is to minimize energy cost such that all jobs are scheduled within the K regions. They prove that the non-preemptive case is NP-hard and give a non-constant approximation, and for the preemptive case, they give a polynomial-time algorithm.
Chen and Zhang [3] consider non-preemptive scheduling on a single machine so as to minimize the total utilization cost under certain scheduling feasibility constraints such as a common deadline for all jobs or a bound on the maximum lateness, maximum tardiness, maximum flow-time, or sum of completion times. They define a valley to be a cost interval I k that has smaller cost than its neighboring intervals and show the following. General tariffs lead to a strongly NP-hard problem for any of the just mentioned constraints, and even very restricted tariff functions with more than one valley result in NP-hard problems that are not approximable within any constant factor. The problem with a common deadline on the job completion times is shown to admit a pseudo-polynomial time algorithm when having two valleys, a polynomial time algorithm for tariff functions with at most one valley, and an FPTAS if there are at most two valleys and max k e k / min k e k is bounded. For the other mentioned constraints, they also present polynomial time algorithms when having no more than one valley, where the problem with a bound on the sum of completion times requires the number of cost intervals, here K, to be fixed.
The general concept of taking into consideration additional (time-dependent) cost for resource utilization when scheduling has been implemented differently in other models. We mention the area of energy-aware scheduling, where energy consumption is taken into account (see [1] for an overview). Further, the area of scheduling with generalized non-decreasing (completion-) time dependent cost functions, such as minimizing j w j f (C j ), e.g. [8,12,17], or even more general job-individual cost functions j f j (C j ), e.g. [2,5,6,13] has received quite some attention. Our model differs fundamentally from those models since our cost function may decrease with time. In fact, delaying the processing in favor of cheaper time slots may decrease the overall cost. This is not the case in the above-mentioned models. Thus, in our framework we have the additional dimension in decision-making of selecting the time slots that shall be utilized.
Finally, we point out some similarity between our model and scheduling on a machine of varying speed, which (with j w j C j as objective function) is an equivalent statement of the problem of minimizing j w j f (C j ) on a single machine with constant speed [8,12,17]. We do not see any mathematical reduction from one problem to the other. However, it is noteworthy that the independently studied problem of scheduling with non-availability periods, see e.g. the survey by Lee [16], is a special case of both the varying-speed and the time-varying tariff model. Indeed, machine non/availability can be expressed either by 0/1-speed or equivalently by ∞/0 tariff. Results shown in this context imply that our problem 1 | pmtn | w j C j + E is strongly NP-hard, even if there are only two distinct tariffs [22].

Our contribution
We present new optimal algorithms and best-possible approximation results, unless P=NP, for the generalization of basic scheduling problems to a framework with time-varying tariffs.
One of our results is a rather straightforward optimal polynomial-time algorithm for the problem R | pmtn | C max + E (Section 4): We design a procedure that selects the optimal time slots to be utilized, given that we know their optimal number. That number can be determined by solving the scheduling problem without utilization cost, which can be done in polynomial time by solving a linear program [15].
Whereas minimizing makespan plus utilization cost appears to be efficiently solvable even in the most general machine model, the objective of minimizing the total weighted completion time raises significant complications. Our results on this objective concern single-machine problems (Section 2). We present an algorithm that computes for a given ordered set of jobs an optimal choice of time slots to be used. We derive this by first showing structural properties of an optimal schedule, which we then exploit together with a properly chosen potential function in a dynamic program yielding polynomial running time. Based on this algorithm, we show that the unweighted problem 1 | pmtn | C j +E can be solved in polynomial time and that it allows almost directly for a fully polynomial (4+ε)-approximation algorithm for the weighted version 1 | pmtn | w j C j +E, for which a pseudo-polynomial 4-approximation was observed by Kulkarni and Munagala [14]. While pseudo-polynomial time algorithms are relatively easy to derive, it is quite remarkable that our DP's running time is polynomial in the input, in particular, independent of d K .
In Section 3, we significantly improve the approximation result for the weighted problem by designing a polynomial-time algorithm that computes for any fixed ε a (1+ε)-approximate schedule for 1 | pmtn | w j C j +E, that is, we give a polynomial-time approximation scheme (PTAS). Unless P=NP, our algorithm is best possible, since the problem is strongly NP-hard even if there are only two different tariffs [22].
Our approach is inspired by a recent PTAS for scheduling on a machine of varying speed [17] and it uses some of its properties. As discussed before, we do not see a formal mathematical relation between these two seemingly related problems which allows to apply the result from [17] directly.
The key is a dual view on scheduling: instead of directly constructing a schedule in the timedimension, we first construct a dual scheduling solution in the weight-dimension which has a oneto-one correspondence to a true schedule. We design an exponential-time dynamic programming algorithm which can be trimmed to polynomial time using techniques known for scheduling with varying speed [17].
For both the makespan and the min-sum problem, job preemption is crucial for obtaining constant worst-case performance ratios. For non-preemptive scheduling, a straightforward reduction from 2-Partition shows that no approximation is possible, unless P=NP, even if there are only two different tariffs, 0 and ∞.
Finally, we remark that in general it is not clear that a schedule can be encoded polynomially in the input. However, for our completion-time based minimization objectives, it is easy to observe that if an algorithm utilizes p unit-size time slots in an interval of equal cost, then it utilizes the first p slots within this interval, which simplifies the structure and the output of an optimal solution in a crucial way.
We start below with presenting the more involved results for the problems with scheduling objective minimizing total (weighted) completion time. The efficient algorithm for the makespan objective is then presented in Section 4.

An optimal algorithm for minimizing total completion time
In this section, we show how to solve the unweighted problem 1 | pmtn | C j + E to optimality. Our main result is as follows.
An algorithm for the scheduling problem with time-of-use tariffs has to make essentially two types of decisions: (i) which time slots to use and (ii) how to schedule the jobs in these slots. It is not hard to see that these two decisions can be handled separately. In fact, the following observation on the optimal sequencing of jobs holds independently of the utilization decision and follows from a standard interchange argument.
Observation 1 In an optimal schedule S * for the problem 1 | pmtn | C j + E, jobs are processed according to the Shortest Processing Time First (SPT) rule.
Thus, in the remainder of the section we can focus on determining which time slots to use. We design an algorithm that computes, for any given (not necessarily optimal) scheduling sequence σ, an optimal utilization decision for σ. In fact, we show our structural result even for the more general problem in which jobs have arbitrary weights.
Theorem 2. Given an instance of 1 | pmtn | w j C j + E and an arbitrary processing sequence of jobs σ, we can compute an optimal utilization decision for σ in polynomial time.
Combining the optimal choice of time slots (Theorem 2) with the optimal processing order SPT (Observation 1) immediately implies Theorem 1.
The remainder of the section is devoted to proving Theorem 2. Thus, we choose any (not necessarily optimal) order of jobs, σ = (1, . . . , n), in which the jobs must be processed. We want to characterize an optimal schedule S * for σ, that is, the optimal choice of time slots for scheduling σ. We firstly identify structural properties of an optimal solution. Essentially, we give a full characterization which we can compute efficiently by dynamic programming.
More precisely, we establish a closed form that characterizes the relationship between the tariff of an utilized slot and job weights in an optimal solution. This relationship allows to decompose an optimal schedule into a series of sub-schedules. Our algorithm will first compute all possible sub-schedules and then use a dynamic programming approach to select and concatenate suitable sub-schedules.
In principle, an optimal schedule may preempt jobs at fractional time points. However, since time slots can only be paid for entirely, any reasonable schedule uses the utilized slots entirely as long as there are unprocessed jobs. It can be shown by a standard interchange argument that this is also true if we omit the requirement that time slots must be utilized entirely; for details, see [18]. (We remark that for the makespan problem with multiple machines considered in Section 4 this is not true.) Lemma 1. Allowing to pay for utilizing partial time slots, there is an optimal schedule S * for 1 | pmtn | w j C j + E in which all utilized time slots are entirely utilized and jobs are preempted only at integral points in time.
Next, we split the optimal schedule S * for the given job sequence σ = (1, . . . , n) into smaller sub-schedules. To that end we introduce the concept of a split point.

Definition 1 (Split Point).
Consider an optimal schedule S * and the set of potential split points P := K k=1 {s k , s k + 1} ∪ {d K }. Let S j and C j denote the start time and completion time of job j, respectively. We call a time point t ∈ P a split point for S * if all jobs that start before t also finish their processing not later than t, i.e., if {j ∈ J : S j < t} = {j ∈ J : C j ≤ t}.
Given an optimal schedule S * , let 0 = τ 1 < τ 2 < · · · < τ ℓ = d K be the maximal sequence of split points of S * , i.e. the sequence containing all split points of S * . We denote the interval between two consecutive split points τ x and τ x+1 as region R S * x := [τ x , τ x+1 ), for x = 1, . . . , ℓ − 1. Consider now any region R S * x for an optimal schedule S * with x ∈ {1, . . . , ℓ − 1} and let , the jobs that start and finish within R S * x . Note that J S * x might be empty. Among all optimal schedules we shall consider an optimal solution S * that minimizes the value We observe that any job j completing at the beginning of a cost interval I k , i.e. C j = s k ∈ R S * x or C j = s k + 1 ∈ R S * x , would make s k resp. s k + 1 a split point. Thus, no such job can exist. Observation 2 There is no job j ∈ J S * x with C j ∈ R S * x ∩ P. We say that interval I k is partially utilized if at least one time slot in I k is utilized, but not all.

Lemma 2.
There exists an optimal schedule S * in which for all x = 1, . . . , ℓ − 1 at most one interval is partially utilized in R S * x . Proof. By contradiction, suppose that there is more than one partially utilized interval in R S * x . Consider any two such intervals I h and I h ′ with h < h ′ , and all intermediate intervals utilized I k because all jobs in J ′ are delayed by exactly one time unit. This is true since by Observation 2 no job finishes at d k = s k+1 for any k.
again using Observation 2 to assert that no job finishes at s k + 1 for any h + 1 ≤ k ≤ h ′ . Since δ 1 = −δ 2 and S * is an optimal schedule, it must hold that δ 1 = δ 2 = 0. This, however, implies that there is another optimal schedule with earlier used time slots which contradicts our assumption that S * minimizes the value dK −1 t=0 t · y(t).

⊓ ⊔
The next Lemma characterizes the time slots that are used within a region. Let e j max be the maximum tariff spent for job j in S * . Furthermore, let ∆ x := max j∈J S * x (e j max + j ′ <j w j ′ ) and let j x be the last job (according to sequence σ) that achieves ∆ x . Suppose, there are b ≥ 0 jobs before and a ≥ 0 jobs after job j x in J S * x . The following lemma gives for every job j ∈ J S * x \ {j x } an upper bound on the tariff spent in the interval [S j , C j ).
Lemma 3. Consider an optimal schedule S * for a given job permutation σ. For any job j ∈ is utilized if and only if the tariff e(t) of [t, t + 1) satisfies the following upper bound: Proof. Consider any job j : , then the difference in cost is non-positive, because the completion times of at least ℓ jobs (j = j x − ℓ, . . . , j x − 1 and maybe also j x ) decrease by one. This contradicts either the optimality of S * or our assumption that S * minimizes dK −1 t=0 t · y(t). The proof of the statement for any job j x + ℓ with 0 < ℓ ≤ a follows a similar argument, but now using the fact that for every job j : for processing a job j ∈ J S * x \ {j x } intersects interval I k but job j does not complete in I k , i.e., C j > d k , then all time slots in I k are fully utilized.
To decide on an optimal utilization decision for the sub-schedule of the jobs in R S * x , we need the following two lemmas.
x , or (ii) j x is the last job being processed in I k and e k = e jx max .
Proof. Suppose there exists a partially utilized interval I k in region R S * x . Suppose j with j = j x is the last job that is processed in I k , hence (ii) does not hold. Then either C j < d k , in which case d k = s k+1 is a split point and thus I k is the last interval in the region, whence (i) is true. Or, we are in the situation of Corollary 1 and have a contradiction, because then I k must be fully utilized. Now suppose j x is the last job being processed in I k . If C jx < d k , then again I k is the last interval in the region. Otherwise C jx / ∈ I k . If e k = e jx max , then case (ii) of the lemma holds. If not, by definition of e jx max we have e k < e jx max . By optimality of S * , interval I k comes after the last utilized "expensive" interval with cost e jx max . Hence, job j x is processed in an expensive interval, then in I k and is completed in yet another interval. But then we can utilize an extra time slot in I k instead of a time slot in the expensive interval, without increasing the completion time. This contradicts optimality, and, hence, e k = e jx max , which completes the proof. ⊓ ⊔ Lemma 5. There exists an optimal schedule S * for a given job permutation σ with the following property. If the last interval I k of a region R S * x is only partially utilized then all time slots in [S jx , C jx ) with cost at most e jx max are utilized.
Proof. Recall that j x + a is the last job being processed in the region, and hence, it is the last job processed in the partially utilized interval I k .
Suppose there is a time slot [t, t + 1) ∈ [S jx , C jx ) with cost at most e jx max that is not utilized. If we utilize [t, t + 1) instead of the last utilized slot in I k , then the difference in cost is δ 1 := e(t) − e k − jx+a j=jx w j . On the other hand, if we utilize one additional time slot in I k instead of a time slot in [S jx , C jx ) with cost e jx max , then the difference in cost is δ 2 := e k − e jx max + jx+a j=jx w j . We consider an optimal schedule S * , thus δ 1 ≥ 0 and δ 2 ≥ 0 which implies that δ 1 +δ 2 = e(t)−e jx max ≥ 0. This is a contradiction if e(t) < e jx max . If e(t) = e jx max , then δ 1 = −δ 2 = 0, because we consider an optimal schedule S * . This, however, contradicts our assumption that S * minimizes the value dK−1 t=0 t · y(t).
⊓ ⊔ We now show how to construct an optimal partial schedule for a given ordered job set in a given region in polynomial time.
Lemma 6. Given a region R x and an ordered job set J x , we can find in polynomial time an optimal utilization decision for scheduling J x within the region R x , which does not contain any other split points than τ x and τ x+1 , the boundaries of R x .
Proof. Given R x and J x , we guess the optimal combination j x , e jx max , i.e., we enumerate over all nK combinations and choose eventually the best solution.
We firstly assume that a partially utilized interval exists and it is the last one in R x (case (i) in Lemma 4). Based on the characterization in Lemma 3 we find in polynomial time the slots to be utilized for the jobs j x − b, . . . , j x − 1. This defines C jx−b , . . . , C jx−1 . Then starting job j x at time C jx−1 , we check intervals in the order given and utilize as much as needed of each next interval I h if and only if e h ≤ e jx max , until a total of p jx time slots have been utilized for processing j x . Lemma 5 justifies to do that. This yields a completion time C jx . Starting at C jx , we use again Lemma 3 to find in polynomial time the slots to be utilized for processing the jobs j x +1, . . . , j x +a. This gives C jx+1 , . . . , C jx+a . Now we assume that there is no partially utilized interval or we are in case (ii) of Lemma 4. Similar to the case above, we find in polynomial time the slots that S * utilizes for the jobs j x − b, . . . , j x − 1 based on Lemma 3. This defines C jx−b , . . . , C jx−1 . To find the slots to be utilized for the jobs j x + 1, . . . , j x + a, in this case, we start at the end of R x and go backwards in time. We can start at the end of R x because in this case the last interval of R x is fully utilized. This gives C jx+1 , . . . , C jx+a . Job j x is thus to be scheduled in [C jx−1 , S jx+1 ). In order to find the right slots for j x we solve a makespan problem in the interval [C jx−1 , S jx+1 ), which can be done in polynomial time (Theorem 4) and gives a solution that cannot be worse than what an optimal schedule S * does.
If anywhere in both cases the utilized intervals can not be made sufficient for processing the job(s) for which they are intended, or if scheduling the jobs in the utilized intervals creates any intermediate split point, then this j x , e jx max -combination is rejected. Hence, we have computed the optimal schedules over all nK combinations of j x , e jx max and over both cases of Lemma 4 concerning the position of the partially utilized interval. We choose the schedule with minimum total cost and return it with its value. This completes the proof.
⊓ ⊔ Now we are ready to prove our main theorem.
Proof (Proof of Theorem 2). We give a dynamic program. Assume jobs are indexed according to the order given by σ. We define a state (j, t), where t is a potential split point t ∈ P and j is a job from the job set J, and a dummy job 0. The value of a state, Z(j, t), is the optimal scheduling cost plus utilization cost for completing jobs 1, . . . , j by time t. We apply the following recursion: where z j ′ + 1, . . . , j , [t ′ , t) denotes the value of an optimal partial schedule for job set {j ′ + 1, j ′ + 2, . . . , j in the region [t ′ , t), or ∞ if no such schedule exists. In case j = j ′ there is no job to be scheduled in the interval [t ′ , t), whence we set z j ′ + 1, . . . , j , [t ′ , t) = 0. This models the option of leaving regions empty. An optimal partial schedule can be computed in polynomial time as we have shown in Lemma 6. Hence, we compute Z(j, t) for all O(nK) states in polynomial time, which concludes the proof. ⊓ ⊔ Remark: A simple (4 + ǫ)-approximation for the weighted problem. It is worth mentioning that the characterization of an optimal utilization decision above (Theorem 2) can be used to obtain a simple (4 + ε)-approximation for the weighted problem 1 | pmtn | w j C j + E. For the weighted problem, there may not exist a job sequence that is universally optimal for all utilization decisions [8]. However, in the context of scheduling on an unreliable machine there has been shown a polynomial-time algorithm that computes a universal (4 + ε)-approximation [8]. More precisely, the algorithm constructs a sequence of jobs which approximates the scheduling cost for any utilization decision within a factor at most 4 + ε.
Consider an instance of problem 1 | pmtn | w j C j + E and compute such a universally (4 + ε)approximate sequence σ. Applying Theorem 2 to σ, we obtain a schedule S with an optimal utilization decision for σ. Let S ′ denote the schedule which we obtain by changing the utilization decision of S to the utilization in an optimal schedule S * (but keeping the scheduling sequence σ). The schedule S ′ has cost no less than the original cost of S. Furthermore, given the utilization decision in the optimal solution S * , the sequence σ approximates the scheduling cost of S * within a factor of 4 + ε. This gives the following result.
This result is superseded by the PTAS presented in the next section.

A PTAS for minimizing the total weighted completion time
The main result of this section is a polynomial time approximation scheme for minimizing the total weighted completion time with time-varying utilization cost.
Theorem 3. There is a polynomial-time approximation scheme for 1 | pmtn | w j C j + E.
In the remainder of this section we describe some preliminaries, present a dynamic programming (DP) algorithm with exponential running time, and then we argue that the running time can be reduced to polynomial time. As noted in the introduction, our approach is inspired by a PTAS for scheduling on a machine of varying speed [17], but a direct application does not seem possible.

Preliminaries and scheduling in the weight-dimension
We describe a schedule S not in terms of completion times C j (S), but in terms of the remaining weight function W S (t) which, for a given schedule S, is defined as the total weight of all jobs not completed by time t. Notice that, by definition, W S (t) is right-continuous. Based on the remaining weight function we can express the cost for any schedule S as This has a natural interpretation in the standard 2D-Gantt chart, which was originally introduced in [7].
For a given utilization decision, we follow the idea of [17] and implicitly describe the completion time of a job j by the value of the function W S at the time that j completes. This value is referred to as the starting weight S w j of job j. In analogy to the time-dimension, the value C w j := S w j + w j is called completion weight of job j. When we specify a schedule in terms of the remaining weight function, then we call it a weight-schedule, otherwise a time-schedule. Other terminologies, such as feasibility and idle time, also translate from the time-dimension to the weight-dimension. A weightschedule is called feasible if no two jobs overlap and the machine is called idle in weight-dimension if there exists a point w in the weight-dimension with w / ∈ S w j , C w j for all jobs j ∈ J. A weight-schedule together with a utilization decision can be translated into a time-schedule by ordering the job in decreasing order of completion weights and scheduling them in this order in the time-dimension in the utilized time slots. For a given utilization decision, consider a weight-schedule S with completion weights C w 1 > · · · > C w n > C w n+1 := 0 and the corresponding completion times 0 =: C 0 < C 1 < · · · < C n for the jobs j = 1, . . . , n. We define the (scheduling) cost of a weight-schedule S as n j=1 C w j − C w j+1 C j . This value equals n j=1 π S j C w j , where π S j := C j − S j , if and only if there is no idle weight. If there is idle weight, then the cost of a weight-schedule can only be greater, and we can safely remove idle weight without increasing the scheduling cost [17]. Figure 1 illustrates this fact.
Summarizing, a time-schedule implies a correspondent weight-schedule of the same cost. On the other hand, a weight-schedule plus a utilization decision implies a time-schedule with a possibly smaller cost.

Dynamic programming algorithm
Let ε > 0. Firstly, we scale the input parameters so that all job weights w j , j = 1, . . . , n, and all tariffs e k , k = 1, . . . , K, are non-negative integers. Then, we apply standard geometric rounding to the weights to gain more structure on the input, i.e, we round the weights of all jobs up to the next integer power of (1 + ε), by losing at most a factor (1 + ε) in the objective value. Furthermore, we discretize the weight-space into intervals of exponentially increasing size: we define intervals WI u := [(1 + ε) u−1 , (1 + ε) u ) for u = 1, . . . , ν with ν := ⌈log 1+ε j∈J w j ⌉. Consider a subset of jobs J ′ ⊆ J and a partial weight-schedule of J ′ . In the dynamic program, the set J ′ represents the set of jobs at the beginning of a corresponding weight-schedule, i.e., if j ∈ J ′ and k ∈ J \ J ′ , then C w j < C w k . However, the jobs in J ′ are scheduled at the end in a corresponding time-schedule. As discussed in Section 3.1, a partial weight-schedule S for the jobs in J \ J ′ together with a utilization decision for these jobs can be translated into a time-schedule. Let The set F u contains all the possible job sets J u that can be scheduled in WI u or before. Additionally, we define F 0 to be the set that contains only the set of all zero-weight jobs J 0 := {j ∈ J : w j = 0}. The following observation allows us to restrict to simplified completion weights.
Observation 3 Consider an optimal weight-schedule in which the set of jobs with completion weight in WI u , u ∈ {1, . . . , ν}, is exactly J u \ J u−1 for some J u ∈ F u and J u−1 ∈ F u−1 . By losing at most a factor (1 + ε) in the objective value, we can assume that for all u ∈ {1, . . . , ν} the completion weight of the jobs in J u \ J u−1 is exactly (1 + ε) u .

The following observation follows from a simple interchange argument.
Observation 4 There is an optimal time-schedule in which J 0 is scheduled completely after all jobs in J \ J 0 .
The dynamic program recursively constructs states Z = [J u , b, avg] and computes for every state a time point t(Z) with the following meaning. A state Z = [J u , b, avg] with time point t(Z) expresses that there is a feasible partial time-schedule S for the jobs in J \ J u with J u ∈ F u together with a utilization decision for the time interval [0, t(Z)) with total utilization cost at most b and for which the average scheduling cost, i.e., is at most avg. We remark that even if S only schedules jobs in J \J u , the remaining weight function W S still considers jobs in J \ J u , and thus W S (t(Z)) = j∈J\Ju w j . Also, S implies a weightschedule for jobs in J \ J u where the completion weights belong to [ j∈Ju w j , j∈J w j ]. Note that avg · t(Z) is an upper bound on the total scheduling cost of S and that the average scheduling cost is non-increasing in time, because the remaining weight function W S (t) is non-increasing in time.
In the iteration for u, we only consider states [J u , b, avg] with J u ∈ F u . The states in the iteration for u are created based on the states from the iteration for u + 1. Initially, we only have the state Z ν = [J, 0, 0] with t(Z ν ) := 0, we start the dynamic program with u = ν − 1, iteratively reduce u by one, and stop the process after the iteration for u = 0. In the iteration for u, the states together with their time points are constructed in the following way. Consider candidate sets J u+1 ∈ F u+1 and J u ∈ F u with F u ⊆ F u+1 , a partial time-schedule S of J \ J u , in which the set of jobs with completion weight (in the correspondent weight-schedule) in WI u+1 is exactly J u+1 \ J u and the set of jobs later than WI u+1 is exactly J \ J u+1 , two budgets b 1 , b 2 with b 1 ≤ b 2 , and two bounds on the average scheduling cost avg 1 , avg 2 . Let Z 1 = [J u+1 , b 1 , avg 1 ] and Z 2 = [J u , b 2 , avg 2 ] be the corresponding states. We know that there is a feasible partial schedule for the job set J \ J u+1 up to time t(Z 1 ) having average scheduling cost at most avg 1 and utilization cost at most b 1 . By augmenting this schedule, we want to compute a minimum time point t(Z 1 , Z 2 ) that we associate with the link between Z 1 and Z 2 so that there is a feasible partial schedule for J \J u that processes the jobs from J u+1 \ J u in the interval [t(Z 1 ), t(Z 1 , Z 2 )), has average scheduling cost at most avg 2 , and utilization cost at most b 2 . That is, t(Z 1 , Z 2 ) is the minimum makespan if we start with Z 1 and want to arrive at Z 2 . For the computation of t(Z 1 , Z 2 ), we use the following subroutine. Using Observation 3, we approximate the area under the remaining weight function W S (t) for the jobs in J u+1 \ J u by (1 + ε) u+1 · (t(Z 1 , Z 2 ) − t(Z 1 )), where t(Z 1 , Z 2 ) is the time point that we want to compute. Approximating this area gives us the flexibility to schedule the jobs in J u+1 \ J u in any order. However, we need that avg 2 · t(Z 1 , Z 2 ) is an upper bound on the integral of the remaining weight function by time t(Z 1 , Z 2 ). That is, we want that Both the left-hand side and the right-hand side of this inequality are linear functions in t(Z 1 , Z 2 ). So, we can compute a smallest time point t LB such that the right-hand side is greater or equal to the left-hand side for all t(Z 1 , Z 2 ) ≥ t LB . If there is no such t LB , then we set t(Z 1 , Z 2 ) to infinity and stop the subroutine. Otherwise, we know that our average scheduling cost at t LB or later is at most avg 2 . Let E(p, [t 1 , t 2 )) denote the total cost of the p cheapest slots in the time-interval [t 1 , t 2 ). We compute the smallest time point t(Z 1 , Z 2 ) ≥ t LB so that the set of jobs J u+1 \J u can be feasibly scheduled in [t(Z 1 ), t(Z 1 , Z 2 )) having utilization cost not more than b 2 − b 1 . That is, we set The time point t(Z 1 , Z 2 ) can be computed in polynomial time by applying binary search to the interval [max{t(Z 1 ), t LB }, d K ), since E(p, [t 1 , t 2 )) is a monotone function in t 2 .
Given all possible states [J u+1 , b 1 , avg 1 ] from the iteration for u + 1, the dynamic program enumerates for all these states all possible links to states [J u , b 2 , avg 2 ] from the iteration for u fulfilling the above requirement on the candidate sets J u+1 and J u , on the budgets b 1 and b 2 , and on the average scheduling costs avg 1 and avg 2 . For any such possible link (Z 1 , Z 2 ) between states from the iteration for u + 1 and u, we apply the above subroutine and associate the time point t(Z 1 , Z 2 ) with this link. Thus, the dynamic program associates several possible time points with a state Z 2 = [J u , b 2 , avg 2 ] from the iteration for u. However, we only keep the link with the smallest associated time point t(Z 1 , Z 2 ) (ties are broken arbitrarily) and this defines the time point t(Z 2 ) that we associate with the state Z 2 . That is, for a state Z 2 from the iteration for u we define t(Z 2 ) := min{t(Z 1 , Z 2 ) | Z 1 is a state from the iteration for u + 1}.
Let E max be an upper bound on the total utilization cost in an optimal solution, e.g., the total cost of the first p(J) finite-cost time slots. The dynamic program does not enumerate all possible budgets but only a polynomial number of them, namely budgets with integer powers of (1 + η 1 ) with η 1 > 0 determined later. That is, for the budget on the utilization cost, the dynamic program enumerates all values in The value η 1 will be chosen so that (1 + η 1 ) ω1 ≤ (1 + ε) and ω 1 is polynomial (see proof of Lemma 7 for the exact definition). Similarly, we observe that (1 + ε) ν is an upper bound on the average scheduling cost. The dynamic program does also only enumerate a polynomial number of possible average scheduling costs, namely integer powers of (1 + η 2 ) with η 2 > 0 also determined later. This means, for the average scheduling cost, the dynamic program enumerates all values in AV G := {0, 1, (1 + η 2 ), (1 + η 2 ) 2 , . . . , (1 + η 2 ) ω2 } with ω 2 = ⌈ν log 1+η2 (1 + ε)⌉.
As before, the value η 2 will be chosen so that (1 + η 2 ) ω2 ≤ (1 + ε) and ω 2 is polynomial. The dynamic program stops after the iteration for u = 0. Now, only the set of zero-weight jobs is not scheduled yet. For any state Z = [J 0 , b, avg] constructed in the iteration for u = 0, we append the zero-weight jobs starting at time t(Z) and utilizing the cheapest slots, which is justified by Observation 4. We add the additional utilization cost to b. After this, we return the state Z = [J 0 , b, avg] and its corresponding schedule, which can be computed by backtracking and following the established links, with minimum total cost b + avg · t(Z). With this, we obtain the following result.
Proof. Consider an arbitrary iteration u of the dynamic program and let i = ν − u. We consider states Z = [J u , b, avg] with J u ∈ F u , b ∈ B, and avg ∈ AV G for which we construct the time points with J * u+1 ∈ F u+1 and J * u ∈ F u be the states that represent an optimal solution S * for which the set of jobs with completion weight in WI u+1 is exactly J * u+1 \ J * u . By Observation 3, we assume that also in S * the area under the remaining weight function W S * (t) for the jobs in J * u+1 \ J * u is approximated by (1 + ε) u+1 · (t(Z * 2 ) − t(Z * 1 )). We now show the following. The dynamic program constructs in iteration i a state Z = [J u , b, avg] with J u ∈ F u , b ∈ B, and avg ∈ AV G such that We prove this statement by induction on i = 1, . . . , ν. Consider the first iteration of the dynamic program, in which we consider states with job sets from F ν−1 . Let Z * = [J * ν−1 , b * , avg * ] be the state that corresponds to the optimal solution S * . The dynamic program also considers the job set J * ν−1 . Suppose, we utilize the same slots that S * utilizes for the jobs in J \ J * ν−1 in the interval [0, t(Z * )). Let b be the resulting utilization cost after rounding b * up to the next value in B. With this, we know that b ≤ (1 + η 1 ) · b * . Furthermore, by our assumption, we know that the average scheduling cost of S * up to time t(Z * ) is (1 + ε) ν . Let avg be (1 + ε) ν rounded up to the next value in AV G. Then we know that avg ≤ (1 + η 2 ) · avg * . The dynamic program also considers the state Z = [J * ν−1 , b, avg]. However, the dynamic program computes the minimum time point t(Z ν , Z) ≥ t LB so that the set of jobs J \ J * ν−1 can be feasibly scheduled in [0, t(Z ν , Z)) having utilization cost not more than b. This implies that t(Z ν , Z) ≤ t(Z * ), which implies that t(Z) ≤ t(Z * ). Note that t LB = 0 for the specified values in Z.
Suppose, the statement is true for the iterations 1, 2, . . . , i − 1. We prove that it is also true for iteration i, in which we consider job sets from F u . Again, let with J * u+1 ∈ F u+1 and J * u ∈ F u be the states that represent S * . By our hypothesis, we know that the dynamic program constructs a state We augment this schedule in the following way. Suppose, we utilize the same slots that S * utilizes for the jobs in J * u+1 \ J * u in the interval [t(Z * 1 ), t(Z * 2 )). Let b 2 be the resulting total utilization cost after rounding up to the next value in B. Thus, there is a feasible schedule for J \ J * u having utilization cost of at most The new average scheduling cost after rounding to the next value in AV G is The third inequality follows from the fact that avg * 1 ≥ (1 + ε) u+1 . The dynamic program also considers the link between the state Z 1 and Z 2 : . To complete the proof, we need to specify the parameters η 1 and η 2 . We want that (1 + η i ) ν ≤ (1 + ε) for i = 1, 2. We claim that for a given ν ≥ 1 there exists anη > 0 such that for all η ∈ (0,η] we have (1 + η) ν ≤ 1 + 2νη. Consider the function f (η) := (1 + η) ν − 1 − 2νη. We have that f (0) = 0 and f ′ (η) < 0 for η ∈ [0, 2 1/(ν−1) − 1). This shows the claim. Hence, we choose This shows the statement of the lemma and that the size of B as well as the size of AV G are bounded by a polynomial in the size of the input.
We remark that the given DP works for more general utilization cost functions e : N → Q ≥0 than considered here in the paper. As argued in the proof, it is sufficient for the DP that there is a function E(p, [t 1 , t 2 )) that outputs in polynomial time for a given time interval [t 1 , t 2 ) and a given p ∈ Z ≥0 the total cost of the p cheapest slots in [t 1 , t 2 ).
We also remark that the running time of the presented DP is exponential, because the size of the sets F u are exponential in the size of the input. However, in the next section we show that we can trim the sets F u down to ones of polynomial size at an arbitrarily small loss in the performance guarantee.

Trimming the state space
The set F u , containing all possible job sets J u , is of exponential size, and so is the DP state space. In the context of scheduling with variable machine speed, it has been shown in [17] how to reduce the set F u for a similar DP (without utilization decision, though) to a setF u of polynomial size at only a small loss in the objective value. In general, such a procedure is not necessarily applicable to our setting because of the different objective involving additional utilization cost and the different decision space. However, the compactification in [17] holds independently of the speed of the machine and, thus, independently of the utilization decision of the DP (interpret non/utilization as speed 0/1). Hence, we can apply it to our cost-aware scheduling framework and obtain a PTAS. We now describe the building blocks for this trimming procedure and argue why we can apply it in order to obtain the setF u for our problem.
Light Jobs. The first building block for the trimming procedure is a classification of the jobs based on their weights.
Definition 2. Given a weight schedule and a job j ∈ J with starting weight S w j ∈ WI u , we call job j light if w j ≤ ε 2 |WI u |, otherwise j is called heavy.
This classification enables us to structure near-optimal solutions. To impose structure on the set of light jobs, the authors in [17] describe the following routine for a given weight schedule S. First, remove all light jobs from S and move the remaining jobs within each interval WI u so that the idle weight in WI u is consecutive. Then, schedule the light jobs according to the reverse Smith's rule, that is, for each u = 1, . . . , ν and each idle weight w ∈ WI u , process at w a light job j that maximizes p j /w j . Eventually, shift the processing of each interval WI u to WI u+1 , which delays the completion of every job by at most a factor of (1 + ε) 2 . This delay allows to completely process every light job in the weight interval where it starts processing. It can be shown that the cost of the resulting schedule is at most a factor of 1 + O (ε) greater than the cost of S, which brings us to the following structural statement. Lemma 8 ([17]). At a loss of a factor of 1 + O (ε) in the scheduling cost, we can assume the following. For a given interval WI u , consider any pair of light jobs j, k. If both jobs start in WI u or later and p k /w k ≤ p j /w j , then C w j ≤ C w k .
We remark, that Lemma 8 holds independently of the speed of the machine, as pointed out in [17]. This means that at a loss of a factor of 1 + O (ε) in the scheduling cost we can assume also for our problem that light jobs are scheduled according to reverse Smith's rule in the weightdimension, which holds independently of our actual utilization decision.
Localization. We now localize jobs in the weight-dimension to gain more structure. That is, we determine for every job j ∈ J two values r w j and d w j such that, independently of our actual utilization decision, j is scheduled completely within r w j , d w j in some (1 + O (ε))-approximate weight-schedule (in terms of the scheduling cost). We call r w j and d w j the release-weight and the deadline-weight of job j, respectively. Lemma 9 ( [17]). We can compute in polynomial time values r w j and d w j for each j ∈ J such that: (i) there exists a (1 + O (ε))-approximate weight-schedule (in terms of the scheduling cost) that processes each job j within [r w j , d w j ), (ii) there exists a constant s ∈ O (log (1/ε) /ε) such that d w j ≤ r w j · (1 + ε) s , (iii) r w j and d w j are integer powers of (1 + ε), and (iv) the values r w j an d w j are independent of the speed of the machine.
This lemma enables us to localize all jobs in J in polynomial time and independent of our actual utilization decision, as guaranteed by property (iv).
Compact Search Space. Based on the localization of jobs in weight space, we can cut the number of different possibilities for a candidate set J u in iteration u of our DP down to a polynomial number. That is, we replace the set F u by a polynomially sized setF u . Instead of describing all sets S ∈F u explicitly, the we give all possible complements R = J \ S and collect them in a set D u , where a set R ∈ D u represents a possible set of jobs having completion weights in WI u+1 or later. Obviously, a set R ∈ D u must contain all jobs j ∈ J having a release weight r w j ≥ (1 + ε) u . Furthermore, we know that d w j ≥ (1 + ε) u+1 is necessary for job j to be in a set R ∈ D u . Following property (ii) in Lemma 9, we thus only need to decide about the jobs having a release weight r w j = (1 + ε) i with i ∈ {u + 1 − s, . . . , u − 1}. An enumeration over basically all possible job sets for each i ∈ {u + 1 − s, . . . , u − 1} gives the following desired result.
Lemma 10 ( [17]). For each u, we can construct in polynomial time a setF u that satisfies the following: (i) there exists a (1 + O (ε))-approximate weight-schedule (in terms of the scheduling cost) in which the set of jobs with completion weight at most (1 + ε) u belongs toF u , (ii) the set F u has cardinality at most 2 O(log 3 (1/ε)/ε 2 ) , and (iii) the setF u is completely independent of the speed of the machine.
Again, Property (iii) implies that we can construct the setF u independently of our utilization decision.
To complete the proof of Theorem 3 it remains to argue on the running time of the DP. The DP has ν iterations, where in each iteration for at most 2 O(log 3 (1/ε)/ε 2 ) · |B| · |AV G| previous states at most 2 O(log 3 (1/ε)/ε 2 ) · |B| · |AV G| many links to new states are considered. Therefore, the running time complexity of our DP is ν · (2 O(log 3 (1/ε)/ε 2 ) · |B| · |AV G|) 2 , which is bounded by a polynomial in the size of the input.

Minimizing the makespan on unrelated machines
Finally we derive positive results for the problem of minimizing makespan with utilization costs on unrelated machines. The standard scheduling problem without utilization cost R | pmtn | C max can be solved optimally in polynomial time by solving a linear program as was shown by Lawler and Labetoulle [15]. We show that the problem complexity does not increase significantly when taking into account time-varying utilization cost.
Consider the preemptive makespan minimization problem with utilization cost. Recall that we can use every machine in a utilized time slot and pay only once. Thus, it is sufficient to find an optimal utilization decision for solving this problem, because we can use the polynomial-time algorithm in [15] to find the optimal schedule within these slots.
Observation 5 Given the set of time slots utilized in an optimal solution, we can compute an optimal schedule in polynomial time.
Given an instance of our problem, let Z be the optimal makespan of the relaxed problem without utilization cost. Notice that Z is not necessarily integral. To determine an optimal utilization decision, we use the following observation.

Observation 6
Given an optimal makespan C * max for R | pmtn | C max + E, an optimal schedule utilizes the ⌈Z⌉ cheapest slots before ⌈C * max ⌉. Note that we must pay full tariff for a used time slot, no matter how much it is utilized, and so does an optimal solution. In particular, this holds for the last utilized slot. Hence, it remains to compute an optimal value C * := ⌈C * max ⌉ which we do by the following procedure. We compute for every interval I k = [s k , d k ), k = 1, . . . , K, an optimal point in time for C * assuming that C * ∈ I k . Hereby we restrict to relevant intervals I k which allow for a feasible schedule, i.e., s k ≥ ⌈Z⌉. For a relevant interval I k , we let C * = s k and utilize the ⌈Z⌉ cheapest time slots before C * , which is optimal by Observation 6. Notice that any utilized time slot of cost e such that e > e k + 1 can be replaced by a time slot from I k leading to a solution of less total cost. Thus, if there is no such time slot then s k is the best choice for C * in I k . Suppose there is such a time slot that could be replaced. Let R ⊆ {1, . . . , k − 1} be the index set of intervals that contain at least one utilized slot. We define I ℓ to be the interval with e ℓ = max h∈R e h and denote by r h the number of utilized time slots in I h . Replace min{r ℓ , d k − s k − r k } utilized slots from I ℓ by slots from I k and update R, I ℓ and r k . This continues until e ℓ ≤ e k + 1 or the interval I k is completely utilized, i.e., r k = d k − s k . This operation takes at most O(K) computer operations per interval to compute the best C * -value in that interval. It yields the following theorem.
Theorem 4. The scheduling problem R | pmtn | C max + E can be solved in polynomial time in the order of O(K 2 ) plus the running time for solving R | pmtn | C max without utilization cost [15].

Conclusion
We investigate basic scheduling problems within the framework of time-varying costs or tariffs, where the processing of jobs causes some time-dependent cost in addition to the usual QoS measure. We presented optimal algorithms and best possible approximation algorithms for the scheduling objectives of minimizing the makespan on unrelated machines and the sum of (weighted) completion times on a single machine.
While our work closes the problems under consideration from an approximation point of view, it leaves open the approximability of multi-machine settings for the min-sum objective. Further research may also ask for the complexity status when assuming that jobs have different release dates and for other natural objective functions such as average and maximum flow-time.
Our unrelated machine model is time-slot based, that is, a utilization decision is made for a time slot and then all machines in this time slot are available. No less relevant appears to be the model with machine-individual tariffs, that is, a utilization decision is made for a time slot on each machine individually. It is not difficult to see that a standard LP can be adapted for optimally solving R | pmtn, r j | C max with fractional utilization cost. However, if time slots can be utilized only integrally then the integrality gap for the simple LP is unbounded and the problems seems much harder.
Time-varying cost or tariffs appear in many applications in practice but they are hardly investigated from a theoretical perspective. With our work we settle the complexity status and approximability status for very classical scheduling problems. We hope to foster further research on this framework of time-varying costs or tariffs. We emphasize that the framework is clearly not restricted to cost-aware scheduling problems. Virtually any problem in which scarce resources are to be rented from some provider lends itself to be modelled in this way, with (vehicle) routing problems as a directly appealing example.