Single Machine Models (Deterministic)
3.1 The Total Weighted Completion Time
The first objective to be considered is the total weighted completion time, i.e., 1||
wjCj. The weightwj of jobj may be regarded as an importance factor;
it may represent either a holding cost per unit time or the value already added to jobj. This problemgives rise to one of the better known rules in scheduling theory, the so-called Weighted Shortest Processing Time first (WSPT) rule.
According to this rule the jobs are ordered in decreasing order ofwj/pj. Theorem 3.1.1. The WSPT rule is optimal for1||
wjCj.
Proof. By contradiction. Suppose a scheduleS, that is not WSPT, is optim al.
In this schedule there must be at least two adjacent jobs, say jobj followed by jobk, such that
wj
pj <wk
pk.
Assume jobjstarts its processing at timet. Performa so-calledAdjacent Pair- wise Interchange on jobsj and k. Call the new scheduleS. While under the original scheduleSjobjstarts its processing at timetand is followed by jobk, under the new scheduleS job kstarts its processing at time tand is followed by job j. All other jobs remain in their original position. The total weighted completion time of the jobs processed before jobs j and k is not affected by the interchange. Neither is the total weighted completion time of the jobs pro- cessed after jobs j and k. Thus the difference in the values of the objectives under schedulesS andS is due only to jobs jandk(see Figure 3.1). UnderS the total weighted completion time of jobsj andkis
(t+pj)wj+ (t+pj+pk)wk, while underS it is
(t+pk)wk+ (t+pk+pj)wj.
It is easily verified that ifwj/pj < wk/pk the sumof the two weighted comple- tion times underS is strictly less than underS. This contradicts the optimality
ofS and completes the proof of the theorem.
The computation time needed to order the jobs according to WSPT is the time required to sort the jobs according to the ratio of the two parameters. A simple sort can be done inO(n lo g(n)) time, see Example D.1.1 in Appendix D.
How is the minimization of the total weighted completion time affected by precedence constraints? Consider the simplest form of precedence constraints, i.e., precedence constraints that take the formof parallel chains (see Figure 3.2).
3.1 The Total Weighted Completion Time 37
k
t t + pj + pk
j Schedule S
Schedule S’
k
t t + pj + pk
j
Fig. 3.1A pairwise interchange of jobsjandk
Fig. 3.2Precedence constraints in the form of chains
This problemcan still be solved by a relatively simple and very efficient (polyno- mial time) algorithm. This algorithm is based on some fundamental properties of scheduling with precedence constraints.
Consider two chains of jobs. One chain, say Chain I, consists of jobs 1, . . . , k and the other chain, say Chain II, consists of jobsk+ 1, . . . , n. The precedence constraints are as follows:
1→2→ · · · →k and
k+ 1→k+ 2→ · · · →n.
The next lemma is based on the assumption that if the scheduler decides to start processing jobs of one chain he has to complete theentire chain before he is allowed to work on jobs of the other chain. The question is: if the scheduler wishes to minimize the total weighted completion time of thenjobs, which one of the two chains should he process first?
Lemma 3.1.2. If k
j=1wj
k j=1pj
> (<) n
j=k+1wj
n
j=k+1pj,
then it is optimal to process the chain of jobs1, . . . , k before (after) the chain of jobsk+ 1, . . . , n.
Proof. By contradiction. Under sequence 1, . . . , k, k+1, . . . , nthe total weighted completion time is
w1p1+· · ·+wk
k j=1
pj+wk+1 k+1
j=1
pj+· · ·+wn
n j=1
pj,
while under sequencek+ 1, . . . , n,1, . . . , k it is wk+1pk+1+· · ·+wn
n j=k+1
pj+w1 n
j=k+1
pj+p1
+· · ·+wk
n j=1
pj. The total weighted completion time of the first sequence is less than the total weighted completion time of the second sequence if
k j=1wj
k j=1pj
>
n j=k+1wj
n j=k+1pj
The result follows.
An interchange between two adjacent chains of jobs is usually referred to as anAdjacent Sequence Interchange. Such an interchange is a generalization of an Adjacent Pairwise Interchange.
An important characteristic of chain
1→2→ · · · →k is defined as follows: letl∗ satisfy
l∗ j=1wj l∗
j=1pj
= m ax
1≤l≤k
l
j=1wj l
j=1pj
.
The ratio on the left-hand side is called the ρ-factor of chain 1, . . . , k and is denoted by ρ(1, . . . , k). Job l∗ is referred to as the job that determines the ρ-factor of the chain.
Suppose now that the scheduler does not have to complete all the jobs in a chain before he is allowed to work on another chain. He may process some jobs of one chain (while adhering to the precedence constraints), switch over to another chain, and, at some later point in time, return to the first chain. If, in the case of multiple chains, the total weighted completion time is the objective function, then the following result holds.
3.1 The Total Weighted Completion Time 39 Lemma 3.1.3. If jobl∗determinesρ(1, . . . , k), then there exists an optimal sequence that processes jobs1, . . . , l∗one after another without any interruption by jobs from other chains.
Proof. By contradiction. Suppose that under the optimal sequence the process- ing of the subsequence 1, . . . , l∗is interrupted by a job, say jobv, fromanother chain. That is, the optimal sequence contains the subsequence 1, . . . , u, v, u+ 1, . . . , l∗, say subsequence S. It suffices to show that either with subsequence v,1, . . . , l∗, say S, or with subsequence 1, . . . , l∗, v, sayS, the total weighted completion time is less than with subsequence S. If it is not less with the first subsequence, then it has to be less with the second and vice versa. From Lemma 3.1.2 it follows that if the total weighted completion time withSis less than withS then
wv
pv
< w1+w2+. . .+wu
p1+p2+. . .+pu
.
From Lemma 3.1.2 it also follows that if the total weighted completion time withS is less than withS then
wv
pv > wu+1+wu+2+. . .+wl∗
pu+1+pu+2+. . .+pl∗ .
If jobl∗is the job that determines theρ-factor of chain 1, . . . , k, then wu+1+wu+2+. . .+wl∗
pu+1+pu+2+. . .+pl∗ >w1+w2+. . .+wu
p1+p2+. . .+pu
. IfS is better thanS, then
wv pv
> wu+1+wu+2+. . .+wl∗
pu+1+pu+2+. . .+pl∗
>w1+w2+. . .+wu p1+p2+. . .+pu
.
SoS is therefore better thanS. The same argument goes through if the inter- ruption of the chain is caused by more than one job.
The result in Lemma 3.1.3 is intuitive. The condition of the lemma implies that the ratios of the weight divided by the processing time of the jobs in the string 1, . . . , l∗ must be increasing in some sense. If one had already decided to start processing a string of jobs, it makes sense to continue processing the string until jobl∗is completed without processing any other job in between.
The two previous lemmas contain the basis for a simple algorithm that mini- mizes the total weighted completion time when the precedence constraints take the formof chains.
Algorithm 3.1.4(Total Weighted Completion Time and Chains)