• Tidak ada hasil yang ditemukan

Dispatching and Construction Procedures

Heuristic Methods for the Single-machine Problem

4.2 Dispatching and Construction Procedures

As we noted earlier, some of the simplest solution methods require only the sorting of jobs. For example, in theF-problem, sorting the jobs according to SPT produces an optimal sequence. Actually, at the time the machine becomes idle, it is not really necessary to sort all of the waiting jobs–we need only iden- tify the shortest waiting job and schedule that one to be next. More specifically, we use the termsortingto describe the use of a ranking scheme with the prop- erty that the relative ranking of two jobs does not change with time. In other words, sorting involves static priorities. In addition, if a new job is added to a sorted set, the relative ranking of the original jobs does not change. To deter- mine whether the new job should be the next one scheduled, we do not have to resort the entire set of jobs–we need only compare the new job to the current job with highest priority.

More generally, we use the termdispatchingto describe a procedure that uses a decision rule to select the next job each time the machine becomes free. Dis- patching includes dynamic as well as static sorting rules. To illustrate a dynamic

4 Heuristic Methods for the Single-machine Problem 72

version, consider theT-problem. A simple yet effective heuristic rule ranks jobs by the MDD criterion. Recall from Chapter 2 that the modified due date of jobj at timetis defined by

dj t = max dj,t+pj 4 1

We also saw there that if jobsiandjare the candidates to begin at timet, then the job with the earlier modified due date should come first. We then noted that if we use the rule as a dispatching procedure, we may not obtain the optimal solution.

Example 4.1 Consider a problem containingn= 3 jobs with known proces- sing times and due dates.

Jobj 1 2 3

pj 8 9 12

dj 15 13 10

dj 0 15 13 12

Suppose that MDD is implemented as a dispatching procedure for the three-job problem in Example 4.1. At timet= 0, the modified due dates are given bydj 0 , so the ranking of the jobs at time zero is 3-2-1. Therefore, job 3 is selected to be first and completes at time 12. The next decision takes place at timet= 12, and the scheduling problem appears as follows:

Jobj 1 2

pj 8 9

dj 15 13

dj 12 20 21

Here, the modified due dates are given bydj 12 , and the rule selects job 1 before job 2, which reverses the ranking of the two jobs at time zero. The final sequence is 3-1-2, withT= 23, which happens to be suboptimal.

As the example illustrates, a dispatching procedure ranks all the unsched- uled jobs each time a decision arises because the ranking may change over time. The result is a selection of the most urgent job when the machine becomes available. A sorting rule is easier to implement when it is static, because the jobs need to be ranked only once. A dynamic rule, such as MDD, requires repeated reranking of the jobs, but the computations are mod- est. In actual practice, a static sorting rule typically permits the use of a phys- ical label for each job, displaying a number, which represents a relatively

4.2 Dispatching and Construction Procedures 73

simple way to convey scheduling priorities. A dynamic rule does not lend itself easily to physical labels, but a computerized decision support system can update the priorities easily.

For another dynamic dispatching example, we turn to the more complex Tw-problem. A heuristic approach is to generalize MDD to the weighted modified due date(WMDD) rule, defined as nondecreasing order of the quan- tity max{dj−t, pj}/wj. Dispatching by this rule involves sorting the jobs and selecting the job with the smallest WMDD as the next job. The sequence is dynamic, because the dispatching criterion depends ont.

One useful way to judge heuristics is to trace their behavior in special cases and to check that they reduce to good decision rules. For example, if all weights are equal, then WMDD reduces to the MDD rule. Also, if all due dates are zero, WMDD reduces to SWPT, which is optimal when all jobs must be late. However, unlike MDD, WMDD is not guaranteed to sequence even two jobs optimally.

Example 4.2 Consider a problem containingn= 2 jobs with known proces- sing times, due dates, and weights.

Jobj 1 2

pj 2 5

dj 8 6

wj 3 2

For job 1, the MWDD is calculated as 8/3 = 2.7. For job 2 the calculation is 6/2 = 3.

Thus, by the WMDD heuristic, job 1 should precede job 2, leading to a total weighted tardiness of 2. The opposite sequence, by contrast, has no tardiness.

The desired sequencing can be detected in two ways. One is by trial and error.

The other is by invoking a test based on an exact generalization of MDD. Sup- pose that jobs iandjare considered for the next two positions (without any other job inserted between them), and letsj+ = max{dj−pj−t, 0}. If

pi wi

1− sj+ pi ≤pj

wj

1− si+ pj

4 2 thenican precedejwith at most the same total weighted tardiness. When we apply this test for the sequence 1-2 in Example 4.2, the test fails:

2 3 1−1

2 >5 2 1−6

5

This result indicates that job 2 should precede job 1 if both of them are to be scheduled in the next two positions. In particular, the test can be applied to

4 Heuristic Methods for the Single-machine Problem 74

the first two jobs in any proposed sequence, takingt= 0. For later pairs of jobs, however, we need to know the value oft.

Aconstruction procedure, like a dispatching procedure, builds a schedule from scratch, normally adding jobs to the schedule one at a time, but it does not necessarily add the jobs in order from earliest to latest. For example, one logical way to construct a schedule in theT-problem is to choose a job to be last in sequence. Because we know what time the last job will complete, we can select the job that will incur the least amount of tardiness when it finishes last. What remains is a problem consisting of (n−1) jobs, which we can resolve the same way. This approach is sometimes called agreedyprocedure, in that it makes the next selection in the most favorable way, without regard to the con- sequences that might arise later in the algorithm. (A greedy algorithm could also focus on choosing thefirstjob in sequence, but in tardiness-related problems, the last-to-first structure is often more productive.)

