Discrete
Applied
Mathematics
227
18 (1987) 227-233
North-Holland
JOB SHOP SCHEDULING WITH UNIT TIME OPERATIONS UNDER RESOURCE CONSTRAINTS AND RELEASE DATES Jayme
Luiz SZWARCFITER
Universidade Matemdtica,
Received
Federal
do Rio
Rio de Janeiro,
6 March
de Janeiro,
Ntieleo
de CornputaCdo
each one. The execution before
of the j-th
15 j< 1, and 15 h 5s. time r,. We describe
completion algorithms
and Institute
de
1987
We consider the problem of job shop scheduling sisting of I, unit time operations. There are s distinct
I 5 isn,
ElectrGnica
Brazil
operation
In addition,
algorithms
with m machines and n jobs J,, each conresources R,, and a quantity CJ,?available of
of J, requires
the presence
of u,,~ units of R,,,
each Jj has a release date r,, that is J, cannot
for finding
schedules
times of the jobs. Let I= max(/,} and u = terminate within polynomial time.
having
minimum
start
length or sum of
1{u,,~}1.If r??,s, u and I are fixed, then both
1. Introduction We consider the job shop problem rro with m machines and n jobs J,, 1 ~irn, each with lj unit time operations. There are s resources available in arbitrary quantities qh and the k-th operation of Ji requires an arbitrary number Ujkh of units of the h-th resource, 1 lion, 1 I k, and 1 this. In addition, each job has an integer release date, which applies to its first operation. We describe dynamic programming algorithms which construct schedules for no having minimum length C max or sum of completion times c C, respectively. Let I= max{i;}, q = max{qh} and u = 1{tlihk} 1. If m, s, I and u are fixed, then both algorithms terminate within polynomial time. If I is arbitrary, then the minimization problems become NP-hard, even if m = 3 and with no resources [4], but the C,,, minimization for the corresponding two machine case can be solved in polynomial time [3]. However, it turns again NP-hard when one unit of one resource is added [2]. If u is arbitrary, NP-hardness occurs even if rco is restricted to a flow shop problem with m = 2 and s = 2 or 1, respectively according to the minimization criteria c max or C C PI. If s is arbitrary, rco becomes NP-hard already when restricted to a flow shop problem with m=2 and q=u= 1 [l]. Finally, when m is arbitrary, it might be worth mentioning NP-hardness of one of its restrictions, namely a flow shop problem having s = q = u = 1 [l].
0166-218X/87/$3.50
0
1987, Elsevier
Science
Publishers
B.V. (North-Holland)
J. L. Szwarcfi/e~
228
2. A basic algorithm Denote
by 7-c”the job shop scheduling
problem
having
jobs
J(Q) = {J,, . . . , J,}
and machines {M, , . . . , M,,,}. Each J, consists of a sequence of unit time operations O(i, l), . . . , O(i, /,), and if k, then O(i, k) must precede O(i, k+ 1). A I,-tuple p,,,) specifies the machine assignment of J,, i.e., O(i, k) is to be exP,=(p;,,..., ecuted on machine M,,A, 1 I k< 1;. O(i, 1) and O(i, 1;) are respectively the head and tail of Ji. qh 10 available of In addition, rcO has resources {R,, . . . , R,s}, with a quantity each R ,?, 5 hrs. A s. l;-tuple U, = (CJ,,,, . . . , Uik,,, . . . , U,,,,,) describes the resource requirements of Jj, 1~ k< I, and 1 I h is. That is, the execution of O(i, k) requires the presence of u,,rO units of each R,. The resource constraints imply that no subset of simultaneous operations in a feasible schedule can require together more than qh units of Rh, 1 I h5.s. We suppose uik,,r,i,,(TI), where r,i,,(rc) equals zero whenever J(x) = 0 and min{r; 1J, E J(n)} otherwise. A feasible start of TI is a non-empty subset of heads HC O(x) satisfying,
O(i,k)EH O(i,
I),
c
W,
* 1) E H
Uilh5qhr
k= 1 and r,lt, *
M,,,
, f
(1) M,,,
,,
for each 1
o(i,l)EH(n) That is, His a subset of operations
(2)
(3)
which can be scheduled simultaneously to start a feasible schedule for rr. Denote by H* the set of all possible feasible starts of 7~. Let x(H) be the subproblem which satisfies 0(x(H)) = O(x) - H, that is, n(H) is the subproblem obtained by removing from rc the feasible start H. Call x(H) an imsuch mediute successor of rc. Let rc,, . . . , nk, k 2 1, be a sequence of subproblems successor of rrIi, 1~ i< k. Then nk is a successor of rcI. that rci+, is an immediate Denote by 71” and n: the sets of all successors and immediate successors of n, respectively. Denote by A(rr, t) and r(n, t) respectively the minimum values of C,,, and C C, for the subproblem n with initial time t. The following lemma describes the decomposition employed.
Job shop scheduling
Lemma
with unit time operations
229
I
A(n’0=
min
{max{t+
min
{(t + 1) 1T(H) 1+ r(n(ff),
otherwise
l,A(n(H),t,)}},
(4)
and
‘(” t,=
I
tH)},
otherwise
(5)
HEH*
where tH = {max t + 1, r,i,(n(H))} to H.
and T(H) is the subset of tails of TCbelonging
Proof. The case of A is trivial, see Fig. 1. For 5, the contribution to s(rc(H), tH) of the completion time of any job of z(H) is the same as that to ~(I-c,t). In addition, each operation O(i, 1) E H contributes to t(q t) with t + 1 units if it is a tail of 71, and zero units otherwise. 7
i,=O(?)
ii
t+1=i
t
-
(71
=’
J(r(ll))=I
.t)
TI
H
n(H)
-
t
t+1
/ tp!ait+l,rti,(~
(HI ) ’
Fig. 1. G,,, minimization.
J. L. Szwarcfiter
230
The basic algorithm can now be formulated. Given Q, let te=mmin(n0). Then compute /2(x0, t,,) or r(rre, to) using (4) or (5) respectively. Each feasible start HE H* can be obtained by applying (l)-(3). The number of subproblems considered by the above algorithm is exponential in n. The following section describes a method which restricts the search to a polynomial number of them.
3. A polynomial
time algorithm
We now describe a more efficient method for computing recurrences (4)-(5). Let X be the set of f,-tuples Xj = (~;r, . . . , xjs,), for all 1 <&II, such that and 15k5f;. Denote by Y the set of s. gj-tuples XJkE z,:, 1 llj
IXl=m(m’-l)/(m-1)
and
~YI=(u+I)~[(u+~)“-l]/[(~+l)~--11.
The proof follows from a simple counting. The profile of rc is a matrix S(Z) with elements, s(i,j)=I{J~EJ(n)lP,=X, l
with release
and U,= and
l
time of rc. A t-profile
date
it,
i.e., a matrix
The use of profiles lemma
and
in the solution
(6)
S,(n) is a profile
of 71 restricted
to the
with elements, rkst}l,
s,(i,j)=/{J,EJ(~)/P~=X,,Uk=~aand l
rJ}I,
l
(7) problems
is given by the
below.
Lemma 3. Let rr’, TC”be subproblems with profiles S’, S”, initial times t’, t” respectively, and both obtained from zero or more applications of (4) or (5). Then, S’=S”
and
t’zt”
A(n’, t’) =/2(x”, t”) Proof. Select if possible, (4) or (5), its generation nl,, nr = no, ir/,=,?and times of the subproblems
a and
t(n’, t’) = T(x”, t”).
J, E J(rr’) such that ri L t’. Since rc” has been derived from followed a sequence of subproblems 7c,, . . . , nk, where is an immediate successor of nj, 1
Job shop scheduling with unit time operations
231
is J, E J(rc”). Repeat the above argument, until all unselected jobs Jh E J(Tc’) have release dates
cover for TI when
(i) rr’, 71”~ 7~;‘and ~r’frr” * S(T[‘)#S(X”), and (ii) TI’E rr: =1 %c” E nF such that S(n’) = S(n”), that is, rry is a subset of subproblems of rc having distinct profiles and covering the possible profiles among all immediate successors of 71. Similarly, a subset rrc c TL* is a cover for 71 when it contains exactly one subproblem of x representing each distinct profile among all successors of n. A feasible start cover HC c H* is a subset of feasible starts which spans an immediate cover for 71, that is HE H’ iff n(H) E$‘. It follows from Lemma 3 that in order to compte 13(x, t) or r(n, t) using (4) or (5) respectively, it is sufficient to consider the minimizations of the recurrences with the variation of H within a feasible start cover Hc of 7~. We now describe a method for computing H’. Let V,(7r)C Z(lfi, x .ZY{, be the set of pairs u, = ((iI, . . . , i,,,), (j,, . . . ,j,)) # ((0, . . . ,O), (0, . . . , 0)) such that i,+O
iff
jk#O,
ik f 0
=
x;,,=kand~,(i~,j~)#O,
c
k E a(,,,)
Y,i,h~qh,
lsksm,
(8) l~krm,
(9)
lrhls,
(10)
where w(v,)={k~i,+O,l~k~m}. In other words, (8) and (9) imply that for each u, E v the values of it , . . . ,I ,,,, Jo, . . . , j,,, are such that if ik#O, then J(n) contains some job having its head on Mk, machine assignment X,, , requirements Yj, and initial time it. For each kEcr(u,), select exactly one such job and let H(u,) be the set of heads of the Icr(u,)l jobs so selected. Then (10) assures that the operations of H(u,) together satisfy all resource constraints. Therefore H(u,) is a feasible start of 71at the initial time t. Conversely, each HE H* translates into some u, E V,. Moreover,
Lemma
4. For
any
subproblem
rc with
initial
time
t,
V,(n)
and
H;‘(n)
are
isomorphic. Recurrences (4) and (5) can now be rewritten to be peformed. 0, ‘(=’ t)=
to reflect the actual
computations
if J(lr)=pI,
,“,i; {max{t+ I I
l,A(rc(H(u,)), t(u,)))},
otherwise
(11)
232
J. L. Szwurcfiter
0, z(n9 f, =
if 5(71)=0,
m;; {(t + 1) I Vu,) 1+ t(rrW(u,)), I i
t(h))) 3 otherwise
(12)
where t(u,)=max{t+
l,r,i,(n(H(u,))))
and
T(o,)={k~a(u,)I.&=l}.
The algorithms can finally be described. Given Q, construct X, Y and S(Q). For each considered computation of ,I(rr, t) or ~(71,f), verify if some previously solved subproblem X’ with initial time t’ satisfies S(n) = S(n’) and t = t’. If yes, the answer for both subproblems is the same. Otherwise, calculate I.(x, t) or r(n, t), respectively using (11) or (12). The computation stops when A(~r,,,~~~(n,)) or r(7r0,rmin(n0)) is evaluated. Sets X and Y can be easily constructed in constant time, while the profile of a subproblem 7c can be found in O(n) time using (6). In order to compute L(n, t) or r(n, t) by (11) or (12), we need to generate set Vt. This can be done in O(n) time through finding S,(n) using (7) and then applying (Q-(10). For each u, E V,, n(H(u,)) can be determined from 7c in constant time. For a fixed t, it is sufficient to compute (11) or (12) for a subset of subproblems which is a cover for n. Therefore the total number of subproblems to be considered is 1rc;I = O(n”), a = 1X1 . 1Y 1. There are O(n) possible initial times. For each newly considered subproblem we need to check whether a previously computed case has the same profile and initial time as it. This can be accomplished by examining all O(n”) distinct profiles of the subproblems of n& using linear search. Therefore both algorithms can be implemented in 0(n2”+‘) time and O(n”) space. The time bound can be decreased by replacing the linear for binary search. All we need is a total ordering relating the subproblems of the cover nh. For instance, let n’, 71”~ 7$, and (i,j) be the least pair in the lexicographical ordering of Zb, x Z& such that the element (i,j) of S(rr’) is different from that of S(n”). Then define x’< n” iff s(i,j) is smaller in S(n’) than in S(~C”). We can then detect subproblems having identical profiles using binary search. This decreases the time bound to 0(#+2). The minimizing u, E y defines the actual schedule at time t, as H(u,) contains respectively the operations to be scheduled on IVY, kE a(~,). Otherwise, if k@a(u,), then Mk is left idle.
4. Conclusions We have described algorithms for minimizing the length or the mean completion time of a schedule for a job shop problem with unit time operations under resource constraints and release dates. If the number of machines, resources, operations per job and distinct requirements are all fixed then both algorithms terminate within polynomial time, although the degree of the polynomials and the constants involved
Job shop scheduling
233
with unit time operutions
in the complexity expression grow fast. However, these results could be of theoretical interest due to the generality of the considered problems. Similar algorithms can be formulated when replacing the release dates by deadlines. It would be interesting to know the complexity of the case when both release dates and deadlines are present together.
References [l] J. Blazewicz, straints,
[2] J. Blazewicz, classification [3] N. Hefetr
H. Rock and J.L. Srwarcfiter,
Flow shop scheduling
J.K. Lenstra and A.H.G. Rinnooy Kan, Scheduling subject and complexity, Discrete Appl. Math, 5 (1983) 1 l-24.
and
schedule-length [4] J.K. Lenstra blems, Ann. [5] H. Rock,
W. Kubiak,
under resource
con-
to appear.
I. Adiri, problem,
An efficient Math.
Oper.
optimal
algorithm
for the two-machines
constraints:
unit-time
jobshop
Res. 7 (1982) 354-360.
and A.H.G. Rinnooy Kan, Computational Discrete Math. 4 (1979) 121-140.
Some new results
to resource
in flow shop scheduling,
complexity Z. Oper.
of discrete
optimization
Res. 28 (1984) 1-16.
pro-