European Journal of Operational Research 156 (2004) 261–266 www.elsevier.com/locate/dsw
Short Communication
Parallel machine scheduling of machine-dependent jobs with unit-length q Yixun Lin *, Wenhua Li Department of Mathematics, Zhengzhou University, Zhengzhou, Henan 450052, China Received 24 April 2002; accepted 5 December 2002
Abstract In this paper we study the parallel machine scheduling problem with unit-length jobs in which each job j is only allowed to be processed on a specified subset Mj of machines. For the problem P jpj ¼ 1; Mj jCmax where the subset family fMj g is nested, Pinedo [Scheduling: Theory, Algorithms, and Systems, Prentice-Hall, Englewood Cliffs, NJ, 1995] established an least flexible job first algorithm. We further present polynomial algorithms for the problem with general subset family fMj g. As a generalization of the problem for nested family, we consider the problem for convex subset family fMj g and present an efficient algorithm for solving it. Ó 2003 Elsevier B.V. All rights reserved. Keywords: Scheduling; Parallel machine; Unit-length job; Machine eligibility constraint
1. Introduction The parallel machine scheduling problems have been extensively studied in the literature [3,4,7]. In a basic model, there is a set M ¼ fM1 ; M2 ; . . . ; Mm g of identical machines, which are used to process n jobs J1 ; J2 ; . . . ; Jn . Each job Jj has one operation which can be processed on any machine with processing time pj . The objective is to minimize the makespan Cmax . By the well-known three-field representation [3], this problem is denoted by P kCmax . In some practical applications, the machines may have different capabilities (or eligibility req
Project supported by NSFC (grant no. 10371112). Corresponding author. E-mail address:
[email protected] (Y. Lin).
*
strictions). This gives rise to a generalization that each job Jj is only allowed to be processed on a specified subset Mj of machines (Mj M). This subset Mj is called the admissible set of job Jj (1 6 j 6 n). The generalized model can be denoted by P jMj jCmax . In fact, it can be regarded as a special case of unrelated parallel machine scheduling with processing times pij ¼
pj ; 1;
if Mi 2 Mj ; if Mi 2 6 Mj :
Since P kCmax is NP-hard, it is clear that the generalization P jMj jCmax is also NP-hard. Pinedo [9] proposed the problem P jpj ¼ 1; Mj jCmax , in which each job has a processing time of unit. When the admissible subset family fMj g is nested, i.e.,
0377-2217/$ - see front matter Ó 2003 Elsevier B.V. All rights reserved. doi:10.1016/S0377-2217(02)00914-1
262
Y. Lin, W. Li / European Journal of Operational Research 156 (2004) 261–266
Mi \ Mj 6¼ ; ) Mi Mj Mj Mi
or for all i and j;
he established a least flexible job first (LFJ) algorithm. The computational complexity of P jpj ¼ 1; Mj jCmax for general subset family fMj g was left open. Later, Centeno and Armacost [2] studied a special case of P jrj ; Mj jLmax , namely, the problem of minimizing the maximum lateness Lmax with release times rj and due dates dj ¼ rj þ c. Bhatia et al. [1] also considered the machine capability constraint, and they focused attention on a more complicated model with precedence and loading (setup) time constraints, which was shown to be NP-hard. In this paper we mainly investigate the problem P jpj ¼ 1; Mj jCmax with general subset family fMj g. First we present an Oðn3 log nÞ-time algorithm, which can be naturally generalized to the case where the machines have different speeds. Then we give a more efficient algorithm for the problem in which the family fMj g is convex, which is a generalization of nested family. Here, a subset family fMj g is said to be convex if we can order m machines in a sequence, say (M1 ; M2 ; . . . ; Mm ), such that each subset Mj consists of consecutive terms of the sequence. This is similar to the concept of ‘‘convex bipartite graph’’ [6]. In the case of fMj g being convex, we obtain an Oðmðm þ nÞÞ algorithm. The organization of the paper is as follows. In Section 2 we establish the basic algorithm for P jpj ¼ 1; Mj jCmax with general constraint. Then, we apply the algorithm to Qjpj ¼ 1; Mj jCmax . Section 3 is devoted to the case of convex subset family fMj g and to develop a revised LFJ algorithm. We provide some concluding remarks in Section 4.
2. Binary search algorithm Let us consider the problem P jpj ¼ 1; Mj jCmax for which M ¼ fM1 ; M2 ; . . . ; Mm g is the set of m identical machines; J1 ; J2 ; . . . ; Jn are the jobs with unit-length (pj ¼ 1); the machine capability constraint is represented by a family of admissible
Fig. 1. Network N .
subsets Mj ¼ fMi 2 MjJj can be processed on Mi g (j ¼ 1; 2; . . . ; n); and the objective function is the makespan Cmax (the final completion time of all jobs). We will use a network flow based method on the problem. The network flow theory can be consulted in [6,8]. For any given subset family fMj g we can construct a network N as follows. Let X ¼ fx1 ; x2 ; . . . ; xm g correspond to the set of m machines, Y ¼ fy1 ; y2 ; . . . ; yn g to the set of n jobs. The vertex set of N is V ¼ fs; tg [ X [ Y , where s is a source and t is a sink. The arc set A of N consists of the following arcs: ðs; xi Þ
for all xi 2 X ði ¼ 1; . . . ; mÞ;
ðxi ; yj Þ for Mi 2 Mj ð1 6 i 6 m; 1 6 j 6 nÞ; ðyj ; tÞ for all yj 2 Y ðj ¼ 1; . . . ; nÞ: All arcs ðxi ; yj Þ and ðyj ; tÞ have unit capacity; and all arcs ðs; xi Þ have capacity c, a variable parameter. Without loss of generality, we may assume that c is a positive integer. We denote this network by N ¼ ðV ; A; cÞ, as shown in Fig. 1. Theorem 2.1. The problem P jpj ¼ 1; Mj jCmax has a feasible schedule of makespan Cmax 6 c if and only if the value of max-flow in network N ¼ ðV ; A; cÞ is n. Proof. If the scheduling problem has a feasible schedule of Cmax 6 c, then at most c jobs are assigned on each machine. We may define a flow f in network N as follows: 1; if Jj is assigned to Mi ; f ðxi ; yj Þ ¼ 0; otherwise; m X f ðxi ; yj Þ ¼ 1 for j ¼ 1; . . . ; n; f ðyj ; tÞ ¼ i¼1
Y. Lin, W. Li / European Journal of Operational Research 156 (2004) 261–266
f ðs; xi Þ ¼
n X
f ðxi ; yj Þ 6 c
for i ¼ 1; . . . ; m:
j¼1
It is easy to see that this is a max-flow in N with value n. Conversely, if the value of a max-flow in N is n, then there exists an integral max-flow f such that all arcs ðyj ; tÞ are saturated. This is because that all these arcs have unit capacity and they form a cut of capacity n. Thus the n unit flow f must saturate this cut. So we can get a feasible schedule by assigning job Jj to machine Mi if f ðxi ; yj Þ ¼ 1. Since each arc ðs; xi Þ has capacity c, it follows that at most c jobs are assigned on each machine. Therefore the makespan Cmax is not greater than c. This completes the proof. Based on this theorem, the problem P jpj ¼ 1; Mj jCmax can be solved by searching for the minimal parameter c. Thus we obtain the following binary search algorithm. BS Algorithm Step 0 : Construct the network N ¼ ðV ; A; cÞ from the subset family fMj g (where c is an unknown parameter for the time being). Let l ¼ 1 and u ¼ n. Step 1 : If l ¼ u, then the optimal value is reached: Cmax ¼ l; return the schedule of makespan l, stop. Step 2 : Let c ¼ b12 ðl þ uÞc. Find the max-flow in network N ¼ ðV ; A; cÞ. If the value of max-flow is exactly n, namely Cmax 6 c, then set u :¼ c and write down the schedule of makespan c by means of the maxflow. Otherwise, the value of max-flow is less than n, namely, Cmax > c, we set l :¼ c þ 1. Go back to Step 1.
to the running time of the algorithm, it is clear that the binary search has log n stages each of which is a procedure of finding max-flow in network N . It is well-known that there are Oðn3 Þ algorithms for the max-flow problem [6,8]. Therefore the time bound of our algorithm is Oðn3 log nÞ. The theorem follows. In fact, the network N considered in our algorithm has special structure (it can be changed into a Ôsimple networkÕ if each vertex xi is replaced by c vertices). So, the max-flow algorithm on it would have complexity less than Oðn3 Þ (see [8] for details). Therefore the complexity result in Theorem 2.2 can be improved slightly. We can further consider the problem Qjpj ¼ 1; Mj jCmax , i.e., the case of uniform parallel machines. In this case, m machines have different speeds; the speed of machine Mi is denoted by vi . Accordingly, the actual processing time of job Jj on machine Mi is pj =vi (at the moment pj ¼ 1). Without loss of generality we may assume that all speeds v1 ; v2 ; . . . ; vm are positive integers (the machines with vi ¼ 1 are regarded as standard machines). Let v be the least common multiple of v1 ; v2 ; . . . ; vm . Then the completion time of every job will be an integer if we take 1=v as a time unit. We may construct the network N ¼ ðV ; A; cÞ as before, except that the capacity of arc ðs; xi Þ is defined to be vi c, as shown in Fig. 2. Similar to Theorem 2.1, we have Theorem 2.3. The problem Qjpj ¼ 1; Mj jCmax has a feasible schedule of makespan Cmax 6 c if and only if the value of max-flow in network N ¼ ðV ; A; cÞ is n.
Theorem 2.2. The BS algorithm correctly solves the problem P jpj ¼ 1; Mj jCmax for any subset family fMj g in Oðn3 log nÞ time. Proof. By Theorem 2.1, we can assert that l 6 Cmax 6 u holds during the process of the algorithm. As soon as the algorithm terminates, l ¼ Cmax ¼ u, an optimal solution is obtained. As
263
Fig. 2. Network N .
264
Y. Lin, W. Li / European Journal of Operational Research 156 (2004) 261–266
So we can use the binary search algorithm to determine the minimal makespan Cmax and the optimal schedule as before. However, the value of parameter c now may not be integral. The range ½1=v; n of c must be divided into vn 1 sections by the time unit 1=v and the binary search is executed in these sections. Hence, there will be Oðlog nvÞ stages in the BS algorithm. We then come to the following conclusion. Theorem 2.4. The BS algorithm correctly solves the problem Qjpj ¼ 1; Mj jCmax for any subset family fMj g in Oðn3 log nvÞ time.
3. Convex subset family We discuss a special case––the problem P jpj ¼ 1; Mj jCmax where fMj g is a convex subset family. We first address the problem of determining the convexity of a subset family fMj g. In fact, a family fMj g can be represented by a ð0; 1Þ-matrix in which a row corresponds an element Mi and a column corresponds a subset Mj , and the entry ði; jÞ is 1 if and only if Mi 2 Mj . Then fMj g is convex if and only if the matrix has Ôthe consecutive 1Õs property for columnsÕ, namely, the rows of the matrix can be permuted in such a way that the 1Õs in each column occur consecutively. This is also equivalent to the interval hypergraph recognition problem. It is well-known in the literature [5] that the recognition of the consecutive 1Õs property (as well as that of interval graphs or interval hypergraphs) can be solved in linear time. Hence, we may assume here that the convexity of family fMj g has been shown. For the sake of simplicity, suppose that M ¼ f1; 2; . . . ; mg. Moreover, by an integer interval ½a; b, we mean the set of integers fi 2 Z j a 6 i 6 bg ¼ fa; a þ 1; . . . ; b 1; bg (a 6 b). For the case of convex family, we may assume that m machines have been ordered as (1; 2; . . . ; m) such that each admissible set Mj is an integer interval: Mj ¼ ½aj ; bj ðaj ; bj 2 M; aj 6 bj Þ: For any a; b 2 Mða 6 bÞ, we define
J ½a; b ¼ fJj ja 6 aj 6 bj 6 bg as a set of jobs whose admissible sets are included in ½a; b. Theorem 3.1. The minimal makespan of the problem is jJ ½a; bj Cmax ¼ max : 16a6b6m b a þ 1 Proof. Denote jJ ½a; bj : k ¼ max 16a6b6m b a þ 1 We are going to prove Cmax ¼ k. For any given a and b (1 6 a 6 b 6 m), the jobs in J ½a; b are only allowed to be processed on the b a þ 1 machines in ½a; b. So, the final completion time c½a; b of these machines satisfies
c½a; b P
jJ ½a; bj : baþ1
By the arbitrariness of a and b, we have Cmax P k. In order to show Cmax 6 k, it suffices to construct a feasible schedule of makespan k. We give an algorithm as follows.
Revised LFJ Algorithm Step 0 : Let i ¼ 1; S ¼ ; (where S denotes the set of jobs which have been assigned). Step 1 : Let Ti ¼ fJj jJj 62 S; aj 6 i 6 bj g be the set of jobs which can be assigned to machine i. If Ti ¼ ;, go to the next step. If 0 < jTi j 6 k, then assign all jobs in Ti to machine i; If jTi j > k, then, according to the non-decreasing order of fbj g (the ÔLFJÕ rule), assign the first k jobs in Ti to machines i. Put all assigned jobs into S. Step 2 : Stop if i ¼ m; otherwise let i :¼ i þ 1, go back to Step 1. We proceed to show that the algorithm can produce a feasible schedule of makespan k. If not, there must be a job Jj which cannot be assigned in any machine. Suppose that this Jj is the first job not being assigned (i.e., the one with the least bj
Y. Lin, W. Li / European Journal of Operational Research 156 (2004) 261–266
among those failed jobs). For brevity, the machines which have received k jobs in the algorithm are called Ôfull machinesÕ. Then, for aj 6 i 6 bj , the machines i must be full, so that there is no room to hold Jj . Besides, there may be more full machines. Let b ¼ bj and let a be the least number such that all machines in ½a; b are full. Then 1 6 a 6 aj . Note that the machine ða 1Þ is not full if a > 1. It can be seen that Jj and all jobs assigned to the machines in ½a; b belong to J ½a; b. In fact, for a job Ji assigned in ½a; b, the rule in Step 1 implies that bi 6 bj ¼ b. On the other hand, we have ai P a. Otherwise, ai 6 a 1, Ji would be assigned to machine a 1, as it is not full. So Ji 2 J ½a; b. Hence jJ ½a; bj P ðb a þ 1Þk þ 1;
265
fact, the algorithm has m stages and in each stage we assign the jobs in Ti in OðnÞ time. To summarize, the overall complexity of the algorithm is Oðmðm þ nÞÞ. This completes the proof. Pinedo [9] studied the case of nested subset family fMj g (i.e., Mi \ Mj 6¼ ; ) Mi Mj or Mj Mi ). It is easy to show by induction on n that if a family fMj g is nested, then it is convex. But the converse is not true. Theorem 3.2 implies the following. Corollary 3.3. For nested subset family fMj g, the problem P jpj ¼ 1; Mj jCmax has an Oðmðm þ nÞÞ algorithm.
thus jJ ½a; bj > k; baþ1 which contradicts the definition of k. Therefore Cmax ¼ k. The theorem follows. Theorem 3.2. The revised LFJ algorithm correctly solves the problem P jpj ¼ 1; Mj jCmax with convex subset family fMj g in Oðmðm þ nÞÞ time.
The following example in [9] illustrates that the LFJ algorithm may not work if fMj g is not nested: M1 ¼ f1; 2g; M2 ¼ M3 ¼ f1; 3; 4g; M4 ¼ f2g; M5 ¼ M6 ¼ M7 ¼ M8 ¼ f3; 4g: However, this fMj g is convex in viewing the order (2,1,3,4) of machines. Our algorithm provides the following solution:
Proof. The correctness has been proved in Theorem 3.1. Let us see the time bound of the algorithm. Note that we have to compute k in advance. For doing this, there are two steps as follows. First, we should calculate an m m matrix kab where jJ ½a; bj; if a 6 b; kab ¼ 0; otherwise: This can be done by constructing the sets J ½a; ¼ fJj ja 6 aj g and sets J ½; b ¼ fJj jbj 6 bg in OðmnÞ time (for each a or b, scan all n jobs); and computing all jJ ½a; bj ¼ jJ ½a; \ J ½; bj in Oðm2 Þ time. Second, compute kab k ¼ max 16a6b6m b a þ 1 in Oðm2 Þ time. After k has been computed, the revised LFJ algorithm can be carried out in OðmnÞ time. In
4. Concluding remarks In the foregoing sections we have investigated the parallel machine scheduling problems with admissible subset constraint––each job j is only allowed to be processed on the machines in subset Mj . These models come up in connection with many application backgrounds. Meanwhile, they have theoretic interest in the viewpoint of
266
Y. Lin, W. Li / European Journal of Operational Research 156 (2004) 261–266
combinatorics. In fact, they can be regarded as generalizations of the system of distinct representatives (SDR) problem: the existence of SDR is equivalent to determining whether the problem P jpj ¼ 1; Mj jCmax (m P n) has a schedule of Cmax ¼ 1. There are many aspects worthwhile to further study. For example, we have considered the PobjectivePCmax . How about the others, e.g., Cj , Lmax , Uj , etc? In the case of ordinary processing times (not necessarily unit-length), the problem P jMj jCmax is NP-hard. It is significant to study the approximation algorithms and other polynomially solvable cases. As a generalization of nested subset family, we have taken the convex subset family fMj g into account. More results on other special cases would be expected. Acknowledgements The authors would like to thank the referees for their helpful comments on improving the representation of the paper.
References [1] R. Bhatia, S. Khuller, J. Naor, The loading time scheduling problem, Journal of Algorithms 36 (2000) 1–33. [2] G. Centeno, R.L. Armacost, Parallel machine scheduling with release time and machine eligibility restrictions, Computers and Industrial Engineering 33 (1997) 273– 276. [3] B. Chen, C.N. Potts, G.J. Woeginger, A review of machine scheduling: Complexity, algorithms and approximability, in: D.Z. Du, P.M. Pardalos (Eds.), Handbook of Combinatorial Optimization, Kluwer Academic Publishers, Dordrecht, 1998, pp. 21–169. [4] T.C.E. Cheng, C.C.S. Sin, A state-of-the-art review of parallel-machine scheduling research, European Journal of Operational Research 47 (1990) 271–292. [5] M.C. Golumbic, Algorithmic Graph Theory and Perfect Graphs, Academic Press, New York, 1980. [6] E.L. Lawler, Combinatorial Optimization: Networks and Matroids, Holt, Rinehart & Winston, New York, 1976. [7] E. Mokotoff, Parallel machine scheduling problems: A survey, Asia-Pacific Journal of Operational Research 18 (2001) 193–242. [8] C.H. Papadimitriou, K. Steiglitz, Combinatorial Optimization: Algorithms and Complexity, Prentice-Hall, Englewood Cliffs, NJ, 1982. [9] M. Pinedo, Scheduling: Theory, Algorithms, and Systems, Prentice-Hall, Englewood Cliffs, NJ, 1995.