In this particular application of a greedy procedure, we makekcomparisons when there arek jobs left to be scheduled. Thus, the computational effort is O(n2). An illustration follows.

Example 4.3 Consider a problem containingn= 5 jobs with known proces- sing times and due dates.

Jobj 1 2 3 4 5

pj 2 3 1 6 4

dj 12 4 7 10 6

In this example, we know that the last job in sequence will complete at time 16.

The job that would have the smallest tardiness if it were to complete at 16 is job 1. Once we assign job 1 to be last, we know that the fourth job will complete at time 14. Among the unscheduled jobs, the smallest tardiness at time 14 would occur for job 4, so we assign it to be fourth. Continuing in this fashion, the algorithm constructs the sequence 2-5-3-4-1, with a total tardiness ofT= 10.

In the special case of theT-problem, the greedy algorithm reduces to a famil- iar device for static dispatching, namely, the EDD rule. In more complicated problems, greedy algorithms may not be as recognizable, but they tend to pro- vide at least adequate results and are sometimes surprisingly effective. (For example, in this case, MDD–which is also greedy–yieldsT= 8, which happens to be optimal.)

Another widely used construction procedure is the insertion procedure, which works as follows. Consider the subproblem consisting of just jobs 1 and 2. Optimize their sequence (by comparing the alternatives 1-2 and 2-1).

Next, keeping the relative order of the first two jobs fixed, find the best location

4.2 Dispatching and Construction Procedures 75

in which to insert job 3. In other words, if 1-2 is the better of the two-job alter- natives, consider the three alternatives 3-1-2, 1-3-2, and 1-2-3. If 2-1 is the bet- ter of the two-job alternatives, consider the three alternatives 3-2-1, 2-3-1, and 2-1-3. At stagek, we obtain a solution to thek-job subproblem consisting of the firstkjobs. Then at stage (k+ 1), we keep the relative order of the firstkjobs fixed in that sequence and consider inserting job (k+ 1) into each of the (k+ 1) possible positions. We select the best of these (k+ 1) alternatives for consid- eration at the next stage, and we stop when we have generated the bestn-job alternative. The insertion procedure usually requires a computational effort ofO(n3).

As an illustration, we use the data in Example 4.3. At the initial stage, we com- pare the two-job sequences 1-2 and 2-1:

Jobj 1 2 Jobj 2 1

Tj 0 1 Tj 0 0

Based on this comparison, we retain the partial sequence 2-1 and next consider where to insert job 3:

3-2-1 T= 0 2-3-1 T= 0 2-1-3 T= 0

Here, we arbitrarily break the tie in favor of the first sequence encountered, 3-2- 1. At the next stage, we have four partial sequences to consider:

4-3-2-1 T= 6 3-4-2-1 T= 6 3-2-4-1 T= 0 3-2-1-4 T= 2 Here, we retain the partial sequence 3-2-4-1 and examine five ways to convert it to a complete sequence:

5-3-2-4-1 12 3-5-2-4-1 12 3-2-5-4-1 10 3-2-4-5-1 12 3-2-4-1-5 10 Thus, the insertion procedure generates a solution withT= 10, producing two sequences that achieve this value. (As mentioned earlier, however, this value is not optimal.)

We turn now to the question of how well these procedures perform. One approach to answering this question involves a comparison of heuristic proce- dures using a common set of test problems. For the purposes of illustration, we use a set of twelve 20-job Tw-problems selected from a testbed developed by Rinnooy Kan et al. (1975). These test problems, reproduced in Table 4.8 at the end of the chapter, are known to be relatively difficult to optimize.

These test problems were solved with a variety of dispatching procedures, including a random dispatching mechanism. The same problems were also solved using the greedy and insertion procedures. For the WMDD dispatching rule, we also tested the improvement available by meeting the condition of Eq. (4.2). For each problem, the experiment recorded the ratio of the heuristic

4 Heuristic Methods for the Single-machine Problem 76

solution to the optimal solution. Three performance measures were tallied: a count of the number of times the optimum was found, the average ratio of the heuristic solution to the optimal solution, and the maximum solution ratio.

The results are summarized in Table 4.1. As the table clearly shows, most basic dispatching procedures were not especially effective in solving theTw-problem.

WMDD was the clear winner, followed by the greedy and insertion techniques.

A decent heuristic usually gets within 10% of the optimum, and a really good one reliably gets within 1–2%. So WMDD is a decent heuristic, but there is still room for testing other kinds of heuristic approaches. In addition, WMDD applies only to theTw-problem, so we must study additional heuristics if we want to tackle other objective functions.

The combination of WMDD and the correction of Eq. (4.2) is not a pure dis- patching or construction procedure because it involves revisiting earlier decisions after later ones reveal they could be improved. Indeed, the correction step is a rudimentary example of asearch technique. Search techniques, such as those we describe in later sections, are fundamentally different than construction pro- cedures. Whereas construction methods start from scratch and build one sched- ule, search procedures assume that a solution has already been built, and they examine a series of alternative solutions in an effort to find improvements.