Earliness and Tardiness Costs
5.2 Minimizing Deviations from a Common Due Date
5.2.1 Four Basic Results
An important special case in the family of E/T problems involves minimizing the sum of absolute deviations of the job completion times from a common due date. In particular, the objective function can be written as
f S =
n
j= 1
Cj−d =
n
j= 1
Ej+Tj 5 1
where, in the latter form, it is understood that the due dates are identical. With the objective function in that form, it is clear that earliness and tardiness are penalized at the same rate for all jobs. We refer to this case, wheredj=dand αj=βj= 1, as thebasicE/T problem.
At the outset, we give a somewhat simplified characterization of the optimal solution. Ideally, we would like to construct the schedule so that the due date is, in some sense, in the middle of the jobs. Ifdis too tight, then it is not pos- sible to fit enough jobs in front ofd, because no job can start before time zero.
Thus, for a given set of jobs, we might discover thatdis too tight; this gives rise to therestrictedversion of the problem. Otherwise,dis not too tight, giving rise to theunrestrictedversion. For example, if the due date is larger than the time required to process all jobs, then we have the flexibility to place any of the jobs in front ofd, so the problem is unrestricted. Later, we shall see how to determine a more precise boundary between the restricted and unrestricted versions.
We first consider the unrestricted version of the problem. As an initial step, we look for dominance properties. For the unrestricted version, three important properties hold, and we can establish each one using a proof by contradiction.
∎Theorem 5.1 In the basic E/T problem, schedules without inserted idle time between successive jobs constitute a dominant set.
Proof. Suppose that there exists an optimal scheduleSwith an idle interval of lengthtbetween consecutive jobsiandj, withjfollowingi. Suppose that job i is early (Ci< d). Then total cost can be reduced if we shift jobi (and any jobs that precede it) later by an amount Δt, where Δt ≤min{t, d −Ci}. If primes denote values after the shift, then for all jobs k, we have Tk=Tk
and Ek ≤Ek (with a strict inequality for at least one job). Similarly, suppose job j is tardy (Cj > d). Then total cost can be reduced if we shift jobj (and any jobs that follow it) earlier by an amount Δt, where Δt ≤min{t, Cj−d}.
Because of the common due date, any schedule must have either job iearly or jobjtardy, so we have shown how to improve scheduleS. Therefore,Scannot
be an optimal schedule. □
5.2 Minimizing Deviations from a Common Due Date 107
Theorem 5.1 allows us to consider only schedules in which jobs are contig- uous, but it does not allow us to assume that the first job starts at time zero.
We can describe a schedule by specifying a sequence of the jobs and a start time for the first job in sequence, after which processing will be continuous. In prin- ciple, this means that the search for an optimum must consider n! different sequences and for each sequence, the best start time.
∎Theorem 5.2 In the basic E/T problem, jobs that complete on or before the due date can be sequenced in LPT order, and jobs that start on or after the due date can be sequenced in SPT order.
Proof. SupposeSdenotes an optimal schedule in which some adjacent pair of early jobs is not in LPT order. Then a pairwise interchange of these two jobs will reduce the total earliness cost and leave the total tardiness cost unchanged.
Likewise, if Sis an optimal schedule containing an adjacent pair of jobs that starts late and that violates SPT order, then an adjacent pairwise interchange will reduce the total tardiness cost and leave the total earliness cost unchanged.
In either case,Scannot be an optimal schedule. □
Theorem 5.2 specifies how to sequence the jobs that complete early and how to sequence the jobs that start late. In principle, there could also be a single job that starts before the due date and completes after the due date–that is, astrad- dlingjob. The following result, however, shows that schedules with a straddling job need not be considered.
∎Theorem 5.3 In the basic E/T problem, an optimal schedule exists in which some job completes exactly at the due date.
Proof. SupposeSis an optimal schedule in which jobistarts before the due date and completes after it. In symbols,
Ci−pi<d<Ci
Letbdenote the number of early jobs in sequence, and letadenote the num- ber of tardy jobs. Suppose thata > b. Consider shifting the entire schedule ear- lier so that job i completes exactly at time d. In other words, all jobs will complete earlier by an amountΔt=Ci–d >0. Then the increase in earliness cost isbΔt, while the decrease in tardiness cost isaΔt. The net impact on total cost is (b−a)Δt, which is negative. On the other hand, suppose thatb≥a. In this case, shift the entire schedule later so that jobistarts exactly at timed. In other words, Δt=d−(Ci−pi) >0. This time the impact on total cost is (a−b)Δt, which is nonpositive. In either case, therefore, we can find a schedule with the property of the theorem that is at least as good asS. □
As a consequence of Theorem 5.3, we may schedule each job either entirely before the due date or entirely after it. This means that a solution can be
5 Earliness and Tardiness Costs 108
partitioned into two sets of jobs, an early set, which includes the one job pre- cisely on time, and a tardy set. Once the membership in the two sets is known, the sequence of the jobs within each set can be determined by Theorem 5.2. The resulting schedule is sometimes called aV-shaped sequence, because except for ties, the first set is sequenced in decreasing order of processing times, and the second is processed in increasing order of processing times. We can also refer to it as anLPT/SPT sequence. Once we know how jobs are assigned to the early set and the tardy set, sequencing the jobs is straightforward. Therefore, the search for an optimum need only consider the 2nways of forming sets, instead of alln!
sequences. Even if we know the optimal job sequence, Theorem 5.3 is critical.
Without it, we would have a potentially infinite number of schedules to evaluate because the starting time of the first job in sequence would remain unresolved.
Theorem 5.3 allows us to limit our attention to those schedules in which some job’s completion time falls precisely at the due date–that is, to a finite set of possible schedules. As we shall see, these three properties generalize when we examine problems that are more complicated.
The detailed analysis of this problem demonstrates that many optimal solu- tions may exist. LetBrepresent the set of jobs completing on or before the due date, and letbdenote the number of jobs inB, or thecardinalityofB, denoted by
|B|. Similarly, letArepresent the set of jobs completing after the due date, and leta= |A|. Furthermore, letBidenote the index of theith job inB, and letAi denote the index of theith job inA. The earliness cost for jobBiis the sum of the processing times of all jobs inBthat complete later. In symbols,
EBi=pB i+ 1 +pB i+ 2+ +pBb
whereEBb= 0. The total cost for the jobs inBthen becomes CB=
b
i= 1
EBi=
b
i= 1
pB i+ 1 +pB i+ 2+ +pBb
With some algebraic manipulation, this sum can be rewritten as
CB= 0pB1+ 1pB2+ + b−2pB b−1 + b−1pBb 5 2
Similarly, the total cost for the jobs inAis
CA=apA1+ a−1pA2+ + 2pA a−1 + 1pAa 5 3
The objective function is the sum ofCBandCA, and the processing times are given. Whenaandbare known, this sum of products is minimized by matching the smallest coefficient in the sum with the largest processing time, the next smallest coefficient with the next largest processing time, and so on, with ties broken arbitrarily. Thus, the smallest coefficient is zero and appears only in CB. Therefore, the longest job is assigned to Band, in light of Theorem 5.2, appears first in sequence. The next smallest coefficient is 1, appearing in both
5.2 Minimizing Deviations from a Common Due Date 109
CBandCA. This means that one of the next two longest jobs can be assigned to A, as its last job, and the other toB, as its second job. Continuing in this fashion, we ultimately find that the shortest job is either the last job inBor the first job in A. At intermediate stages, there are two ways to assign each pair of jobs that must be split between the setsAandB. (Ifnis even, we can create a fictitious additional job with zero processing time to complete the last pair.) Thus, the total number of potentially optimal schedules is 2r, where
r=n−1
2 if nis odd
=n
2 if nis even
(Actually, this observation assumes that the processing times are unique. If there are ties, the number of optimal schedules is even greater.) The implied procedure for constructing optimal schedules is as follows.
Algorithm 5.1 Solving the Basic E/T Problem Step 1. Assign the longest job to setB.
Step 2. Find the next two longest jobs. Assign one toBand one toA.
Step 3. Repeat Step 2 until there are no jobs left, or until there is one job left, in which case assign this job to eitherAorB. Finally, order the jobs inBby LPT and the jobs inAby SPT.
Next, we provide an example that illustrates the application of Algorithm 5.1.
∎Example 5.1 Consider the jobs described in the following table, with a given common due date ofd= 24.
Jobj 1 2 3 4 5 6
pj 1 3 4 6 7 9
Following the first step of Algorithm 5.1, we assign job 6 toB. Then we split jobs 4 and 5 betweenAandB, and we split jobs 2 and 3 betweenAandB. Lastly, we assign job 1 to eitherAorB. The eight resulting schedules, each with total cost of 30, are listed in Table 5.1. Only four distinct sequences appear in the list of optimal schedules. Those occur because of the choice in Step 3 to assign the last job either to the end ofBor the beginning ofA. In either case, the sequence is the same, but the schedule is different. (The total processing time in setBis affected by this choice.) Finally, the start time of the schedule is the difference between the due date and the total processing time inB.
5 Earliness and Tardiness Costs 110
In light of the fact that there can be many optimal schedules in the basic E/T problem, we might be interested in a secondary measure of perfor- mance. In particular, suppose the secondary objective is to minimize the total processing time in set B. In Algorithm 5.1, this is accomplished by assigning the shorter job to B each time Step 2 is executed and if n is even, by assigning the shortest job to Ain Step 3. We refer to this imple- mentation as Algorithm 5.1∗, which can be implemented to run in O(n log n) time.
Two insights emerge from this discussion. First, the implementation of Algo- rithm 5.1∗dictates the values ofaandb. In particular, ifnis even, we can min- imize the sum of Eqs. (5.2) and (5.3) by takingb=a; ifnis odd, we takeb=a+ 1.
A more formal statement follows.
∎Theorem 5.4 In the basic E/T problem, an optimal schedule exists in which job [b] completes at timed, whereb= n/2 , and x denotes the smallest inte- ger greater than or equal tox.
This result has another application. Suppose that the sequence of jobs is given and not necessarily optimal. Then Theorems 5.1 and 5.3 hold for schedules con- taining the given job sequence, and we can use Theorem 5.4 to determine which job should complete exactly at the due date.
Assume for convenience that the jobs are indexed in SPT order, withpnas the longest processing time. When we implement Algorithm 5.1∗, the total proces- sing time in setBcan be written as
Δ=pn+pn−2+pn−4+ 5 4 In other words, we calculateΔby taking the jobs in longest-first order and summing every other processing time.
Table 5.1
Jobs in setB Jobs in setA Sequence Time for setB Start time
6-5-3-1 2-4 6-5-3-1-2-4 21 3
6-5-3 1-2-4 6-5-3-1-2-4 20 4
6-5-2-1 3-4 6-5-2-1-3-4 20 4
6-5-2 1-3-4 6-5-2-1-3-4 19 5
6-4-3-1 2-5 6-4-3-1-2-5 20 4
6-4-3 1-2-5 6-4-3-1-2-5 19 5
6-4-2-1 3-5 6-4-2-1-3-5 19 5
6-4-2 1-3-5 6-4-2-1-3-5 18 6
5.2 Minimizing Deviations from a Common Due Date 111
The significance of Δ relates to the definition of the restricted and unre- stricted versions of the problem. The definition of the unrestricted version given earlier was vague in that it was based on the notion that the due date should not be too tight. Now that we have developed Eq. (5.4), we can be more precise. The value ofΔin Eq. (5.4) is the smallest value ofdconsistent with an unrestricted version of the problem. In other words, the problem is unrestricted ford≥Δand restricted ford <Δ. When the problem is restricted, Algorithm 5.1 may not pro- duce an optimal schedule. When the problem is unrestricted, Algorithm 5.1∗ guarantees an optimal schedule.
We can see from Table 5.1 that in our example,Δ= 18. Given the job set in this example, if the common due date wered= 18, the problem would still be unrestricted, and Algorithm 5.1∗would produce an optimal schedule. Ford<
18, the problem would be restricted.
Algorithm 5.1∗thus achieves a feasible unrestricted solution whenever one exists. But this variation of Algorithm 5.1 maximizes the idle time before start- ing the first job and thus maximizes the makespan, Cmax. To prepare the machine for the next set of jobs, however, it may be safer as a secondary objec- tive tominimizethe makespan. Let Algorithm 5.1∗∗be defined by reversing all the optional choices of Algorithm 5.1∗–that is, we select the longer job forBin Step 2 and assign the shortest job toBin Step 3 ifnis even (yieldingb=a+ 2 rather thanb=a). Instead of Eq. (5.4), Algorithm 5.1∗∗yields
Δ∗∗=pn+pn−1+pn−3+
Ifd ≥Δ∗∗, Algorithm 5.1∗∗yields an unrestricted solution and achieves the minimal makespan as a secondary objective. IfΔ< d <Δ∗∗, then the E/T prob- lem is unrestricted, but minimizing the secondary objective becomes NP-hard (in the ordinary sense). In Example 5.1, as long as the due date is 21 or more, Algorithm 5.1∗∗solves the E/T problem optimally. In Table 5.1, the solution of Algorithm 5.1∗∗is in the first row and that of Algorithm 5.1∗in the last. Ford= 24, the former yieldsCmax= 33 and the latterCmax= 36. Finally, whennis even, Algorithms 5.1∗ and 5.1∗∗ yield two distinct b values, n/2 and 1 +n/2. This implies that for any sequence (optimal or not), it does not matter if job [1 + n/2] completes exactly on the due date or starts exactly on the due date. Indeed, this job can even straddle the due date without compromising optimality.