• Tidak ada hasil yang ditemukan

The Makespan with Sequence Dependent Setup Times

Dalam dokumen Scheduling (Halaman 98-103)

Advanced Single Machine Models (Deterministic)

Algorithm 4.3.2 Determining Trade-Offs between Total Completion Time and Maximum Lateness)

4.4 The Makespan with Sequence Dependent Setup Times

For single machine scheduling problems with allrj= 0 and no sequence depen- dent setup times the makespan is independent of the sequence and equal to the sum of the processing times. When there are sequence dependent setup times the makespan does depend on the schedule. In Appendix D it is shown that 1|sjk|Cmaxis strongly NP-hard.

However, the NP-hardness of 1 | sjk | Cmax in the case of arbitrary setup times does not rule out the existence of efficient solution procedures when the setup times have a special form. And in practice setup times often do have a special structure.

Consider the following structure. Two parameters are associated with jobj, sayaj andbj, andsjk=|ak−bj|. This setup time structure can be described as follows: after the completion of jobjthe machine is left in statebjand to be able to start jobkthe machine has to be brought into stateak. The total setup time necessary for bringing the machine from statebjto stateakis proportional to the absolute difference between the two states. This state variable could be, for example, temperature (in the case of an oven) or a measure of some other setting of the machine. In what follows it is assumed that at time zero the state isb0 and that after completing the last job the machine has to be left in state a0 (this implies that an additional “clean-up” time is needed after the last job is completed).

This particular setup time structuredoes allow for a polynomial time algo- rithm. The description of the algorithm is actually easier in the context of the Travelling Salesman Problem(TSP). The algorithmis therefore presented here in the context of a TSP withn+ 1 cities; the additional city being called city 0 with parametersa0 andb0. Without loss of generality it may be assumed that b0≤b1≤ · · · ≤bn.The travelling salesman leaving cityj for cityk(or, equiva- lently, jobkfollowing jobj) is denoted byk=φ(j). The sequence of cities in a tour is denoted byΦ, which is a vector that maps each element of{0,1,2, . . . , n} onto a unique element of{0,1,2, . . . , n} by relations k =φ(j) indicating that the salesman visits city k after city j (or, equivalently, job k follows job j).

Such mappings are called permutation mappings. Note that not all possible permutation mappings of{0,1,2, . . . , n}constitute feasible TSP tours. For ex- ample,{0,1,2,3}mapped onto{2,3,1,0}represents a feasible TSP. However, {0,1,2,3} mapped onto{2,1,3,0} does not represent a feasible tour, since it represents two disjoint sub-tours, namely subtour 0 2 3 0 and the subtour 11 which consists of a single city (see Figure 4.4). Defineφ(k) =k to mean a redundant tour that starts and ends atk.

For the special cost structure of going fromcityjtokit is clear that this cost is equal to the vertical height of the arrow connectingbj withak in Figure 4.5.

(a) (b)

3 1

0 2

3

0 2

1

Fig. 4.4Permutation mappings: (a){0,1,2,3} → {2,3,1,0}

(b){0,1,2,3} → {2,1,3,0}

b0

(j) = k b1

b2 bj bn

bn – 1

an ak an – 1

a1 a0 a2

Cost of going from j to k is akbj

Fig. 4.5Cost of going fromjtok

Define the cost of a redundant sub-tour, i.e.,φ(k) =k, as the vertical height of an arrow frombk to ak.

Thus any permutation mapping (which might possibly consist of subtours) can be represented as a set of arrows connectingbj, j = 0, . . . , n to ak, k = 0, . . . , nand the cost associated with such a mapping is simply the sum of the vertical heights of then+ 1 arrows.

Define now aswap I(j, k) as that procedure which when applied to a permu- tation mappingΦproduces another permutation mappingΦ by affecting only the assignments ofj and k and leaving the others unchanged. More precisely, the new assignmentΦ=ΦI(j, k) is defined as:

86 4 Advanced Single Machine Models (Deterministic)

φ(k) =φ(j), φ(j) =φ(k), and

φ(l) =φ(l)

for all l not equal to j or k. This transformation may also be denoted by φ(j) = φ(j)I(j, k). Note that this is not equivalent to an adjacent pairwise interchange within a sequence, since a permutation mappingΦdoes not always represent a sequence (a feasible TSP tour) to begin with. More intuitively, it only represents a swap of the arrows emanating frombj andbkleaving all other arrows unchanged. In particular, if these arrows crossed each other before they will uncross now and vice versa. The implication of such a swap in terms of the actual tour and subtours is quite surprising though. It can be easily verified that the swapI(j, k) has the effect of creating two subtours out of one ifjand k belong to the same subtour in Φ. Conversely, it combines two subtours to whichj andk belong otherwise.

The following lemma quantifies the cost of the interchangeI(j, k) applied to the sequenceΦ; the cost of this interchange is denoted by cΦI(j, k). In the lemma, the interval of theunordered pair [a, b] refers to an interval on the real line and

||[a, b]||=

2(b−a) ifb≥a 2(a−b) ifb < a

Lemma 4.4.1. If the swap I(j, k) causes two arrows that did not cross earlier to cross, then the cost of the tour increases and vice versa. The magnitude of this increase or decrease is given by

cΦI(j, k) =||[bj, bk][aφ(j), aφ(k)]||

So the change in cost is equal to the length of vertical overlap of the intervals [bj, bk]and[aφ(j), aφ(k)].

Proof. The proof can be divided into several cases and is fairly straightforward since the swap does not affect arrows other than the two considered. Hence it

