• Tidak ada hasil yang ditemukan

Weighted Completion Time and Chains) Whenever the machine is freed, select among the remaining chains the one with

Dalam dokumen Scheduling (Halaman 54-57)

Single Machine Models (Deterministic)

Algorithm 3.1.4(Total Weighted Completion Time and Chains) Whenever the machine is freed, select among the remaining chains the one with

3.1 The Total Weighted Completion Time 39 Lemma 3.1.3. If jobldeterminesρ(1, . . . , k), then there exists an optimal sequence that processes jobs1, . . . , lone 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, . . . , lis 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 joblis 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 joblis 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)

Example 3.1.5 (Total Weighted Completion Time and Chains) Consider the following two chains:

1234 and

567

The weights and processing times of the jobs are given in the table below.

jobs 1 2 3 4 5 6 7

wj 6 18 12 8 8 17 18

pj 3 6 6 5 4 8 10

Theρ-factor of the first chain is (6+18)/(3+6) and is determined by job 2.

Theρ-factor of the second chain is (8+17)/(4+8) and is determined by job 6.

As 24/9 is larger than 25/12 jobs 1 and 2 are processed first. Theρ-factor of the remaining part of the first chain is 12/6 and determined by job 3. As 25/12 is larger than 12/6 jobs 5 and 6 follow jobs 1 and 2. Theρ-factor of the remaining part of the second chain is 18/10 and is determined by job 7;

so job 3 follows job 6. As thewj/pj ratio of job 7 is higher than the ratio of job 4, job 7 follows job 3 and job 4 goes last. ||

Polynomial time algorithms have been obtained for 1|prec |

wjCj with more general precedence constraints than the parallel chains considered above.

However, with arbitrary precedence constraints, the problemis strongly NP- hard.

Up to now all jobs were assumed to be available at time zero. Consider the problemwhere jobs are released at different points in time and the scheduler is allowed to preempt, i.e., 1 | rj, prmp |

wjCj. The first question that comes to mind is whether a preemptive version of the WSPT rule is optimal. A preemptive version of the WSPT rule can be formulated as follows: At any point in time the available job with the highest ratio of weight toremainingprocessing time is selected for processing. The priority level of a job thus increases while being processed and a job can therefore not be preempted by another job that already was available at the start of its processing. However, a job may be preempted by a newly released job with a higher priority factor. Although this rule may appear a logical extension of the nonpreemptive WSPT rule, it does not necessarily lead to an optimal schedule since the problem is strongly NP- hard (see Appendix E).

If all the weights are equal, then the 1|rj, prmp|

Cj problemis easy (see Exercise 3.15). On the other hand, the nonpreemptive version of this problem, i.e., 1|rj |

Cj, is strongly NP-hard.

3.1 The Total Weighted Completion Time 41 In Chapter 2 the total weighted discounted completion time

wj(1−erCj), withrbeing the discount factor, is described as an objective that is, in a way, a generalization of the total weighted (undiscounted) completion time. The problem1||

wj(1−erCj) gives rise to a different priority rule, namely the rule that schedules the jobs in decreasing order of

wjerpj 1−erpj.

In what follows this rule is referred to as the Weighted Discounted Shortest Processing Time first (WDSPT) rule.

Theorem 3.1.6. For1||

wj(1−erCj)the WDSPT rule is optimal.

Proof. By contradiction. Again, assume that a different schedule, say sched- uleS, is optimal. Under this schedule there have to be two jobsj andk, job j followed by jobk, such that

wjerpj

1−erpj < wkerpk 1−erpk.

Assume jobj starts its processing at timet. An Adjacent Pairwise Interchange between these two jobs results in a scheduleS. It is clear that the only difference in the objective is due to jobsj andk. UnderS the contribution of jobs jand kto the objective function equals

wj

1−er(t+pj)

+wk

1−er(t+pj+pk)

.

The contribution of jobs j and k to the objective under S is obtained by interchanging thej’s andk’s in this expression. Elementary algebra then shows that the value of objective function under S is less than underS. This leads

to the contradiction that completes the proof.

As discussed in Chapter 2, the total undiscounted weighted completion time is basically a limiting case of the total discounted weighted completion time wj(1−erCj). The WDSPT rule results in the same sequence as the WSPT rule ifris sufficiently close to zero (note that the WDSPT rule is not properly defined forr= 0).

Both

wjCj and

wj(1 −erCj) are special cases of the more gen- eral objective function

wjh(Cj). It has been shown that only the functions h(Cj) =Cj andh(Cj) = 1−erCj lead to simple priority rules that order the jobs in decreasing order of some functiong(wj, pj). No such priority function g, that guarantees optimality, exists for any other cost function h. However, the objective

hj(Cj) can be dealt with via Dynamic Programming (see Ap- pendix B).

In a similar way as Lemma 3.1.2 generalizes the Adjacent Pairwise Inter- change argument for WSPT there exists an Adjacent Sequence Interchange

result that generalizes the Adjacent Pairwise Interchange argument used in the optimality proof for the WDSPT rule (see Exercise 3.21).

3.2 The Maximum Lateness

The objectives considered in the next four sections are due date related. The first due date related model is of a rather general nature, namely the problem 1|prec|hmax, where

hmax= m ax

h1(C1), . . . , hn(Cn)

with hj, j = 1, . . . , n, being nondecreasing cost functions. This objective is clearly due date related as the functions hj may take any one of the forms depicted in Figure 2.1. This problemallows for an efficientbackward dynamic programming algorithm even when the jobs are subject to arbitrary precedence constraints.

It is clear that the completion of the last job occurs at the makespanCmax= pj, which is independent of the schedule. LetJ denote the set of jobs already scheduled, which are processed during the time interval

[Cmax

jJ

pj, Cmax].

The complement of setJ, setJc, denotes the set of jobs still to be scheduled and the subsetJ of Jc denotes the set of jobs that can be scheduled immediately before setJ, i.e., the set of jobs all of whose successors are inJ. SetJis referred to as the set of schedulable jobs. The following backward algorithmyields an optimal schedule.

Algorithm 3.2.1 (Minimizing Maximum Cost)

Dalam dokumen Scheduling (Halaman 54-57)