Complexity of shop-scheduling problems with fixed number of jobs: a survey

21

Transcript of Complexity of shop-scheduling problems with fixed number of jobs: a survey

Complexity of shop-s hedulingproblems with �xed number of jobs: asurveyPeter Bru kerUniversit�at Osnabr�u k, Fa hberei h Mathematik,49069 Osnabr�u k, GermanyYuri N. SotskovUnited Institute of Informati s Problems of the National A ademy ofS ien es of Belarus, Surganov St. 6, 220012 Minsk, BelarusFrank WernerOtto-von-Gueri ke-Universit�at, Fakult�at f�ur Mathematik, PSF 4120,39016 Magdeburg, GermanyAbstra t: The paper surveys the omplexity results for job shop, ow shop, open shopand mixed shop s heduling problems when the number n of jobs is �xed while the numberr of operations per job is not restri ted. In su h ases, the asymptoti al omplexity ofs heduling algorithms depends on the number m of ma hines for a ow shop and an openshop problem, and on the numbers m and r for a job shop problem. It is shown that almostall shop-s heduling problems with two jobs an be solved in polynomial time for any regular riterion, while those with three jobs are NP -hard. The only ex eptions are the two-job,m-ma hine mixed shop problem without operation preemptions (whi h is NP -hard for anynon-trivial regular riterion) and the n-job, m-ma hine open shop problem with allowedoperation preemptions (whi h is polynomially solvable for minimizing makespan).1 Introdu tionIn 2004, there is the 50th anniversary of the publi ation of the �rst polynomial algorithmgiven by S.M. Johnson [1℄ for a ow shop problem with two ma hines and makespan min-imization. In paper [1℄ and in the majority of the subsequent papers on s heduling theorybasi ally systems with a �xed number of ma hines and an unrestri ted number of jobs havebeen investigated. In this survey, we present all known omplexity results for shop-s hedulingproblems with a �xed number of jobs and an unrestri ted number of ma hines or operationsper job. The most important results obtained for a job shop problem with m � n arepresented in this survey with proofs.The job shop problem may be formulated as follows. Given are n jobs J = fJ1; J2; : : : ; Jngand m ma hines M1;M2; : : : ;Mm. Job Ji onsists of a sequen e O1i; O2i; : : : ; Ori;i of ri1

operations whi h must be pro essed in the given order, i.e. operation Oj+1;i annot startbefore operation Oji is ompleted, j = 1; 2; : : : ; ri � 1. Asso iated with ea h operation Ojithere are a pro essing time pji > 0 and a ma hine �ji 2 fM1;M2; : : : ;Mmg. Operation Ojimust be pro essed for pji time units on ma hine �ji. Ea h job an be pro essed by at most onema hine at a time and ea h ma hine an pro ess at most one operation at a time. We assumethat all jobs and ma hines are available from starting time zero. If preemption of operationsis forbidden, then equality ji = sji + pji must hold, where sji and ji denote the startingtime and ompletion time of operation Oji, respe tively. The job shop problem is to �nda s hedule whi h minimizes the given obje tive fun tion � = �(C1; C2; : : : ; Cn), where Cimeans the ompletion time of job Ji, i.e. Ci = ri;i. The majority of known results for shop-s heduling problems has been obtained for makespan minimization Cmax = maxfCi : Ji 2 Jg,and for the minimization of the sum of the job ompletion times P Ci =Pni=1 Ci:Depending on the type of job routes through m ma hines, whi h may be �xed or not befores heduling, we obtain di�erent lasses of shop-s heduling problems. In a ow shop, routesfor all jobs are �xed and identi al, namely: �1i = M1; �2i =M2; : : : ; �mi = Mm for ea h jobJi 2 J .In an open shop, job routes are not �xed before s heduling (and thus the hoi e of job routesis a part of the de ision for an open shop problem). It is known only that ea h job hasexa tly one operation on ea h ma hine (the same as for a ow shop).In a job shop, routes of all jobs are �xed and an be di�erent for di�erent jobs. Thus, a owshop is a spe ial ase of a job shop. Note also that in a job shop, a route of a job may havema hine repetition or (and) absen e of some ma hines. Thus, in ontrast to ow shop andopen shop in whi h equality ri = m holds for ea h job Ji, in a job shop ea h of the threepossibilities is allowed: ri < m, ri = m or ri > m.In a mixed shop, there are nJ jobs with �xed routes (as in a job shop) and nO = n � nJjobs whose routes are not �xed (as in an open shop). However, equality ri = m must holdfor ea h job in a mixed shop.For the lassi� ation of s heduling problems the three-�eld form �j�j is used, where � hara terizes the type of the pro essing system and the number of ma hines. Thus, symbolF is used for the notation of a ow shop problem, O for an open shop problem, J for ajob shop problem and X for a mixed shop problem. The parameter � de�nes a set of job onstraints. The position spe i�es the obje tive fun tion. E.g. Johnson's algorithm [1℄ hasbeen developed for a ow shop problem with two ma hines and minimization of makespan,i.e. for problem F2jjCmax.As it was already mentioned, the majority of known results of s heduling theory have beenobtained for the ase of a �xed number of ma hinesm when the number of jobs n > m an bearbitrarily large. In parti ular, the asymptoti al omplexity of the algorithm given by S.M.Johnson [1℄ is O(nlogn) and, hen e, it is polynomial in the number of jobs n. In this paper,we survey all known results for the ase of a �xed number of jobs whi h de�ne the boundarybetween easy and hard problems. The omplexity of the onsidered algorithms depends onthe number m for ow and open shop problems and on m and r = maxfri : Ji 2 Jg for jobshop problems.Along with the theoreti al signi� an e of the ase n > m, it has pra ti al importan e, inparti ular, for s heduling problems arising in modern mi roele troni s when it is ne essary2

to design a spe i� pro essing system with a �xed set of jobs, where a rather heap standardequipment (ma hines) an be used.The paper is organized as follows. In Se tion 2, we present a table de�ning the boundarybetween NP -hard and polynomially solvable job shop problems with a �xed number ofjobs. Se tions 3 and 4 des ribe polynomial algorithms for job shop problems with twojobs. Se tions 4, 5 and 6 des ribe polynomial algorithms for job shop problems with twoma hines and a �xed number of jobs. NP-hardness of the job shop problem with n = m = 3without operation preemption (with n = 3; m = 2 with operation preemption) is proven inSe tion 7 (Se tion 8). In Se tions 9 and 10 we present tables de�ning the boundary betweenNP -hard and polynomially solvable problems of ow shop, open shop and mixed shop type.Con luding remarks are given in Se tion 11. An appendix ontains the NP -hardness proof ofproblem J2 j n = 3; pmtnjCmax. Hereafter, `pmtn' means allowan e of operation preemption.2 Job Shop ProblemsIn Table 1, we present known results on erning the omplexity of algorithms for job shopproblems with an unrestri ted number of operations per job. Besides the notations given inthe previous se tion, in Table 1 the following notation is used: L = maxfLi : Ji 2 J; Li =Prij=1 pjig: The symbol [pji℄ means that pro essing times of all operations should be naturalnumbers. The symbol MPM in the fourth olumn spe i�es that the pro essing times of alloperations and the set of ma hines on one of whi h the operation an be pro essed. In rows11 and 12 of Table 1 any non-de reasing fun tion fi(Ci) an be onsidered.In the last olumn of Table 1, publi ations are listed in whi h the orresponding algorithmsare given or NP -hardness of the problem is proved. Sin e a number of the results has beenindependently obtained by di�erent authors, we present the papers in an in reasing order oftheir years of publi ation.3 Two jobs without preemptionsPolynomial algorithms whi h onstru t optimal s hedules for two jobs (see rows 1, 3-8 inTable 1) are based on a geometri al representation of s hedules for problems J j n = 2jCmax,whi h has been originally suggested in the papers [2, 3℄ and developed in [5, 6, 7℄. In [4, 10℄,the geometri algorithm was generalized for problems J j n = 2j� and J j n = 2; pmtnj�.Next, we des ribe this approa h for problem J j n = 2jCmax and prove its eÆ ien y.The job shop problem with two jobs may be formulated as a shortest path problem inthe plane with regular obje ts as obsta les. Figure 1 shows a shortest path problem withobsta les whi h orresponds to a job shop problem with two jobs and r1 = 4 and r2 = 3.The pro essing times of the operations of job J1 (job J2) are represented by intervals onthe x-axis (y-axis) whi h are arranged in the order in whi h the orresponding operationsare to be pro essed. Furthermore, the intervals are labelled by the ma hines on whi h the orresponding operations must be pro essed.A feasible s hedule orresponds to a path from initial vertex O = (0; 0) to terminal vertexH. This path has the following properties: 3

Table 1: Complexity of job shop problemsRow Number Number Constraints Criterion Complexity Referen esof jobs of ma hines1 2 m r � m Cmax O(m2) [6℄, [7℄2 2 m � O(r2 log2 r) [4℄,[10℄3 2 m pmtn � O(r3) [4℄,[10℄4 2 m � O(m log2m) [4℄,[10℄5 2 m pmtn; r � m � O(m2) [4℄,[10℄6 2 m Cmax O(r2 log2 r) [4℄,[5℄7 2 m MPM Cmax O(r3) [15℄8 n m [pji℄ Cmax O(2nLn) [13℄, [14℄9 3 2 Cmax O(r4) [16℄10 k 2 Cmax O(r2k) [17℄11 k 2 max fi(Ci) O(rk2+2k) [18℄12 k 2 P fi(Ci) O(rk2+2k) [18℄13 k 2 PwiCi O(rk) [18℄14 3 5 pmtn PCi Binary NP-hard [8℄, [9℄,[10℄15 3 5 Cmax Binary NP-hard [8℄, [9℄,[10℄16 3 5 pmtn Cmax Binary NP-hard [8℄, [9℄,[10℄17 3 5 PCi Binary NP-hard [8℄, [9℄,[10℄18 3 3 pmtn PCi Binary NP-hard [11℄,[12℄19 3 3 Cmax Binary NP-hard [11℄,[12℄20 3 3 pmtn Cmax Binary NP-hard [11℄,[12℄21 3 3 PCi Binary NP-hard [11℄,[12℄22 3 2 pmtn Cmax Binary NP-hard [19℄23 3 2 pmtn PCi Binary NP-hard [19℄� the path onsists of segments whi h are either parallel to one of the axes (an operationof only one job is pro essed) or diagonal (operations of both jobs are pro essed inparallel);� the path has to avoid the interior of any re tangular obsta le of the form I1�I2, whereI1 and I2 are intervals on the x-axis and y-axis whi h orrespond to the same ma hine(this follows from the fa t that two operations annot be pro essed simultaneously onthe same ma hine and that operation preemption is not allowed);� the length of the path, whi h orresponds to the s hedule length, is equal to:length l of horizontal parts plus length of verti al parts plus (length of diagonalparts)/p2.In general, we have onse utive intervals Ix� (Iy� ) of length p�1(p�2) where � = 1; 2; : : : ; r1(r2).Furthermore, the re tangles Ixi � Iyj are forbidden regions if and only if �i1 = �j2. Finally,de�ne a = r1X�=1 p�1 and b = r2X�=1 p�2:4

HJ1M3M1M2M10M1M3M2

J2

Figure 1: Path problem with obsta lesWe have to �nd a shortest path from vertex O = (0; 0) to vertex H = (a; b) whi h has onlyhorizontal, verti al, or diagonal segments and whi h does not pass through the interior of anyof the forbidden regions. Next, we show that the problem an be redu ed to an unrestri tedshortest path problem in an appropriate network N . Furthermore, the unrestri ted pathproblem may be solved in time whi h is linear in the number of obsta les.The network N = (V;A; l) is onstru ted as follows. The set of verti es V onsists of O, H,and the set of north-west orners (NW- orners) and south-east orners (SE- orners) of allobsta les. O is onsidered as a degenerate obsta le in whi h both the NW- orner and theSE- orner oin ide. Ea h vertex i 2 V nfHg oin ides with at the most two ar s going outof i. To onstru t these ar s, we go from i diagonally in a NE dire tion until we hit eitherthe boundary of the re tangle de�ned by O and H or the boundary of an obsta le. In the�rst ase, H is the only su essor of i and ar (i; H) onsists of the path whi h goes fromi diagonally to the boundary and ontinues along the boundary to H (see Figure 2). If wehit an obsta le D, then there are two ar s (i; j) and (i; k) where j and k are the NW- ornerand SE- orner of D, respe tively. The orresponding polygons are shown in Figure 2.Di

j k Hi(a) (b)Figure 2: De�nition of ar sThe length l(i; j) of an ar (i; j) is equal to the length of the verti al or horizontal pie e plus5

the length of the proje tion of the diagonal pie e on the x-axis (or equivalently, y-axis).It is easy to see that an O�H-path (i.e. a path from O to H) in N = (V;A; l) orrespondsto a feasible s hedule, and its length is equal to the orresponding Cmax-value. Furthermore,an optimal s hedule orresponds with a shortest O �H-path in N .The network N is a y li and has O(s) ar s where s in the number of obsta les. Thus, ashortest O�H-path an be al ulated in time O(s). In general s = r2 where r = maxfr1; r2g.To onstru t the network N = (V;A; l) we apply a line sweep with the SW-NE-line y�x = .We move this line parallel to itself from north-west to south-east. The sweep line interse tsthe obsta les reating an ordered set of intervals. Let S be the orresponding set of obsta les,together with the order indu ed by the intervals on the sweep line. We keep tra k of hangesin S during the sweep. There are two possible events where hanges o ur.� If the sweep line hits an NW- orner i of an obsta le Dl, then we have to insert Dl intothe ordered set S. If there is a next element Dh in S, whi h has an NW- orner j anda SE- orner k, then the ar s (i; j) and (i; k) must be inserted into A and we have to al ulate d(i; j) and l(i; k). Otherwise, we have to insert (i; H) into A and al ulatel(i; H).� The sweep line hits a SE- orner i of an obsta le Dl. If there is a next element Dh inS with an NW- orner j and a SE- orner k, then we insert (i; j) and (i; k) into A and al ulate l(i; j) and l(i; k). Otherwise, we have to insert (i; H) into A and al ulatel(i; H). Finally, Dl must be deleted from S.The ar s (i; j); (i; k) and the distan es d(i; j); d(i; k) an be al ulated in onstant time.Furthermore, if we use a balan ed tree, e.g. 2-3 tree (see [20℄), then the insert and deleteoperations an be done in O(log r) time. Thus, N an be onstru ted in O(r2 log r) time.4 Two jobs with preemptionsNext, we des ribe the modi� ation of the above algorithm for problem J j n = 2; pmtn jCmax. If operation preemption is allowed in the previous problem, then we may go hori-zontally or verti ally through obsta les. For this reason, the network N = (V;A; l) must bede�ned di�erently.The vertex set is de�ned re ursively as follows.� O is a vertex.� If v is a vertex and the half-line starting from v and going in a NE-dire tion hits anobsta le, then v has the two su essors i and j shown in Figure 3 (a) or (b).� If v is a vertex and the half-line starting from v and going in a NE-dire tion hits theborderline given by the re tangle de�ned by O and H, then H is the only su essor ofv.We denote the modi�ed network by N . 6

i jv (a)i j

v (b)Figure 3: Going throughAr s (i; j) and ar lengths d(i; j) are de�ned as before in Se tion 3. If in the above algorithmfor problem J j n = 2 j Cmax the \NW- orner" and \SE- orner" are repla ed by \northboundary point" and \east boundary point", respe tively, this modi�ed algorithm appliedto N solves problem J j n = 2; pmtn j Cmax. The running time of this modi�ed algorithm isbounded by O(r3). This an be seen as follows.Consider for ea h SE- orner or NW- orner v, whi h an be rea hed from O, the unique pathstarting from v whi h avoids the boundaries of the obsta les it hits. If su h a path hits theSW- orner t of an obsta le (or a boundary point t0 of the re tangle R, de�ned by O andH), this path terminates in t (or in H). There are at most O(r1; r2) of these paths andea h has at the most r1 + r2 ar s. Furthermore, the set of all these paths overs all ar sgoing through the interior of obsta les. Thus, the total number of ar s whi h go through theinterior of obsta les is bounded by O(r3). Be ause the number of ar s not going through theinterior of obsta les is bounded by O(r1r2) and the total omputation time of the shortestpath algorithm is proportional to the number of all ar s, we have an O(r3)-algorithm.Finally, we remark that all of the geometri methods also work if we allow repetition ofma hines.5 Two ma hines, no preemptionsIt is ne essary to note that job shop problems with a �xed number of jobs are not NP-hardin the strong sense (unary NP-hard) sin e there exists a pseudo-polynomial algorithm for thede ision problem, for example, in the papers [14, 13℄ (see row 8 in Table 1). The algorithmsspe i�ed in rows 10-13 of Table 1 are polynomial (sin e k represents a onstant). However,these algorithms will be really e�e tive only for suÆ iently small values k and r.We give a shortest path formulation for the two-ma hine job shop problem with k jobsand makespan obje tive. The orresponding network is a y li and has at the most O(rk)verti es. It an be onstru ted in time O(r2k). Thus, the job shop problem an be solvedin O(r2k) time. We onsider only a tive s hedules, i.e. s hedules in whi h no operation an be started earlier without violating feasibility. Ea h s hedule an be transformed intoan a tive one without in reasing the Cmax-value. Given an a tive s hedule S, we have aunique sequen e t0 = 0 < t1 < t2 < : : : < tq of all times at whi h either two operations beginpro essing jointly on both ma hines or one operation begins pro essing on one ma hine while7

an idle period is starting on the other ma hine (see Figure 4). We de�ne tq+1 = T where Tis the Cmax-value of the s hedule.M2M1t0 = 0 t1 t2 t3 t4 t5 t6 t7 = TFigure 4: Blo k stru ture of a s heduleFurthermore, we all the set D� of operations s heduled in the interval [t�; t�+1℄ (� =0; 1; : : : ; q) a blo k. For a blo k D, let D1(D2) be the set of operations of D pro essedon ma hine M1 (ma hine M2) and denote the sum of pro essing times of all operations inD1 (D2) by l1D(l2D). A blo k D asso iated with the interval [ti; ti+1℄ has the properties that� all jobs in D1 (D2) are s heduled in the interval [ti; ti + l1D℄ (interval [ti; ti + l2D℄),� ti+1 = ti +maxfl1D; l2Dg, and� one ma hine is idle in the interval [minfl1D; l2Dg; ti+1℄.The value lD = maxfl1D; l2Dg = ti+1 � ti is alled the length of blo k D.It follows that a s hedule is de�ned by a sequen e of blo ks and the s hedule length is thesum of the lengths of all blo ks in that sequen e.To formulate the job shop problem as a shortest path problem in some network N we hara terize blo ks in the following way. For a given blo k, let us onsider the ve tor u =(u(j))kj=1 where u(j) is the index of the last operation Ou(j);j of job j whi h is pro essed inthe previous blo k. Thus, the blo k an be des ribed by pairs (u;v) of index tuples. Thenetwork N = (V;A; l) is de�ned by� the set V of all index tuples u = (u(j)) with 0 � u(j) � nj for j = 1; 2; : : : ; k. Theve tor s with s(j) = 0 for all j = 1; 2; : : : ; k is the initial vertex, the ve tor t witht(j) = nj for all j = 1; 2; : : : ; k is the terminal vertex of the network,� (u;v) 2 A if and only if u < v and the set of operationsfOi(j);j j j = 1; 2; : : : ; k; u(j) < i(j) � v(j)gde�nes a blo k, and� for ea h (u;v) 2 A, its length l(u;v) is the length of the blo k orresponding to (u;v).In network N , ea h s-t-path p orresponds to a feasible s hedule and the length of p isequal to the makespan of this s hedule. We obtain this s hedule by s heduling the blo ks orresponding to the ar s in p onse utively as shown in Figure 4. Furthermore, there is ans-t-path orresponding to an optimal s hedule. Thus, to solve the job shop problem we haveto �nd a shortest s-t-path in N . 8

M2M1 O1 O2 O3 O4 � � � � � �Or�1 OrFigure 5: De omposition of a blo kIt remains to show that the network an be onstru ted in time O(r2k). For this purpose wewill present an O(rk)-algorithm whi h, for a given vertex u, �nds all ar s (u;v) whi h de�nea blo k. W.l.o.g. let u = s where s is the initial vertex de�ned in the previous se tion.A blo k may be de omposed as shown in Figure 5. This de omposition is de�ned by oper-ations Oi(i = 1; 2; : : : ; r) with the property that Oi with uneven (even) index are pro essedon ma hine M1 (ma hine M2) and ea h pair of onse utive operations Oi and Oi+1 areoverlapping. The Oi are alled main operations.We onstru t a dire ted graph G with O(rk) verti es and O(krk) ar s su h that all blo ksstarting in s an be found by visiting all verti es in this graph. This an be done in O(krk)time.G onsists of s and of noninitial verti es de�ned by pairs (u; h) of index-tuples u = (u(j))together with a job index h de�ning a main operation Ou(h);h. Vertex (u; h) de�nes a blo k onsisting of all operationsOij with i � u(j) where j = 1; 2; : : : ; k. Vertex (v; l) is a su essorof vertex (u; h) if v is derived from u by adding a single operation, i.e. by in rementing oneindex u(j) by one. If a main operation is added, then we have h 6= j = l. In this ase, Ou(j);lmust �nish later than Ou(h);h. Otherwise, l = h and the added operation Ou(j);j must �nishearlier than the main operation Ou(h);h. The su essors of s are the verti es representingblo ks onsisting only of a main operation. Clearly, ea h vertex has at most k su essors.Thus, the graph an be sear hed in O(krk) time whi h is O(rk) if k is �xed. Therefore, thenetwork N an be onstru ted in time O(r2k).6 Two jobs, three ma hines, no ma hine repetitionWe use the previous algorithm des ribed in Se tion 5 to solve the spe ial ase with threejobs and no ma hine repetition. Due to the fa t that no ma hine repetition is allowed blo kshave a spe ial stru ture whi h may be hara terized by the following two properties (seeFigure 6) whi h an be easily veri�ed:� with the ex eption of a �rst and a last operation, ea h operation in the blo k overlapsexa tly two other operations;� the job indi es are repeated periodi ally, i.e. the operations ordered a ording toin reasing starting times yield a sequen e Ori; Osj; Otk; Or+1;i; Os+1;j; Ot+1;k; Or+2;i; : : :Noti e, that a blo k may also onsist of exa tly one operation.For a blo k B there are at most three one-element blo ks whi h may be a su essor of B.In a su essor blo k of B ontaining more than one operation, two operations begin at the9

: : :j i k ji k j kFigure 6: Blo k de omposition for n = 3 and no ma hine repetitionsame time. Given these two operations, there is a unique maximal blo k satisfying onditions(a) and (b) and this maximal blo k an be onstru ted in O(r) time. Ea h initial part ofthis maximal blo k may be a su essor of B. Due to the fa t that there are only thesetwo possibilities to start a su essor blo k of B, it follows that blo k B has at most O(r)su essors and these su essors an be onstru ted in O(r) time.This implies that the network has at most O(r4) ar s and an be onstru ted in O(r4) time.Thus, we have an O(r4)-algorithm.Surprisingly, the job shop problem with two ma hines and three jobs is NP -hard if we allowma hine repetition. This is shown in Se tion 8 and the appendix.7 Three jobsIn this se tion, we show how to prove that problem J3 j n = 3 j Cmax is binary NP -hard.The omplexity of problem J3 j n = 3 j Cmax is determined through a redu tion from thefollowing version of the partitioning problem, known as even-odd partition.PARTITION: Given positive integers ei (i = 1; 2; : : : ; 2k) with 2kPi=1 ei = 2E = �. Doesthere exist a partition of the index set A = f1; 2; : : : ; 2kg into subsets A1 and A2 su hthat Pi2A1 ei = E and A1 in ludes exa tly one element from ea h pair (2i � 1, 2i) wherei = 1; 2; : : : ; k?For problem J3 j n = 3 j Cmax we �rst allow repetition of ma hines.Theorem 1 Problem J3 j n = 3 j Cmax is binary NP -hard.Proof: Given an instan e of PARTITION the orresponding instan e of J3 j n = 3 j Cmaxis onstru ted as follows. Let H be an integer with H > 8E. The stru ture of the J3 j n =3 j Cmax-instan e an be divided into k identi al periods. One period is shown in Figure7. Operations to be pro essed on M1, M2, and M3 are represented by white ir les, bla k ir les, and squares, respe tively.

10

J1J2J3 Figure 7: J3 j n = 3 j Cmax-instan eThe pro essing times of the orresponding operations are as follows:p6l+1;1 = l�1P�=�1�2�+1;2�+2; p6l+2;1 = H � l�1P�=�1�2�+1;2�+2;p6l+3;1 = H + l�1P�=�1�2�+1;2�+2 + e2l+2; p6l+4;1 = �2l+1;2l+2;p6l+5;1 = 2H ��2l+1;2l+2; p6l+6;1 = 2H;p4l+1;2 = H; p4l+2;2 = 2H; p4l+3;2 = 2H; p2l+4;2 = H;p4l+1;3 = e2l+1; p4l+2;3 = e2l+2; p4l+3;3 = �2l+1;2l+2; p4l+4;3 = H;where �j;j+1 = ej � ej+1; ��1;0 = 0 and l = 0; 1; : : : ; k � 1:It an be shown that problem PARTITION has a solution if and only if the orrespondingJ3 j n = 3 j Cmax-instan e has a solution with Cmax � 6kH + E. �By adding separating operations with very small pro essing times " > 0 the NP -hardnessproof also for J3 j n = 3 j Cmax without ma hine repetition an be a omplished.8 Two ma hines, three jobs with preemptionsWe now onsider the preemptive two-ma hine version of the problem dis ussed in Se tion7. This problem is usually denoted by J2 j n = 3; pmtn j Cmax. First, we will show thatthis problem an be solved pseudopolynomially. This follows from the fa t that problemJm j n = k; pmtn j Cmax an be solved in time O(rT k�1) whereT = kmaxj=1 njXi=1 pij and r = kmaxj=1 nj:In the se ond part we state the main result of this se tion, namely problem J2 j n = 3; pmtn jCmax is NP -hard.We start with an observation whi h is essential for the pseudopolynomial algorithm forproblem Jm j n = k; pmtn j Cmax and whi h is also useful for NP -hardness proof.Given a s hedule S, a sli e of S is a maximal time period [t; t0℄ su h that during the wholeperiod [t; t0℄ ea h ma hine is either idle or ontinuously pro esses exa tly one operation.Clearly, a s hedule S de omposes into a sequen e of sli es, i.e. if Cmax is the makespan of11

S, then there are unique sli es [t0; t1℄; (ti; ti+1℄ (i = 1; 2; : : : ; h� 1) with t0 = 0 < t1 < : : : <th = Cmax.Lemma 1 For problem J j pmtn j Cmax there exists an optimal s hedule whi h has a sli ede omposition [t0; t1℄; (ti; ti+1℄ (i = 1; 2; : : : ; h� 1) su h that at ea h time ti (i = 1; 2; : : : ; h)at least one operation �nishes.This result follows from the fa t that an arbitrary s hedule an be transformed into a s hedulesatisfying the required onditions without in reasing the obje tive fun tion.Next, we show that problem Jm j n = k; pmtn j Cmax an be formulated as a problem of�nding a shortest path in an a y li network with O(rT k�1) ar s. Thus, the problem an besolved in time O(rT k�1).The onstru tion of the network N is based on the fa t, that there exists an optimal s hedulewhi h de omposes into sli es su h that ea h sli e ontains a �nishing operation, i.e. for asli e (ti; ti+1℄ there exists a job Jj su h that some operation Ouj �nishes at time ti+1.We may asso iate with ti+1 an operation Ouj whi h �nishes at time ti+1. Furthermore, forea h job J�; � = 1; 2; : : : ; k, we denote by s� the total pro essed time of job J� at time ti+1.Note that sj = uPi=1 pij. Therefore, we asso iate with ti+1 a vertexv = (Ouj; s1; : : : ; sj�1; sj+1; : : : ; sk)in the network N . There are at most rkT k�1 = O(rT k�1) verti es. A vertexv0 = (Ol0j0; s01; : : : ; s0j0�1; s0j0+1; : : : ; s0k)is a su essor of vertex v in network N , if (v; v0) de�nes a sli e. Ol0j0 is a �nishing operationof this sli e and lv;v0 = 8<: l0P�=1 p�j0 � sj0; if j 0 6= jpl0j0; otherwiseis its length.Ea h vertex has at most k � � km� su essors whi h is a onstant number if m and k are �xed.Thus, network N has O(rT k�1) ar s.Noti e that there are several sour es and sinks. Ea h path from a sour e to a sink innetwork N orresponds with a feasible s hedule and the length of the path orrespondswith the makespan of the orresponding s hedule. Due to Lemma 1 there exists an optimals hedule whi h is represented by a path in network N . Thus, to solve problem Jm j n =k; pmtn j Cmax we have to �nd a shortest path from a sour e to a sink in N whi h an bedone in O(rT k�1) time.Again, the problem PARTITION will be redu ed to problem J2 j n = 3 j Cmax. The orresponding redu tion is similar to the redu tion from PARTITION to J3 j n = 3; pmtn jCmax. The proof of the following theorem is given in the appendix.Theorem 2 Problem J2 j n = 3; pmtn j Cmax is binary NP -hard.12

Table 2: Complexity of algorithms for ow and open shop problemsProblem Number Number Constraints Crite- Complexity Referen estype of jobs of ma hines rionF 2 m � O(m logm) [4℄, [10℄F 2 m pmtn � O(m2) [4℄, [10℄F 3 m Cmax Binary NP-hard [8℄,[9℄,[10℄F 3 m pmtn Cmax Binary NP-hard [11℄,[12℄F 3 m PCi Binary NP-hard [8℄,[9℄,[10℄F 3 m pmtn PCi Binary NP-hard [11℄,[12℄F 3 m pmtn; pij > 0 Cmax Binary NP-hard [11℄,[12℄F 3 m pmtn; pij > 0 PCi Binary NP-hard [11℄,[12℄O 2 m Cmax O(m) [21℄O n m pmtn Cmax O(n2m2) [21℄O 2 m � O(m) [22℄O 2 m pmtn � O(m) [22℄O 3 m Cmax Unary NP-hard [21℄, [23℄O 3 m PCi Unary NP-hard [11℄An immediate onsequen e of the results in this se tion is that the job shop problem withtwo ma hines, three jobs, and unit pro essing times is binary NP -hard if we allow ma hinerepetition.The investigation of job shop problems with a �xed number of jobs has led to an unex-pe ted result on erning the in uen e of preemptions of an operation. For the �rst time,a problem has been spe i�ed for whi h there exists a polynomial algorithm for the asewhen preemptions are forbidden while it is NP -hard in the ase of allowed preemptions (seerows 11, 12 and rows 22, 23 in Table 1). Before the publi ation of papers [18, 19℄, for allinvestigated problems for whi h a polynomial algorithm exists in the ase of forbidden oper-ation preemptions, there exists also a polynomial algorithm in the ase of allowed operationpreemptions.9 Flow shop and open shopSin e a ow shop is a spe ial ase of a job shop, the polynomial algorithms given in Table 1for job shop problems an also be used for determining an optimal solution for a ow shop.Therefore, in Table 2 only those algorithms are presented whi h have a smaller omplexityin omparison with the algorithms for the orresponding job shop problem.In [21℄, it has been proven that problem O3 jj Cmax is NP -hard and an algorithm of om-plexity O(m) for problem O2 jj Cmax as well as an algorithm of omplexity O(n2m2) forproblem O j pmtn j Cmax have been developed. Based on these results, one an on ludeby taking into a ount the symmetry of jobs and ma hines for problems O jj Cmax andO j pmtn j Cmax that problem O j n = 3 j Cmax is NP -hard while problems O j n = 2 j Cmaxand O j n = k; pmtn j Cmax are polynomially solvable.It is ne essary to note that for riterionPCi and other lassi al riteria open shop problems13

Table 3: Complexity of algorithms for mixed shop problemsNumber Number Number of Con- Crite- Complexity Refe-of jobs nJ of jobs nO ma hines straints rion ren es1 1 1 � O(r) [26℄1 1 2 Cmax Unary NP-hard [25℄1 1 1 PCi Binary NP-hard [26℄k l 2 Cmax O(r2k2l) [25℄1 1 1 Cmax Binary NP-hard [26℄2 l m Cmax O((r2logr)lm+1) [25℄1 1 1 Cmax Binary NP-hard [26℄2 1 2 pmtn Cmax O(r3 + nO) [25℄k l m pmtn Cmax O(rT k+l�1) [25℄2 1 3 pmtn Cmax Binary NP-hard [25℄1 1 1 pmtn Cmax O(nm(minfnm;m2g++mlogn) + r) [25℄do not possess the symmetry property of jobs and ma hines. Nevertheless, in [22℄ an algo-rithm of linear time in the number of ma hines has been suggested for problems O j n = 2 j �and O j n = 2; pmtn j � for an arbitrary regular optimality riterion.10 Mixed shopIn paper [24℄, a mixed shop problem has been onsidered for the �rst time in whi h nJ � njobs of the set J have the same �xed route (as for ow shop problem), and routes of nO � njobs of set O are not �xed (as for open shop problem). It is assumed that equality n = nJ+nOholds.In Table 3, known results about the omplexity of problems X jj � with a �xed numberof jobs are given. Number nJ means the number of jobs with �xed routes whi h may bedi�erent for di�erent jobs. The sign 1 in the se ond and third olumn of Table 3 spe i�esthat the orresponding parameter an be arbitrarily.In paper [27℄, a review of known results for mixed shop problems is given when the numbersnJ � n and nO � n of the jobs of the set J are not �xed. It is ne essary to note that, if theproblem is NP -hard for the makespan riterion, it remains NP -hard for all other regular riteria traditionally onsidered in s heduling theory.11 Con lusionThe literature in s heduling theory in ludes a large number of reviews and books devotedto one-stage and multi-stage pro essing systems. In this review, the border between poly-nomially solvable and NP -hard s heduling problems with a �xed number of jobs and anunlimited number of ma hines is given. 14

In parti ular, as it follows from Table 1, there is a polynomial algorithm for any regularoptimization riterion in the ase of two jobs while the problem with three jobs is NP -hard for any riterion traditionally onsidered in s heduling theory. The onstru tion ofa makespan optimal s hedule without operation preemptions for a mixed shop problem ispossible in polynomial time, if the number of jobs and ma hines is �xed provided that oneof the parameters m and nJ is not larger than two.From Tables 1-3 it follows that the lassi� ation of s heduling problems with a �xed numberof jobs is ompleted. Possible dire tions of further work in this area an be the improve-ment of the omplexity of eÆ ient algorithms for the riteria Cmax and PCi and also theinvestigation of similar s heduling problems for other optimization riteria.A knowledgments:This work has been supported by INTAS (proje ts 00-217 and 03-51-5501).Referen es[1℄ Johnson, S.M.: Optimal two- and three-stage produ tion s hedules with setup timesin luded, Naval Resear h Logisti Quarterly, Vol. 1, 1954, 61 - 68.[2℄ Akers, S.B.: A graphi al approa h to produ tion s heduling problems, Operations Re-sear h, Vol. 4, 1956, 244 - 245.[3℄ Akers, S.B.; Friedman, J.: A non-numeri al approa h to produ tion s heduling prob-lems, Operational Resear h, Vol. 3, 1956, 429 - 442.[4℄ Sotskov, Yu.N.: Optimal s heduling of two jobs with a regular riterion, Institute ofEngineering Cyberneti s of the A ademy of S ien es of BSSR, Minsk, 1985, 86 - 95 (inRussian).[5℄ Bru ker, P.: An eÆ ient algorithm for the job-shop problem with two jobs, Computing,1988, Vol. 40, 353 - 359.[6℄ Szwar , W.: Solution of the Akers-Friedman s heduling problem, Operations Resear h,Vol. 8, 1960, 782 - 788.[7℄ Hardgrave, W.H.; Nemhauser, G.L.: A geometri model and graphi al algorithm for asequen ing problem, Operations Resear h, Vol. 11, 1963, 889 - 900.[8℄ Sotskov, Yu.N.: Complexity of s heduling with �xed number of jobs, Doklady AkademiiNauk BSSR, Vol. 33, 1989, 488 - 491 (in Russian).[9℄ Sotskov, Yu.N.: Complexity of optimal s heduling of three jobs, Kibernetika, N 5, 1990,74 - 78 (in Russian).[10℄ Sotskov, Yu.N.: The omplexity of shop-s heduling problems with two or three jobs,European Journal of Operational Resear h, Vol. 53, 1991, 326 - 336.[11℄ Sotskov, Yu.N.; Shakhlevi h, N.V.: NP-hardness of optimal s heduling three jobs, VestsiAkademii Navuk BSSR Ser. Fiz-Mat. Navuk, N 4, 1990, 96 - 101 (in Russian).15

[12℄ Sotskov, Yu.N.; Shakhlevi h, N.V.: NP-hardness of shop-s heduling problems with threejobs, Dis rete Applied Mathemati s, Vol. 59, 1995, 237 - 266.[13℄ Serva h, V.V.: On the Akers-Friedman Problem, Upravljajemye Systemy, Novosibirsk,Vol. 23, 1983, 70 - 81 (in Russian).[14℄ Bru ker, P.; Juris h, B.; Meyer, W.: Geometri methods for solving the job-shops heduling problem, Preprint Heft 127, Fa hberei h Mathematik/Informatik, Univer-sit�at Osnabr�u k, 1989.[15℄ Bru ker, P.; S hlie, R.: Job-shop s heduling with multipurpose ma hines, Computing,Vol. 45, 1990, 369 - 375.[16℄ Krav henko, S.A.; Sotskov Yu.N.: Optimal makespan s hedule for three jobs on twoma hines, Mathemati al Methods of Operations Resear h, Vol. 43, 1996, 233 - 238.[17℄ Bru ker, P.: A polynomial algorithm for the two ma hine job-shop s heduling problemwith a �xed number of jobs, Operations Resear h Spektrum, Vol. 16, 1994, 5 - 7.[18℄ Bru ker, P.; Krav henko, S.A.; Sotskov, Yu.N.: On the omplexity of two ma hine job-shop s heduling with regular obje tive fun tions, Operations Resear h-Spe trum, Vol.16, 1994, 5 - 7.[19℄ Bru ker, P.; Krav henko, S.A.; Sotskov, Yu.N.: Preemptive job-shop s heduling prob-lems with a �xed number of jobs, Mathemati al Methods of Operations Resear h, Vol.49, 1999, 41 - 76.[20℄ Aho, A.V.; Hop roft, J.E.; Ullman, J.D., The design and analysis of omputer algo-rithms, Addison-Wesley, Reading, Mass., 1974.[21℄ Gonzalez, T.; Sahni,A.: Open shop s heduling to minimize �nish time, Journal of As-so iation of Computer Ma hinery, Vol. 23, 1976, 665 - 679.[22℄ Shakhlevi h, N.V.; Strusevi h, V.A.: S heduling two jobs in a multi-ma hine open shopto minimize an arbitrary regular penalty fun tion. Report 9125/A, Erasmus UniversityRotterdam, The Netherlands, 1990.[23℄ Strusevi h, V.A.: On the possibility of onstru ting optimal makespan s hedules formulti-stage systems with non�xed routes, Vestsi Akademii Navuk BSSR Ser. Fiz-Mat.Navuk, N 6, 1986, 43 - 48 (in Russian).[24℄ Masuda, T.; Ishii, H.; Nishida, T.: The mixed shop s heduling problem, Dis rete Ap-plied Mathemati s, Vol. 11, 1985, 175 - 186.[25℄ Shakhlevi h, N.V.; Sotskov, Yu.N.; Werner, F.: Shop-s heduling problems with �xedand non-�xed ma hine orders of jobs, Annals of Operations Resear h, Vol. 92, 1999,281 - 304.[26℄ Shakhlevi h, N.V.; Sotskov, Yu.N.: S heduling two jobs with �xed and non�xed rou-tines, Computing, Vol. 52, 1994, 17 - 30.16

[27℄ Shakhlevi h, N.V.; Sotskov, Yu.N.; Werner, F.: Complexity of mixed shop s hedulingproblems: A survey, European Journal of Operational Resear h, Vol. 120, 2000, 343 -351.AppendixProof of Theorem 2: We redu e problem PARTITION polynomially to the followingde ision problem. Does there exist a s hedule for J2 j n = 3; pmtn j Cmax su h thatCmax � y?Given an instan e of problem PARTITION we onstru t the following instan e for J2 jn = 3; pmtn j Cmax. Let H > 3� and set y = 41Hk + 2�k + 3:5�. The stru ture of theJ2 j n = 3; pmtn j Cmax - instan e an be divided into k periods as shown in Figure 8 (a)-( ).In these �gures, operations to be pro essed on ma hine M1 (ma hine M2) are representedby white (bla k) ir les. The pro essing times of the operations are shown above the ir les.J2J1

5H + e2 2H + e22H + e15H + e1O13 O23 O33J3 O52O42O32O22O12 9H + 3�5H + e1 + e212H 5HO624HO43

O414H11H +�11H +�O11 O31 2H + e1 + e25H + e1 + e2O21

Figure 8 (a): The �rst periodJ2J1J3

12H 5H4H4H11H +�

11H +�O51 O61 O71 O81O72 O82 O92 O10;2 O11;2 O12;2O53 O63 O73 O83

5H + e4 2H + e45H + e3 + e4 9H + 2� 5H + e3 + e4 2H + e3 + e42H + e35H + e3Figure 8 (b): The se ond period17

J2J1J311H +�11H +�

5H + e2kO1+4(k�1);1 O2+4(k�1);1 O3+4(k�1);12H + e2k O4k;1O6k;2O5+6(k�1);2O4+6(k�1);2O3+6(k�1);2O2+6(k�1);2O1+6(k�1);2O1+4(k�1);3 5H + e2k�1O2+4(k�1);3 2H + e2k�1O3+4(k�1);32H + e2k�1 + e2k12H 5H + e2k�1 + e2k 9H + 2� 5H + e2k�1 + e2k 4H5H4HO4k;3Figure 8 ( ): The last (kth) periodFirst, we show that if problem PARTITION has a solution, then a s hedule with Cmax � yexists.Assume that there is a partition A1; A2 of A = f1; 2; : : : ; 2kg withXi2A1 ei =Xi2A2 ei = E = 0:5�:Then we onstru t a s hedule for the instan e of problem J2 j n = 3; pmtn j Cmax whi h onsists of k blo ks. The ith blo k orresponds to the ith period of the instan e.If e1 2 A1 and e2 2 A2, the �rst blo k is as shown in Figure 9 (a). Figure 9 (b) shows the�rst blo k for the ase e1 2 A2, e2 2 A1. In both �gures it is possible to swit h O43 and O41in the last three sli es. Furthermore, in ea h of these �gures as well as in the following �guresthe �rst line orresponds with M1 and the se ond line orresponds with M2. Preemptionsare indi ated by arrows.

-11H +� H �� 5H + e1 + e2O13 O11 O2212HO12 O235H + e1 2H + e1O31 O1110H + 2� 5H + e1 + e2O42 O312H + e2 5HO629H + 3�O32 O433H + e1 �� 5H + e2O21 O43e1 2H + e1 + e2O52 O43H � 2e1 +� 4HO41� - �- �Figure 9 (a): First blo k if e1 2 A1 and e2 2 A2

18

-11H +� H �� 5H + e1 + e2O2212HO125H + e1 + e2O42 5HO629H + 3�O23 2H + e1 + e2O52

� - �-O11 O13 O312H + e2 10H + 2�O13 O332H + e15H + e2O21 O413H + e2 �� 5H + e1O23 e2O41 �4HO43 O41H � 2e2 +�Figure 9 (b): First blo k if e1 2 A2 and e2 2 A1For the ase e1 2 A1, e2 2 A2 the extensions of the �rst blo k (see Figure 9 (a)) are shownfor the ases e3 2 A1, e4 2 A2 and e3 2 A2, e4 2 A1 in Figure 10 (a) and Figure 10 (b),respe tively. As we an hoose either O41 or O43 to be the last operation in all partials hedules an be ombined.

��--�-11H +� H � 2e1 5H + e3 + e4 2H + e3 10H +�+ 2e1 5H + e3 + e4 2H + e4 5HO53 O51 O82 O73 O51 O10;2 O71 O12;2�� 2e1 12H 5H + e3 9H + 2� 3H ��+ e3 + 2e1 e3 2H + e3 + e4 4H H +�� 2e1 � 2e3O41 O72 O63 O92 O83 O61 O83 O11;2 O81 O835H + e4Figure 10 (a): Se ond blo k if e3 2 A1 and e4 2 A2

��--�-�11H +� H � 2e1 5H + e3 + e4 2H + e4 10H +�+ 2e1 5H + e4 + e3 2H + e3 5H�� 2e1 12H 5H + e4 9H + 2� 3H ��+ e4 + 2e15H + e3 e4 2H + e3 + e4 4H H +�� 2e1 � 2e4O51 O53 O82 O71 O53 O10;2 O73 O12;2O43 O72 O61 O92 O81 O63 O81 O11;2 O83 O81Figure 10 (b): Se ond blo k if e3 2 A2 and e4 2 A119

Similarly, we get extensions for the ase e1 2 A2, e2 2 A1 (see Figure 9 (b)) if in the extensionwe inter hange orresponding operations of the �rst and third job. Note, that (as in the �rstblo k) in the se ond blo k we an hoose O83 or O81 to be s heduled as the last operation.Thus, in ea h Figure 9 (a), 9 (b), 10 (a), and 10 (b) we have two possible s hedules.Similarly, we onstru t blo ks � = 3; 4; : : : ; k. The resulting s hedule has length y asshown in Figure 11. In this �gure we suppose that A1 = fe1; e3; : : : ; e2k�1g and A2 =fe2; e4; : : : ; e2kg. : : :e1 e3 e2k�1e2 e4 e2k�rst blo k se ond blo k last (k-th) blo k41H + 2�+ 3e1 + 3e2 + e1 41H + 2�+ 3e3 + 3e4 + e3 41H + 2�+ 3e2k�1 + 3e2k + e2k�141H + 3�+ 2e1 + 2e2 + e2 41H + 2�+ 2e3 + 2e4 + e4 41H + 2�+ 2e2k�1 + 2e2k + e2kFigure 11: S hedule for the instan eNext, we show that if a s hedule with Cmax � y exists for the instan e, then problemPARTITION has a solution. Due to Lemma 1 we may onsider only s hedules in whi h atleast one operation �nishes at the end of ea h sli e.Taking into a ount P�ij=M1 pij = P�ij=M2 pij = 41 �H � k + 2� � k + 3 � �, the total idle timeof ma hine M1 as well as the total idle time of ma hine M2 is not more than 0:5� in thedesired s hedule.Through an extensive ase analysis it an be shown that in order to satisfy the bound 0:5�for the idle time, we must s hedule the operations from the �rst period in one of the fourways shown in Figure 9 (remember that O43 an be s heduled as last operation instead ofO41), the operations from the se ond period in one of the four ways shown in Figure 10,and so on. Thus, for the pro essing lengths on both ma hines in ea h period we have twopossibilities. These possibilities are indi ated in Figure 12.

�2e2B1 e1e2 �2e1 2e3e4 2e4e341H + 2� + 2e3 + 2e441H + 2� + 2e3 + 2e4

B241H + 2� + 2e1 + 2e241H + 2� + 2e1 + 2e2

Figure 12Let Bi = 41H+2�+2e2i+2e2i�1 for i = 1; 2; : : : ; k. It follows from Figure 12 that for someset A1 � f1; 2; : : : ; 2kg su h that A1 in ludes exa tly one element from ea h pair (2i� 1, 2i)(i = 1; 2; : : : ; k)� kPi=1Bi + Pi2A1 ei +� is a lower bound for the ompletion time on ma hine M2,20

� kPi=1Bi+ Pi2A1 ei+2(�� Pi2A1 ei) is a lower bound for the ompletion time on ma hineM1.Thus, we have kPi=1Bi + Pi2A1 ei +� � y = 41Hk+ 2�k+ 3:5� = kPi=1Bi + 1:5� whi h impliesPi2A1 ei � 0:5� and kPi=1Bi+ Pi2A1 ei+2(�� Pi2A1 ei) � y whi h implies Pi2A1 ei � 0:5�. Therefore,Pi2A1 ei = 0:5� and we on lude that A1 solves the problem PARTITION.It is easy to see that the above redu tion of problem PARTITION to problem J2 j n =3; pmtn j Cmax is a polynomial one, and thus Theorem 2 is proven. �

21