is left as an exercise (see Figure 4.6).

The lemma is significant since it gives a visual cue to reducing costs by uncrossing the arrows that cross and helps quantify the cost savings in terms of amount of overlap of certain intervals. Such a visual interpretation immediately leads to the following result for optimal permutation mappings.

Lemma 4.4.2. An optimal permutation mapping Φ is obtained if bj bk =⇒aφ(j)≤aφ(k).

bj bk

a␸(k)

a␸(j)

Change in cost due to swap I(j, k)

Fig. 4.6Change in cost due to swapI(j, k)

Proof. The statement of the theorem is equivalent to no lines crossing in the diagram. Suppose two of the lines did cross. Performing a swap which uncrosses the lines leads to a solution as good or better than the previous.

As mentioned before, this is simply an optimalpermutation mapping and not necessarily a feasible tour. It does, however, provide a lower bound for the optimal cost of any TSP. This optimalΦ may consist of pdistinct subtours, say,T R1, . . . , T Rp. As seen before, performing a swap I(j, k) such that j and kbelong to distinct subtours will cause these subtours to coalesce into one and the cost will increase (since now two previously uncrossed lines do cross) by an amountcΦI(j, k). It is desirable to select j and k fromdifferent subtours in such a way that this cost of coalescingcΦI(j, k) is, in some way, minimized.

To determine these swaps, instead of considering thedirected graph which represents the subtours of the travelling salesman, consider the undirected ver- sion of the same graph. The subtours represent distinct cycles and redundant subtours are simply independent nodes. To connect the disjoint elements (i.e., the cycles corresponding to the subtours) and construct a connected graph, additional arcs have to be inserted in this undirected graph. The costs of the arcs between cities belonging to different subtours in this undirected graph are chosen to be equal to the cost of performing the corresponding swaps in the tour of the travelling salesman in the directed graph. The cost of such a swap can be computed easily by Lemma 4.4.1. The arcs used to connect the disjoint subtours are selected according to theGreedy Algorithm: select the cheapest arc which connects two of thepsubtours in the undirected graph; select among the remaining unused arcs the cheapest arc connecting two of thep−1 remaining subtours, and so on. The arcs selected then satisfy the following property.

Lemma 4.4.3. The collection of arcs that connect the undirected graph with the least cost contain only arcs that connect cityj to cityj+ 1.

Proof. The cost of the arcs (cΦI(j, k)) needed to connect the distinct cycles of the undirected graph are computed from the optimal permutation mapping defined in Lemma 4.4.2 in which no two arrows cross. It is shown below that

88 4 Advanced Single Machine Models (Deterministic) the cost of swapping two non-adjacent arrows is at least equal to the cost of swapping all arrows between them. This is easy to see if the cost is regarded as the intersection of two intervals given by Lemma 4.4.1. In particular, ifk > j+1,

cΦI(j, k) =||[bj, bk][aφ(j), aφ(k)]||

k1 i=j

||[bi, bi+1][aφ(i), aφ(i+1)]||

=

k1 i=j

cΦI(i, i+ 1)

So the arc (j, k) can be replaced by the sequence of arcs (i, i+1), i=j, . . . , k−1 to connect the two subtours to whichj andkbelong at as low or lower cost.

It is important to note that in the construction of the undirected graph, the costs assigned to the arcs connecting the subtours were computed under the assumption that the swaps are performed onΦ in which no arrows cross.

However, as swaps are performed to connect the subtours this condition no longer remains valid. However, it can be shown that if the order in which the swaps are performed is determined with care, the costs of swaps are not affected by previous swaps. The following example shows that the sequence in which the swaps are performed can have an impact on the final cost.

Example 4.4.4 (Sequencing of Swaps)

Consider the situation depicted in Figure 4.7. The swap costs arecΦI(1,2) = 1 and cΦI(2,3) = 1. If the swapI(2,3) is performed followed by the swap I(1,2) the overlapping intervals which determine the costs of the interchange remain unchanged. However, if the sequence of swaps is reversed, i.e., first swapI(1,2) is performed followed by swapI(2,3), then the costs do change:

the cost of the first swap remains, of course, the same but the cost of the second swap,cΦI(2,3) now has become 2 instead of 1.

The key point here is that the two swaps under consideration have an arrow in common, i.e., b2 aφ(2). This arrow points “up” and any swap that keeps it pointing “up” will not affect the cost of the swap below it as

the overlap of intervals does not change. ||

The example suggests that if a sequence of swaps needs to be performed, the swaps whose lower arcs point “up” can be performed starting from the top going down without changing the costs of swaps below them. A somewhat similar statement can be made with respect to swaps whose lower arrows point

“down”

In order to make this notion of “up” and “down” more rigorous, classify the nodes into two types. A node is said to be of Type I if aj bφ(j), i.e., the arrow points “up”, and it is of Type II ifaj > bφ(j). A swap is of Type I if its

b3

b2 b1

a␸(3)

a␸(2)

a␸(1) b3

b2 b1

a␸(3)

a␸(2)

a␸(1) Fig. 4.7Situation in Example 4.4.4

lower node is of Type I and of Type II if its lower node is of Type II. From the previous arguments it is easy to deduce that if the swaps I(j, j+ 1) of Type I are performed in decreasing order of the node indices, followed by swaps of Type II in increasing order of the node indices, a single tour is obtained without changing anycΦI(j, j+ 1) involved in the swaps. The following algorithmsums up the entire procedure in detail.

Algorithm 4.4.5 (Finding Optimal Tour for TSP)

Dalam dokumen Scheduling (Halaman 98-103)