The set of resources: There exists a set of s different types of renewable resources (R,[ 1
ZOR - Methods and Models of Operations Research (1992) 36:497-516
Scheduling Unit-Time Tasks in Renewable Resource Constrained Flowshops H. Sfiral a, S. K o n d a k c l 1'2 and N. Erkip I
Abstract: In this paper we address the problem of scheduling unit time jobs in a flowshop to minimize makespan under a discrete renewable resource constraint. We propose algorithms having complexity O(n) for special cases of two machine and three machine problems. For the three machine NP-hard problem we develop a branch and bound procedure and several upper and lower bounds. We test the efficiencyof the procedure and report our computational experience.
Key words: Scheduling, resource constraint, flowshop.
1 Introduction
The resource constrained scheduling is one of the new directions in deterministic scheduling (Lenstra/Rinnooy K a n (1984)). M o s t of the research effort in this area has been devoted to the problems involving parallel machines (Yao (1975), G a r e y et al. (1976), Slowinski (1980) and (1984)). Surveys of the resource constrained scheduling problems can be found in Blazewicz et al. (1983) and (1986) and Blazewicz (1987). The resource constrained shceduling problem that we consider can be described by the following four sets of parameters: I. The set of machines: Flowshop consists of a set o f m machines {Mi[ 1 ~ i ~ m}. II. The set of resources: There exists a set of s different types of renewable resources (R,[ 1 1 construct Stk) where Jk ~ {Je, J0, Jc}. = 2, [Jb[ >- 1 and [Ja[ -> 1 construct Sb: and Sa:. = an odd n u m b e r [J:[ = [Jh[ = 1 and [Jk[ = 0 for each Jk e {Jb, Jd, Je, Jg} Construct Shl and Sh2. - Case AI: [J,[ < 2 Define S 1 = {j:, Shl, Stc),j,, Sh2}. S 1 is optimal. - CaseA2:lJa[ > 2 Define S 2 = {j:,j,, S~c),j,, Shl, Sh2,J . . . . . . j,}. S 2 is optimal. Case B: [Jb[ > 1 or [Ja[ > 1 Construct Sb: or Sa: and I: = 1: - 1. Case C: Case A and Case B do not hold M a k e J: even by taking out a single j o b j : from the set. Step 5. F o r [Jkl --> 1 construct Stk ) where Jk ~ {Jb, Jn, Jh}. N o t e that S h and S(h) are constructed separately. F o r ]J:[ > 2 construct S:: and St::). Step 6. Define S = {Sb:, S(e), Sff, S(h), Sh, S(ff), S(o), Sdf }. Insert Sty) in between any two n o n - e m p t y partial schedules in S. If it is not possible, insert Sty) in S such that a n o n - e m p t y partial schedule in S except Sto) and Sn: precedes it. Fill the idle times between successive partial schedules in S by ja'S. U p d a t e J,. Step 7. Choose one of the following cases in the order given below. Case D: I: = an even n u m b e r (zero included) Define S 3 = {S(b), S, S(d), j . . . . . . Ja}" $3 is optimal. Case E: I: = an o d d n u m b e r Case El: The last n o n - e m p t y partial schedule in S is an
Step Step Step Step
1. 2. 3. 4.
Sort out F o r ]Jk] F o r ]J:l F o r IJfl Case A:
-
SchedulingUnit-TimeTasks in RenewableResourceConstrainedFlowshops
505
element of the set {Soy,S(o, S(c)}. Define S" = {S,A .... ,A,Jy}S* is optimal. - Case E2: The first non-empty partial schedule in S is an element of the set {S(c), S(g), Say). Define S 5 = {JI, J~.... ,j~, S}. S s is optimal. - Case E3: [J~[ < 1 Construct 8:1 and Ss2 and define S 6 = {S:x, S,j,, S:2}. S 6 is optimal. - Case E4: IJ~l > 2 Define S 7 = {Jl,J~ ..... j~, S}. S 7 is optimal. The proof that the algorithm solves the problem optimally is given in Appendix II. The algorithm sorts (r + 1)" job types, where r is the maximum resource requirement of operations and m is the number of machines. We need O(r'n) time to sort all types of jobs. Since r and m are fixed to 1 and 3, the complexity of the algorithm is O(n). To illustrate the algorithm consider a six job F3/resl 11,Pu = I/Cmax problem where
R(JI)=R(J2)=R(J3)=[i 1 R(J4) R(J~) =
R(J6) =
=
9
We have the job types J:, J,, Jc and Je, where J: = {J1, J2, J3}, Jh = {Ja}, J~ = {Js} and J~ = {J6}- We construct S(e) and S(c)in step 2. Since [J:l = 3, and case C holds in step 4, we take out a job from set Js. Sh and SI: are constructed in step 5. In step 6, we obtain S = {S(e), S(c), Sy:, Sh}. We construct Sit and Ss2 in step 7. Hence, the optimal schedule S = {S:1, S(~), S(,), SI:, Sh, S:2) having Cmax = 12 is as follows.
i~ 6 1i
Z 51 o//~//
I1
I~
~
"
,
I~
4
506 5
H. Siiral et al. The F 3 / r e s l . . , p o
-
l/C,*ax Problem
F3/resl..,pii = 1/Cm~x is NP-complete in the strong sense (R6ck (1984)). We therefore restrict ourselves to an implicit enumerative approach; the branch and bound (BAB) procedure. Though we study the three machine problem in detail, we develop the BAB procedure for the general m machine case.
5.1
The Branch and Bound Algorithm
The proposed BAB algorithm can be characterized in terms of the following parameters (Ibaraki (1982)). (i) Branching Rule: Each node in the BAB tree consists of operations to be processed at time slot t. Each time slot t corresponds to the t th level of the tree. (ii) Selection Rule: Breadth first strategy is used. In case of a tie, the node with the highest level in the tree is selected. (iii) Upper Bounding Rule: Four approximation algorithms, AA1, AA2, AA3 and AA4, are developed in an effort to find a tight upper bound for the problem. The algorithms make use of an extension of the list scheduling procedure given in Yao (1975) and differ from each other in generating the initial list. In addition, algorithms AA3 and AA4 work for a problem in which the precedence relations between operations are reversed, i.e., machine ordering is Mm. . . . . M2, M1. Each algorithm initially forms a list comprised of operations in the nonincreasing order of their resource requirements. In case of ties, AA1 and AA4 order the operations in nonincreasing order of their machine index numbers while AA2 and AA3 order them in nondecreasing order. Upon the construction of a list, all algorithms assign operations to the earliest time slot in which they will fit without violating the resource and the precedence constraints. (iv) Lower Bounding Rule: Let vector (i,j) denote the operation of job j on machine i. Let S' be the set of all (i, j) not yet scheduled and let S be the set of all (i,j) already scheduled. Let N' = {(i,j): (i,j) ~ S' and i = m}.
9 Job-Based Bound: At any node, the lower bound on the makespan for m machines is LB1 = Cma.(S) + max{(m - 1) - Cm=(S), 0} + IN'I where Cr,ax(S) is the maximum completion time of the operations in S. For three machines the bound reduces to LB1 = Cmax(S) --]-max{2 - Cm,~(S), 0} + IN'[ .
SchedulingUnit-TimeTasksin RenewableResourceConstrainedFlowshops
507
We expect the lower bound to perform well when the number of jobs, rather than the resource requirements and the resource availability, determines the makespan.
9 Resource-Based Bound: The bound,
(i,j) ES"
where
u=
u (1,j)ES' max
max (ra,j) sS"
1
{10 if Cmax(S)=0, otherwise,
is expected to perform well when the resource constraint is rather tight. The second term, 1, accounts for the unavoidable time unit when the last operation on the last machine is processed. Similarly, u accounts for the processing of the first operation on the first machine; it becomes zero if S ~ ~ in which case the processing of the first operation on the first machine is already accounted for in Cma~(S). The last term corresponds to the minimum number of time slots needed to schedule the remaining operations. We obtain the lower bound for three machines by substituting 3 for m in the above expression for LB2.
Parallel-Machine Bounds: First Fit (FF) and First Fit Decreasing (FFD) are well known bin packing approximation algorithms which are applicable to parallel machine environments. These algorithms yield lower bounds for flowshop problems since ignoring the processing order and machine requirements of jobs in a flowshop, we obtain a parallel machine environment. We established a number of such lower bounds based on their worst-case behavior analysis (Garey et al. (1976), Krause et al. (1975)). Here we only present the lower bound which was found to be the most effective in our experiments. Let L be the makespan of the unscheduled jobs that the FFD approximation algorithm produces and L* be the optimal solution value for the same set. We have 9
LB3 = Cm~(S) + [3/4L] since L < (4/3)L* as reported in Garey et al. (1976). (v) Elimination Rule: An active node in the tree is eliminated in three cases:
9 Bound Dominance (El): If the lower bound of a node is greater than or equal to the currently known upper bound, the node is fathomed. 9 Family Dominance (E2): Let p and p' be the two nodes among the children of a parent node. Let Dp and De, be the set of operations corresponding to nodes p and p', respectively. Then p' dominates p if De _ Dp,.
508
H. Siiral et al.
9 Job Dominance (E3): Let V = {Jj: rij = 0, i = 1. . . . . m - 1}. The following proposition directly follows.
Proposition: In searching for an optimal solution to Fm/res .... Po = 1/Cmax problem, the schedules starting with J~ ~ V can be eliminated if there exists at least one job not contained in K
5.2
Computational Experience
The algorithms are coded in F O R T R A N IV and run on the B U R R O U G H S systems serial 1056, A9/F at the Middle East Technical University. (i) Implementation of Rules To reduce the computational effort the following strategy is employed 9 All approximatio n algorithms are used to find an initial feasible solution. AA1 is used at each branching node while AA2 is used once in every ten branching nodes. 9 The lower bounds LB1, LB2 and LB3 are implemented in all computational experiments. 9 All elimination criteria are implemented. (ii) Test Problems The resource requirements, r~j's, are generated from a discrete uniform distribution in the range [0, rh] where rh denotes the m a x i m u m amount for the resource requirements of the operations in problem set h. The following three problem sets are generated. Set n= Set run Set n= a =
1: rii ~ U[0, 1], i.e., resl.1; 10 test problems are generated for n --- 6 and for 12, and tested for a = 1 and a = 2. 2: r~j ,-~ U[0, 21 i.e., resl.2; 10 test problems are generated for n = 10, and for a = 2 and for a = 5. 3: rij ~ U[0, 3], i.e. resl.3; 20 test problems are generated for n = 8 and for 12. We tested the first group for a = 3 and for a = 4 and the latter group for 4 and for a = 5. Ten problems of the latter group are run for a = 3.
(iii) Results Table 2 presents the computational results. The problems that could not be solved within 900 seconds were discarded. The number of partial solutions that could be generated in 900 seconds was approximately 95 000. The performance of the algorithm for these problems is not reported in the table. The results of "resl 11" type problems are also presented for comparison purposes. The results can be classified according to the difference factor "d" between the resource availability and the m a x i m u m resource requirement of operations. The
Scheduling Unit-Time Tasks in RenewableResourceConstrained Flowshops
509
difference between the problems with d = 0 and the problems with d > 0 in terms of the number of nodes examined is considerable. Most of the problems with d > 0 could be solved within 10 minutes while more than half of those took less than 20 seconds. On the other hand, 20~ of the problems with d = 0 are unsolved within a time limit of 15 minutes. However, more than half of these problems are solved within 30 seconds. As expected, LB1 is found to be superior to LB2 in the problems with d > 0 while LB2 is preferred to LB1 in the problems with d = 0. As can be observed from Table 2 the performance of LB3 was poor for all problem types. When we exclude the problems solved at the root node, E2 reduces the tree to be examined to half in most of the problems. E1 is also highly effective in pruning the search tree. Approximation algorithms perform well for the problems with d > 0. An increase in the number of jobs affects the performances of the algorithms. Average percent error slightly increases while the frequency of the optimal solution found by the algorithms decreases. (iv) Remarks on Computational Experiments Computational experiments indicate that both the maximum amount for the resource requirement of operations and the resource availability have considerable effect on the solution time. An increase in the resource availability for a problem leads to substantial decreases in solution times. On the other hand, an increase in the maximum amount for the resource requirement of the operations increases solution times drastically. Computational experiments confirm that the use of elimination criteria reduces the search effort considerably. It may be worthwhile to do further research for developing stronger elimination criteria. AA1 and AA3 are more effective than the other approximation algorithms in finding the optimal or near optimal solutions in all problems types. The effectiveness of each algorithm depends on the resource availability in all problem types. However, it seems worthwhile to test the performances of the algorithms for larger problems.
6
Conclusion
The extension of list scheduling algorithms to the resource constrained flowshop scheduling problems leads to an optimizing algorithm, Algorithm 1, with complexity O(n) for two machine res122 problem and the well performing approximation algorithms, AA 1 and AA3, for three machine resl., problem. Hence, the list scheduling approach seems promising in devising approximation algorithms for more general problems.
37.5
69.2
0
100
number of nodes**
E2
E1
Median % of nodes eliminated
95 100 15.5
100 100 28.6
LB1 LB2 LB3
Maximum (%)
0 100 0
42.1 89.8 0
LB1 LB2 LB3
66.8
807
E1
32.2
18.6
100
100
E1
E2
69
67.8
16562
362
E2
Median (%)
Mean % of nodes eliminated
Max. % of nodes eliminated
max.
32
1
248.3
median
3.6
1.2
0.1
solution times (CPU)
median
max
10
10
number of problems
100 0 0
t00 0 0
100 0 0
I00
100 100 0 0
0
100
0
100
0
1
1
0.2
0
100
0
100
0
1
1
0.1
0.1
10
12
0.2
6
12
6
n u m b e r of jobs(n) 10
"res 121"
Problem Types
"res 111"
Table 2: Computational results
100 0 0
100 0 0
5.2 100 0 100 100 3.3
100
0
100
0
100
0
1
1
0.2
61.8
26
100
66.2
73.3
0
680
t0
6.7
0.1
10
10(1)* 0.6
10
res152"
10
"res122 . . . .
92.5 100 22
43.2 95.3 9.3
60.3
51
100
65.4
7.4 100 4.1
0 100 0
55.2
34.6
100
63
53
42.2
54.3 68.4
20521
210
1358 39593
203.1
563.3
2.4
t0 (4)
20 (6) 24
12
8
"res 133"
100 100 18.3
77.4 81.8 1.8
82.1
35.6
99.3 97.5 34
80.7 79.2 2.4
64.7
57.5
84.3
65.4
65.7 100
70.3
58.4
47735
1874
851.6
16.7
20 (s)
12
76
55.1
30117
438.5
316.8
3.7
20
8
"res143"
100 82.9 5.4
100 0 0
81.8
25.5
100
65
100
0
28879
1
363.4
0.2
20
12
res153"
Scheduling Unit-Time Tasks in Renewable Resource Constrained Flowshops
"OOOO
~OO
OOOO
OOOO
"O
too
8 8
r.:r
oo
.~
2~
511
512
H. Siiral et al.
Grouping jobs according to the resource requirements results in an optimizing algorithm, Algorithm 2, with complexity O(n) for three machine resl 11 problem. The results indicate that it may be possible to develop efficient algorithms using the grouping approach for the general problems having fixed number of job types.
Acknowledgement:The authors wish to thank the referees for their helpful comments.
Appendix 1 In this appendix we prove that Algorithm 1 finds the minimum makespan schedule for F2/res122,po = 1/Cmax problem, We first give definitions necessary for the proof. Consider a schedule where k jobs are scheduled with Cma~ = k + 1 and the available resource is fully utilized at all time periods except possibly at the first and last periods. We define the interval of length k - 1 excluding the first and the last periods of the schedule as the interval of complete utilization. Note that during this interval both machines are also fully utilized. We create a pseudo job combining the first operaton of the first job with the second operation of the last job in the above schedule.
Proof of Algorithm 1: Let tr be the set of all jobs to be scheduled. Let a' be the set of jobs that constitute partial schedules where partial schedule j has an interval of complete utilization of length Ti. Let the pseudo jobs obtained from these partial schedules together with the jobs in a - a' constitute tr". Let S* be the optimal schedule for jobs in a and S** be the optimal schedule for jobs in tr". Then the following relationship is true.
CmR,(S*) = CmR,(S**) +
Tj
(1)
J
Let S be the schedule of jobs in a, which is obtained by Algorithm 1. We show that Cmax(S)is equal to Cmax(S*). Define n~j as the number of jobs that require i and j units of resource on machines 1 and 2, respectively. The below given steps are followed in the proof. Step 1. For a given combination of nlfs construct a' and o-". Step 2. It can be shown that the number of different job types in a" is small (at
Scheduling
Unit-Time
T a s k s in R e n e w a b l e
Resource
Constrained
Flowshops
513
most three). Therefore, S** can be found by complete enumeration and Cma,,(S**) can be calculated9 Step 3. Compare CI~x(S) with Cm,~(S*). There are 14 possible distinct n~j combinations that can be obtained. For each of these combinations we performed steps 1 through 3 and showed that Cm,(S) = Cm~(S*) in each case. We demonstrate the proof for one of these 14 cases9 Let (i, j) denote a job type that requires i and j units of resource in the first and second machines, respectively where i = 0, 1, 2 and j = 0, 1, 2. Each of the job types (2, 0), (1, 1) and (0, 2) constitute an interval of complete utilization within themselves each producing a pseudo job of the same type. The interval lengths are n2o - 1, nxl - 1 and no2 - 1 for job types (2, 0), (1, 1) and (0, 2), respectively9 Therefore, we can disregard these jobs in our proof without loss of generality. Consider a set of jobs a with lal = n21 + n22 + n12 + nlo + noo + no1. Let the following conditions define the specific case we will consider. a. n12 > n21 d-/'/01 b. noo > n22 + n21
Using Algorithm 1 we find schedule S yielding
Cmax(S) =
n21 + 2n22 + 2n12 +
//10"
Let ~o denote the number of pseudo jobs with resource requirements i and j on machines 1 and 2, respectively. From (a)
tl) ~ /'/'/12 9
/'//12 --
~
/~22 dr- /'/22
9
n22
~
and
7121
~ ~ = T1 =/'/21
.(\)
1~22 ~
Furthermore,
From (b)
1'/21
'.(2) ~12 =
n 1(1) 2 -- //01
999 '. ~( 31)2 =
'"1(2) ~ 1 2 dr- /~12
/ / 0(1) 0 ~
_ (1_) - / / 0 0 - - 1122
1,
- 1, /'/12 "
=
1 and
~ T~ = T1 + T2 =
fioo=l
and
nzl + 2nol
~Tj=TI+T2+Ta = n2x + 2nol + zn2z
9 Tn(2) (1) 9 9 " 0 0 ----- / / 0 0 "4" /~00
9
Hence la"l = ,,x2 .,(3> + nlo + n (2) 00- Since a" contains only three types of jobs and conditions (a) and (b) imply that n12 (a) > _(2) "00, we can find Cmax(S**
) =
nl0
From equation (1)
^.(3_)
-q- z~r~12 .
514
H. Siiral et al.
Cmax(S*) = Cmax(S$*) -~ Z Tj J
When we substitute n~is into the above equation we obtain Cm.~(S*) = nlo + 2n22 + 2n12 + n21 which is equal to Cm.,,(S). Hence the schedule produced by Algorithm 1 is optimal. Q.E.D.
Appendix 2 In this appendix we prove that Algorithm 2 finds the minimum makespan schedule for F3/resl 11,pij = 1/Cm.~ problem.
Proof of Algorithm 2: One can easily verify that the algorithm considers all possible job type sets for all possible cardinalities. Recall that the algorithm produces seven different schedules. First, consider two schedules produced by Step 4 where s 1 = {j~, s ~ , s ~ , A ,
Shd
s 2 = {is, L, s ~ , L , s ~ , s ~ , L . . . . . L} The completion time and the lower bound of S 1 can be expressed as Cmax(S~ ) = { 2 + / y + I D + I c + I , + I }
and
LB(S 1) = max{1, + 2, If + 2} + (If + lc + 1) where I k IJk[, ID represents the inevitable idle time of unit length before we place the first job type c, and 1 represents the effect of job type h. Comparing Cm,x(S1) with LB(S 1) for I~ < 1 we define two subcases: ----
Subcase a: If la = 0 then Cma,,(S1) = LB(S 1) Subcase b: If/, = 1 then Cma,,(S1) = LB(S 1) + 1 .
Scheduling Unit-Time Tasks in Renewable Resource Constrained Flowshops
515
However, it is evident that such an additional time slot is unavoidable. Hence, the algorithm produces the optimal schedules for those cases. Similarly, it is true for S 2 since Cmax(S2) = LB(S 2) where Ia > 1. Now, consider the schedule defined at Step 6. The schedule S contains a permutation in which at most eight different partial schedules are combined. It means that the number of subeases that permutaton yields is 2 8. However, one can easily verify that whenever S has at least one partial schedule in which resources are fully utilized in each time slot, makespan of the permutation is equal to its lower bound. It follows that the number of subcases is reduced to 2 4. Here, one subcase consists the null set, and four subcases consist the case in which a single partial schedule is contained. The proof for those subcases is trivial. Furthermore, the equality of the makespan to the lower bound is valid for the subcases, where at least two partial schedules, namely, Sb: or Ste) and Sd: or Stg) are contained in S. The only two subcases, where
S = {Sb:, S(~)} and S = {S(g), Sd:} are exceptions to that verification. However, it is not difficult to see that the makespan of two subcases should be one unit more than their lower bounds. The way that S(c) is combined with the permutation does not violate the structure of the schedule since, including Sic) in S increases the makespan of S by an amount equal to lc except for the schedule contaning only one of the elements of {S::, S(h), Sh, St::)}. Again, it is not difficult to see that the makespan of S for the exceptional cases should be one unit more than their lower bounds. Note that these are valid if we do not have sufficient number of Ja type jobs to fill the idle time slots in S. Otherwise, the makespan of S is equal to its lower bound for all subcases. The proof is similar for the schedules S 3, S 4, S 5 and S 7. For the schedule S6, it is apparent that Cmax(S 6) ~- LB(S 6) when Ia = 0. If Ia = 1 then Cmax(S 6) ~LB(S 6) + 1. Here, an additional time slot is unavoidable. Hence, all schedules produced by the algorithm are optimal. Q.E.D.
References
Baker KR (1974) Introduction to Sequencing and Schedulin#. J. Wiley and Sons, New York Blazewicz J (1987) Selected Topics in Scheduling Theory. Annals of Discrete Mathematics 31: 1-60 Blazewicz J, Kubiak W and Szwarcfiter J (1988) Scheduling Unit-Time Tasks on Flow-Shops Under Resource Constraints. Annals of Operations Research 16:255-266 Blazewicz J, Lenstra JK and Rinnooy Kan AHG (1983) Scheduling Subject to Resource Constraints: Classification and Complexity. Discrete Applied Mathematics 5:11-22
516
H. Siiral et al.
Blazewicz J, Cellary W, Slowinski R and Weglarz J (1986) Scheduling Under Resource Constraints: Deterministic Models, JC Baltzer, Basel Garey MR, Graham RL and Johnson DS (1976) Resource Constrained Scheduling as Generalized Bin Packing. Journal of Combinatorial Theory (A) 21:257-298 Ibaraki T (1982) The Power of Upper and Lower Bounding Functions in Branch-and-bound Algorithms. Journal of Operations Research Society of Japan 25:292-320 Krause KL, Shen ~r and Schwetman HD (1975) Analysis of Several Task-Scheduling Algorithms for a Model of Multiprogramming Computer Systems. Journal of Association for Computing Machinery 22, No. 4:522-550 Lawler IL, Lenstra JK and Rinnooy Kan AHG (1982) Recent Developments in Deterministic Sequencing and Scheduling: A Survey. In MAH Demster, JK Lenstra and AHG Rinnooy Kan, eds., Deterministic and Stochastic Scheduling, Reidel, Dordrecht, pp. 35-73 Lenstra JK and Rinnooy Kan AHG (1984) New Directions in Scheduling Theory. Operations Research Letters 2, No. 6:255-259 R6ck H (1984) Some New Results in No-wait Flow Shop Scheduling. Zeitschrift for Operations Research 28:1-16 Slowinski R (1980) Two Approaches to Problems of Resource Allocation among Project Activities - A Comparative Study. Journal of Operational Research Society 31 : 711-723 Slowinski R (1984) Preemptive Scheduling of Independent Jobs on Parallel Machines Subject to Financial Constraints. European Journal of Operational Research 15: 366-373 Yao AC (1975) Scheduling Unit-time Tasks with Limited Resources. In G Goos and J Hartmanis, eds., Lecture Notes in Computer Science, Springer-Verlag, Berlin 24:17-36
Received: January 1989 Revised version received: May 1991