EUROPEAN JOURNAL OF OPERATIONAL RESEARCH
ELSEVIER
European Journal of Operational Research 78 (1994) 216-223
The three-machine flow-shop problem with arbitrary precedence relations Chong John Lim *, Graham B. McMahon School of Information and Computing Sciences, Bond University, Gold Coast, Qld 4229, Australia
Abstract The scheduling problem n / 3 / F / C m a x with arbitrary precedence constraints between the jobs is studied. A branch and bound algorithm is described. Bounds are obtained by solving 2-machine subproblems which are relaxed versions of the current 3-machine problem. These 2-machine problems which have precedence constraints can be quickly solved in an optimal fashion only if the constraints are of a series-parallel (S-P) form. Using methods described in [5], we find an S-P constraints subgraph which may be solved to obtain a lower bound for each 2-machine subproblem. This provides the basis for the calculation of an effective lower bound for the 3-machine case. Computational experience with the algorithm is reported. Keywords: Scheduling; Flowshop; Branch-and-bound
1. Introduction In [5] we considered the n / 2 / F / C m a x problem with arbitrary precedence constraints. A branch and bound algorithm which utilizes a series-parallel subgraph recognition process to provide superior bounds was described. In this paper, we present some additional features to the original algorithm to address the 3-machine case. Consider a set of n jobs J where job j ~ J is characterised by processing times t(j, m ~ ) on each machine, oL= 1 , . . . , 3. Each job must complete its processing on a machine before commencing on the next. In addition, consider a set of constraints R of the form i ~ j which specify that job i must complete its processing on each machine before j may start processing on that machine. These constraints, which impose a partial order on the jobs,may be represented by a directed acyclic graph G = (J, R). Consider schedules for this task in which the jobs are processed in the same permutation o- on all three machines. It is well known that the set of permutation schedules always contains an optimum solution [1]. We introduce another symbol ~ with the meaning that if i ~ , j then i is scheduled before j in the context of the current permutation tr.
* Corresponding author. 0377-2217/94/$07.00 © 1994 Elsevier Science B.V. All rights reserved SSDI 0377-2217(94)00082-N
CJ. Lim, G.B. McMahon / European Journal of Operational Research 78 (1994) 216-223
217
The makespan C(tr) for a permutation tr is the maximum job completion time on m 3 and is determined by the sum of values along some path through the array of processing times [4]. These sums may be expressed in terms of processing times on m 1 and m 2 from some job x, processing times on m 2 and m 3 from another job y, and a single processing time on either m 1, m 2 or m 3 from each of the other jobs j ~ J - {x, y}. Provided that x and y are distinct then the sum is given by 2
3
Vxy = E t(j, m l ) + Y~ t(x, m,,) + j:j~-*x
a= 1
E
t(j, m2) + • t ( y , m,~) + ~_~ t(j, m3).
j:x'--~j'---~y
a=2
(1.1)
j:y,---~j
To assist in later discussion, let P, denote the processing times that contribute to the path value along machine a. Then Vxr = P1 4-/°2 4- P3 where el =
E t(j, m l ) 4j:j~--~x
P2=t(x, m2) +
t(x, m l ) ,
E
(1.2a)
t(j, m z ) + t ( y , m2),
(1.2b)
j:x'--~j'---~y
/'3 = t ( y , m3) +
E j:y~-*j
t(j, m3).
(1.2c)
If x = y then Pe equals the processing time of job x on
m z, and the value of the path is given by
3
Vxx= E t(j, ml) + ~., t(x, rn~) + E t(j, m3). j:j~x
a= 1
(1.3)
j:x'--~j
A path with the greatest value is called a critical path. There may be more than one critical path. Each such path defines either one or two critical jobs x and y. The critical path determines the schedule length, C(o-) = max~ _
(1.4)
The schedule with minimum makespan is found if we find tr consistent with R with minimum value of C(tr). The problem has been shown to be NP-hard [3]. Many researchers have proposed enumeration methods or elimination techniques [1] to address the n/3/F/Cm~ x problem without precedence constraints. However, such methods have not been extended to address precedence relations. Heuristics [8] have been applied to address the constrained problem but such approaches do not guarantee an optimal solution and their effectiveness is not easily measurable.
2. Branch and bound algorithm The branch and bound algorithm is similar to that for the 2-machine case presented in [5]. Briefly, the algorithm generates a binary tree of sub-problems, in which one additional constraint is added at each level. At the root, we have the original constraint set R. At each node a feasible solution is determined. For each subproblem, we assume a method of computing a lower bound on the value of any feasible permutation. This reduces the size of the search tree by removing subtrees which cannot yield a useful solution. The efficiency of the algorithm depends on the bound function and the constraint choice for the branching process. The remainder of the discussion is concerned with these aspects of the algorithm for the 3-machine case.
C.J. Lim, G.B. McMahon/ European Journal of OperationalResearch 78 (1994) 216-223
218
2.1. Branching The method begins by constructing a complete schedule at each node. Schedule construction amounts to a topological sort, for which efficient methods are well known. For nodes other than the root we can proceed more quickly by making minimum modifications to the schedule constructed at the parent node. In general, this schedule is not the optimum for the current sub-problem. Having created a schedule, the next step is to find the critical path for the schedule. This is equivalent to finding critical jobs x and y which yield the greatest value of C(o-). Every job j ~ J - {x, y} contributes a single processing time to either P1, P2 or P3 of the critical path. If this processing time is the minimum for j, then j is optimally placed for the path. Otherwise we look at ways of reducing the value of the current critical path by moving j to other sections of the path, without violating any precedence relations. This is done by introducing a precedence constraint rj on j relative to a critical job, and the value of the move is measured by ~-j. The index ~rj determines the change in the current critical path caused by moving j relative to x and y. However since other paths may become critical when this change is introduced, it represents an upper bound on the improvement in the overall makespan. We apply the obvious heuristic of finding a job j with the largest index zr/ and its corresponding constraint rj. If the critical path is of type Vxx, we consider two cases to obtain the set of jobs 12 whose reversal of position relative to x would reduce the value of this path. Case 1 (Vxx). Consider jobs j ~ {j [ j ~ x and t(j, m 1) > t(j, m3)}. Each of these is added t o / 2 if job j may be scheduled after x in the context of the current constraints set, with
Try = t ( j , mx) - t ( j , m3) and ry = x ~ j . Case 2 (Vxx). Consider next jobs j ~ {jl x ~ j and t(j, m 1) < t(j, m3)}. Each of these is added t o / 2 if job j may be scheduled before x in the context of the current constraints set, with rti = t ( j , m3) - t ( j , ml) and rj = j ~ x . If the critical path is of type Vxy, we consider three cases for the set of jobs /2 whose displacement relative to critical jobs x and y would reduce the value of this path as determined by the index value ~-. Case 1 (V~y). Consider jobs j ~ {j [ j ~ x } whose processing times on m 1 are not the minimum. For each of these, we attempt to position its minimum processing time, mini, on the critical path. If mini is on m 2 and job j may be scheduled between x and y in the context of the current constraints set, then j ~ O with
rt/= t ( j , rnl) - t ( j , m2) and r / = x ~ j . If mini is on m 3 and j may be scheduled after y, we add j to 12 with
"trj=t(j, m l ) - t ( j
, m3) and r / = y ~ j .
If constraints do not permit m i n / t o be used, the processing time on the remaining machine is used as above if it is smaller than t(j, ml). Case 2 (Vxr). Consider next jobs j ~ { j l x ~ j ~ y } whose processing times on m 2 are not the minimum. Job j ~ 12 if mini is on m 1 and job j may be scheduled before x in the context of the current constraints set, with
7rj=t(j, m 2 ) - t ( j ,
ml) and r / = j ~ x .
If m i n / i s on m 3 and j may be scheduled after y, then j ~ 12 with
rrj= t( j, m2) - t( j, m3) and rj= y --->j.
C.J. Lira, G.B. McMahon / European Journal of Operational Research 78 (1994) 216-223
219
If constraints do not permit mini to be used, the processing time on the remaining machine is used as above if it is smaller than t(j, m2). Case 3 (Vxy). Finally, we look at jobs j ~ { j l y ~ j } whose processing times on m 3 are not the minimum. If mini is on m~ and job j may be scheduled before x in the context of the current constraints set, then j ~ ~ with
~'j = t(j, m3) - t(j, ml) and rj =j--~x. If min s is on m 2 and j may be scheduled between jobs x and y, then j ~ / 2 with
zrj= t( j, m3) - t( j, m2) and r j = x - ~ j . If constraints do not permit mini to be used, the processing time on the remaining machine is used as above provided it is smaller than t(j, m3). If the set /2 is empty then we already have the optimum schedule for the current constraints. Otherwise, we choose the job j ~ O with the greatest 7rfvalue. Introduction of its associated constraint ri will give a maximum reduction in the value of the current critical path. Two subproblems to the current node are then derived by introducing constraint rj in the left child and the reverse of rj. in the right child. This method of branching attempts to exercise good discrimination high in the tree, independent of the chronological location of the constraint introduced. Theorem 1. Any solution of a sub-problem thus generated is also a solution to the original problem. Proof. The proof is obvious; for each sub-problem, extra constraints are added, but none of the original problem constraints are relaxed. []
2.2. Bounds At each node of the search tree, we have a set of constraints, some of which were in the original problem, the remainder having been introduced by the branching process. In the 2-machine case, the constraints graph is modified by the S-P subgraph recognition process described in [5] to derive an S-P problem which can be efficiently solved using the technique of Sidney and Monma [6,7]. Since we then have an optimum solution to a relaxed version of the 2-machine problem, the resulting makespan is a lower bound on solutions to that problem. We extend this idea to the 3-machine case as follows. At each node with problem M, we consider three 2-machine problems, denoted M12, Me3 and M13. For subproblem M12 we consider processing times on machines m 1 and m2, and a bound is obtained using the technique described in [5]. It is then adjusted to yield bound b12 by adding the smallest processing time t(j, m3). Similarly, adjusted bound b23 is calculated by adding the smallest processing time t(j, ml) to the bound obtained for M23. Further details on these bound calculations appear later in this section. In practice, a more sophisticated technique is used which modifies these calculations and sometimes produces a better bound [4]. For sub-problem M13 we consider the 2-machine problem [2] having processing times
t( j, m'l) = t( j, ml) + t(j, m2) and t( j, m'2) = t( j, m2) + t( j, m3). Using the S-P decomposition method, a bound is obtained for deducing the sum of the original processing times of m 2.
MI3 ,
which is adjusted to yield b13 by
220
C.J. Lim, G.B. McMahon/ European Journal of OperationalResearch 78 (1994) 216-223
Lemma 1. Adjusted bounds b12, b23 and bl3 provide a lower bound to the largest value of Vxy. Proof. We begin the proof by restating the n / 3 / F / C m a ~ problem with precedence constraints R as the task of finding the minimum makespan from the set of permutation schedules consistent with R (cf. (1.4)), minn[maxl ~ x ~ y ~ n(V~y)] • Given a fixed permutation, it is clear that
maX l < x < y < n( l/xy ) >~max l <_x <_y=n( Vxy ) and for any R'c_ R, noting that a less constrained problem may have a smaller solution, it follows that
(2.1)
min.e[maXl minR,[maxl<_x~y=n(Vxy)].
Consider now the schedule generated for the 2-machine subproblem M~E. If no constraints are relaxed by the S-P subgraph recognition process [5], the schedule is optimum for M~2. Otherwise, the schedule generated is an optimum for a relaxed version of the 2-machine subproblem and its makespan is a lower bound for M12. Let R' denote the constraints set after applying the S-P subgraph recognition process to M12. Then adjusted bound (cf. (1.1))
b~z=minR'[ m a x l s x s n {
~
ml) + t ( x , m l ) + t ( x , mz) +
+ m i n j [ / ( j , m3) ] .
~
m2))] (2.2)
It remains to show that the right-hand expression of (2.1) > (2.2). We commence with the right hand side expression of (2.1) and expand Vxy using the special case for path expressions of (1.2) where y = n. Then P3 consists of a single processing time t(n, m3). Since n ~ {j:x ~ j } ,
P2 = t( x, m2) + E t( j, mz). j:x.--~j Total path value for the special case is then
Completing the evaluation of (2.1), we take the minimax of (2.3) over the set of permutations consistent with R'. We then have min,,[maxl _~~ _~y=n(Vxy)] >- b12
(2.4)
since minJ[t(j, m3)l is used to obtain the adjusted bound in (2.2). From (2.1) and (2.4) it follows that b12 is a lower bound to the largest value of Vxy. A similar argument applies for M23, where bound b23 is the minimax to paths of type V~y with path expression P1 contributed by a single processing time minj[t(j, ml)]. For M13, the discussion in [2] may be used to show that adjusted bound b13 is a lower bound to all possible values of V~x. [] Theorem 2. B = max(b12, b23 , b 3) is a lower bound for M.
221
C.J. Lim, G.B. McMahon / European Journal of Operational Research 78 (1994) 216-223
Proof. The l e m m a shows that all three adjusted bounds provide a lower bound for the largest possible path value. It follows then that the makespan of the current problem will not exceed the largest of these bounds. []
3. E x a m p l e
The following example serves to illustrate the branch and bound features described in the previous section. We assume that the main algorithm has proceeded to a stage where a node in the enumeration tree has permutation schedule tr constructed using topological sort (Fig. la) according to constraints set S (Fig. lb). S consists of the set of original constraints R and a series of constraints added by the branching process prior to arriving at this node. 3.1. Branching
The critical path for ~ is identified as V54o Every job j • {1, 2, 3, 6} does not contribute mini to V54. Any improvement from j ~ {1, 2, 6} to this path is prevented by S. That leaves job 3 with min 3 on m 2 which may be scheduled after critical job 5 with ~'3 = 2 and r 3 = 5 ~ 3. Branching from this node proceeds with the addition of 5 ~ 3 to form its left node, and 3 ~ 5 to form its right node.
m 1m2 m3
J =
!4°1
1 3 5 2 6 4
4
8
-~ 4 37,2 4 ~ 2 5
S :
3--2
(b) Constraints set S
(a) PermuU~tion o with critical path
J
M,2:
2 5 6 3
7j
mlm2
6 5
4
4
(c) Lower bound of 38 for MI 2-
M23:
j
m2 m 3
j 1
m; m~ 1,3 lo
3 2 5
~ a 7, 2 ~ 4
3
10
12
6 4
~ 2 3-2
5 6
i ~
10 7
4
8~5
(d) Lower bound of 31 for M23. Fig. 1.
J
.J
(e) Lower bound of 69 for MI3.
C.J. Lim, G.B. McMahon/ European Journal of Operational Research 78 (1994) 216-223
222
3.2. Bounding B o u n d blz is o b t a i n e d by c o n s i d e r i n g first t h e s u b p r o b l e m M12 consisting o f p r o c e s s i n g times on m a c h i n e s m I a n d m 2. S is n o t S-P d u e to t h e f o r b i d d e n s u b g r a p h [9] i d e n t i f i e d by b o l d arrows in Fig. l b . T h e S-P s u b g r a p h r e c o g n i t i o n p r o c e d u r e [5] relaxes t h e c o n s t r a i n t 5 ~ 2 to c o n s t r u c t an S-P s c h e d u l e (Fig. l c ) w h o s e m a k e s p a n o f 38 is a lower b o u n d to t h e M12 s u b p r o b l e m . This b o u n d is a d j u s t e d by a d d i n g m i n j [ t ( j , m3)] to give b12 = 40. Similarly, an S-P s c h e d u l e (Fig. l d ) is c o n s t r u c t e d for M23. Its m a k e s p a n o f 31 is a lower b o u n d to M23 a n d is a d j u s t e d to give b23 = -34 by a d d i n g m i n j [ t ( j , ml)]. S u b p r o b l e m M13 f o r m u l a t e d by i n c o r p o r a t i n g t(j, m 2) in p r o c e s s i n g t i m e s on m I a n d m 3 is solved by t h e S-P p r o c e d u r e to yield a lower b o u n d v a l u e o f 69 (Fig. l e ) . This is a d j u s t e d to give b13 = 40 by d e d u c t i n g t h e s u m o f p r o c e s s i n g times on m 2. A lower b o u n d to t h e p r o b l e m at this n o d e has value B = max(b12, b23 , b13) = 40.
4. Results T a b l e 1 shows t h e c o m p u t a t i o n a l results o f a p p l y i n g t h e b r a n c h a n d b o u n d a l g o r i t h m with S-P assisted b o u n d s . I n t h e cases l a b e l l e d uniform, t h e p r o c e s s i n g t i m e s w e r e r a n d o m l y c h o s e n integers f r o m t h e r a n g e 1 to 100. F o r t h e cases l a b e l e d correlated trend t h e p r o c e s s i n g times m 1, m 2 a n d m 3 a r e c o r r e l a t e d , a n d e i t h e r m t o r m 2 o r m 3 t e n d s to b e larger. T h e a l g o r i t h m was t e s t e d on p r o b l e m s o f various sizes a n d with d i f f e r e n t n u m b e r of r a n d o m l y g e n e r a t e d constraints. T h e n u m b e r o f c o n s t r a i n t s is e x p r e s s e d as a p e r c e n t a g e o f t h e n u m b e r o f jobs. F o r e a c h case, 20 d i f f e r e n t p r o b l e m s w e r e solved. S o l u t i o n was a b o r t e d if m o r e t h a n 5000 n o d e s w e r e r e q u i r e d . A n a s t e r i s k in t h e table i n d i c a t e s t h a t s o m e o f t h e p r o b l e m s in t h e g r o u p o f 20 w e r e a b o r t e d a n d t h e s e u n s o l v e d p r o b l e m s w e r e o m i t t e d from t h e figure given. A p e r c e n t a g e o f t h e p r o b l e m s a b o r t e d is also p r o v i d e d . T h e a l g o r i t h m was c o d e d in Pascal, a n d runs on a M i c r o v a x 3600 c o m p u t e r .
Table 1 Computational results No. % Con- Uniform Jobs straints No. nodes
5 10 20 50
25 50 100 25 50 100 25 50 100 25 50 100
Min
Max
Av.
3 1 1 3 1 3 65 43 37 783 531 397
11 7 5 107 59 13 573 307 183 4177" a 4326* 4033*
6 4 3 31 20 7 151 97 51 2955* 3898* 3732*
No. nodes to best solution
Av. CPU time (seconds)
8 5 3 90 54 7 374 283 152 3561" 3747* 3317"
0.538 0.411 0.267 12.98 8.584 3.368 434.5 193.4 125.1 8531 *(65%) ~ 7967 *(40%) 6192 *(35%)
Correlated-trend No. nodes Min
Max
3 1 1 5 3 1 57 29 21 617 493 329
13 6 7 3 3 2 11 9 11 7 11 5 415 127 373 73 135 39 3981" 2443* 3 7 1 2 " 3649* 4665* 3462*
a *: indicates unsolved problems are omitted form these figures. b ( ): indicates percentage of problems in each group of 20 that were aborted.
Av.
No. nodes to best solution
Av. CPU time (seconds)
9 4 2 8 7 6 298 278 116 3066* 3213" 3816"
0.598 0.272 0.227 3.796 2.969 2.378 339.4 187.0 101.9 7907 *(55%) 7647 *(35%) 5704 *(15%)
C.J. Lira, G.B. McMahon / European Journal of Operational Research 78 (1994) 216-223
223
The algorithm is efficient for small jobsets but cannot solve all problems when n = 50. However, for this case, approximately half of the problems were solved. The number of constraints, up to a value equal to the number of jobs, appears to systematically reduce the problem difficulty. In all cases solved, the best solution is found quickly, and most of the computation time is spent proving optimality. The introduction of correlations and trends in the data makes problems easier to solve. Since the algorithm generates complete solutions at every node, it also has the feature that should a difficult problem be discovered, the algorithm may be stopped at any stage and the best solution accepted, with a high probability that this solution is the optimum.
References [1] Bellman, R.E., Esogbue, A.O. and Nabeshima, I., Mathematical Aspects of Scheduling and Applications, Pergamon, Oxford, 1982. [2] Johnson, S.M., "Optimal two- and three-stage production schedules with setup times included", Naval Research Logistics Quarterly 1 (1954) 62-68. [3] Lenstra, J.K., and Rinooy Kan, A.H.G., "Complexity of scheduling problems under precedence constraints", Operations Research 26/1 (1978) 22-35. [4] Lim, C.J., Ph.D. Thesis, Bond University, to appear. [5] McMahon, G.B., and Lim, C.J., "The two-machine flow-shop problem with arbitrary precedence relations", European Journal of Operational Research 64 (1993) 249-257. [6] Monma, C.L., "The two-machine maximum flow time problem with series-parallel precedence relations: An algorithm and extensions", Operations Research 27 (1979) 792-798. [7] Monma, C.L., and Sidney, J.B., "Sequencing with series-parallel precedence constraints", Mathematics of Operations Research 4 (1979) 215-224. [8] Taillard, E., "Some efficient heuristics methods for the flow shop sequencing problem", European Journal of Operational Research 47 (1990) 65-74. [9] Valdez, J., Tarjan, R.E., and Lawler, E.L., "The recognition of series-parallel digraphs", in: Proc. Eleventh AnnualACM Symp. on Theory of Computing, Atlanta, GA, 1979.