This article was downloaded by: [192.30.84.47] On: 04 October 2016, At: 05:43 Publisher: Institute for Operations Research and the Management Sciences (INFORMS) INFORMS is located in Maryland, USA
Operations Research Publication details, including instructions for authors and subscription information: http://pubsonline.informs.org
Resource Constrained Chain Scheduling of UET Jobs on Two Machines W. Kubiak, J. Błażewicz, M. Dror, N. Katoh, H. Rock,
To cite this article: W. Kubiak, J. Błażewicz, M. Dror, N. Katoh, H. Rock, (1998) Resource Constrained Chain Scheduling of UET Jobs on Two Machines. Operations Research 46(5):742-746. http://dx.doi.org/10.1287/opre.46.5.742 Full terms and conditions of use: http://pubsonline.informs.org/page/terms-and-conditions This article may be used only for the purposes of research, teaching, and/or private study. Commercial use or systematic downloading (by robots or other automatic processes) is prohibited without explicit Publisher approval, unless otherwise noted. For more information, contact
[email protected]. The Publisher does not warrant or guarantee the article’s accuracy, completeness, merchantability, fitness for a particular purpose, or non-infringement. Descriptions of, or references to, products or publications, or inclusion of an advertisement in this article, neither constitutes nor implies a guarantee, endorsement, or support of claims made of that product, publication, or service. © 1998 INFORMS Please scroll down for article—it is on subsequent pages
INFORMS is the largest professional society in the world for professionals in the fields of operations research, management science, and analytics. For more information on INFORMS, its publications, membership, or meetings visit http://www.informs.org
TECHNICAL
NOTE
Downloaded from informs.org by [192.30.84.47] on 04 October 2016, at 05:43 . For personal use only, all rights reserved.
RESOURCE CONSTRAINED CHAIN SCHEDULING OF UET JOBS ON TWO MACHINES W. KUBIAK Memorial University of Newfoundland, St. John’s, Canada
J. BŁAZ˙EWICZ Politechnika Poznan ´ska, Poznan, Poland
M. DROR University of Arizona, Tucson, Arizona
N. KATOH Kobe University of Commerce, Kobe, Japan
H. ROCK Universita ˝t Rostock, Rostock, Germany (Received January 1993; revisions received January 1994, August 1994, August 1995, June 1996; accepted July 1996) A well-known technique for solving scheduling problems with two identical parallel processors and unit execution time jobs under a makespan minimization criteria involves finding maximum cardinality matchings in the graph associated with the problem, and then using these matchings to create optimal schedules. For some problem instances, however, this method will not work, since the problems are NP-hard. In this note, a previously open problem involving additional resource constraints is shown to have a polynomial algorithm using cardinality matching method.
S
cheduling theory has received much attention in recent years because of its applications in manufacturing, computer science, and telecommunications. Still, a number of interesting open problems remain, one of which is addressed in this note. We focus on scheduling unit execution time (UET) jobs on two parallel identical processors where additional resources besides the processors may be required for processing the jobs. (For a survey of resource constrained scheduling, see Błaz˙ewicz et al. 1987, and Błaz˙ewicz et al. 1993.) The objective is to find a schedule of minimum length. A well-known and often-utilized technique for solving similar problems, finds a maximum cardinality matching in graph U associated with an instance of a problem, and then turns the matching into a feasible optimal schedule. To illustrate how this solution approach works, consider, for example, the problem of scheduling UET jobs with arbitrary precedence constraints and without resource constraints. Using the notation of scheduling problems proposed in Graham et al. (1979), this problem is denoted as P2uprec, pj 5 1uCmax. Its graph U consists of a node for each job, and an undirected edge {i, j} if and only if jobs i and j are independent (Fujii et al. 1969). Another example where maximum cardinality
matching is successfully used for constructing an optimal solution is the problem with arbitrary resource requirements and no precedence relation. This problem is denoted as P2ures . . . , pj 5 1uCmax. (“res . . . ” implies that the number of resource types is specified in the problem input together with the capacity of each resource type and the limit on the number of units of each resource type required by each job.) In this case, graph U includes edge {i, j} if and only if the combined resource requirements of job i and job j do not exceed the capacity of any single resource type (Garey and Johnson 1975). Maximum cardinality matching does not always characterize the optimal makespan of UET jobs scheduled on two processors. For instance, the following problems are NP-hard in the strong sense: ● scheduling chains of arbitrary lengths with one resource type, one unit of which is available (problem P2ures111, chain, pj 5 1uCmax) (Błaz˙ewicz et al. 1983); ● scheduling chains not longer than two and with many resource types, each of unit capacity (problem P2ures z 11, chain ¶ 2, pj 5 1uCmax) (Warmuth 1984);
Subject classifications: Analysis of algorithms: computational complexity. Networks/graphs: matchings. Scheduling: sequencing, deterministic. Area of review: OPTIMIZATION. Operations Research Vol. 46, No. 5, September–October 1998
742
0030-364X/98/4605-0742 $05.00 q 1998 INFORMS
˙EWICZ, DROR, KATOH, KUBIAK, BŁAZ
AND
˝ CK RO
/
743
Downloaded from informs.org by [192.30.84.47] on 04 October 2016, at 05:43 . For personal use only, all rights reserved.
● scheduling chains not longer than three with one resource type of arbitrary capacity (problem P2ures1 z z , ¨ck 1984). chain ¶ 3, pj 5 1uCmax) (Ro In these problems, graph U includes edge {i, j} if and only if jobs i and j are independent and, moreover, combined resource requirements of jobs i and j do not exceed resource capacities. In this note, an open problem P2ures1 z z , chain ¶ 2, pj 5 1uCmax is considered, and an O(n3) time algorithm is presented for it. In this problem, set J of n UET jobs is to be scheduled on two parallel identical processors P1 and P2. The jobs in J are nonpreemptable and are partially ordered by a chain precedence relation a, i.e., a linear order. No chain includes more than two jobs. Each job j requires one processor and r( j) ¶ m resource units for its processing. The capacity m of this resource, i.e., the number of units available, may not be exceeded by total resource requirements at any time in any feasible schedule. The objective is to schedule jobs so as to minimize the schedule length (makespan). 1. SCHEDULING CHAINS WITH ONE RESOURCE TYPE An instance of the problem can be represented as a mixed graph G 5 (V, E, A), where the node set V corresponds to the set of jobs, A 5 {(i, j) : i Þ j and i precedes j} is a set of arcs defining precedence relation a, and the edges in E specify all the pairs of jobs that can be done in parallel, i.e., E 5 {{i, j} : i Þ j and r(i) 1 r( j) ¶ m, and {(i, j), ( j, i)} ù A 5 À}. By definition of the problem, the directed subgraph D 5 (V, A) consists of a set of chains with at most two jobs in each chain. Denote }G 5 (V, E). Let M be a matching in }G, and MC be the set of the nodes in V that are not incident to the edges of M. A precedence graph of M is a directed graph DM 5 (M ø MC, B), with each pair of nodes matched by M being a single node, and arcs in B inherited from graph G. An arc (a, b) [ B if and only if the jobs represented by a and b (a and/or b may represent one or two jobs) are connected by an arc in A from a job in a to a job in b. A matching M is said to be feasible if and only if DM is acyclic; otherwise, it is said to be semifeasible. In case of acyclic DM, a linear order of the nodes of DM, which respects the precedence constraints defined by B, can be easily constructed and turned into a feasible schedule for the original scheduling problem with the makespan of uMu 1 uMCu. Therefore, minimizing the makespan is equivalent to finding a maximum cardinality feasible matching in }G. The following example illustrates the definitions that have been introduced so far: Job i r(i) 1 3 2 5 3 8 4 10 5 5 6 4 7 7 m 5 10
Precedence Constraints precedes 3 precedes 5
precedes 7
Figure 1. The corresponding graphs and matchings are depicted in Figure 1. Graph DM decomposes into disconnected directed M M graphs HM i 5 (Vi , Ai ), i 5 1, . . . , p, . . . , q, called comM ponents. Let Ts be the set of jobs in HM s , s 5 1, . . . , p, . . . , q. Since the length of each chain in A is at most two, the sum of in-degree and out-degree of each node in DM is less than or equal to two. Thus, each component of DM is either a simple cycle or an acyclic subgraph, and consequently DM can be rewritten as DM 5 {HM i }i51, . . . , p, . . .,q,, where the first p components are acyclic and the last q 2 p are cycles. In Lemma 1, we prove that a semifeasible maximum cardinality matching can be converted into a feasible matching in }G at the cost of decreasing its cardinality by one unit, thus providing an approximate schedule with an absolute error of 1. Lemma 1. Let M be a semifeasible matching in }G. Then, a feasible matching M9 can be constructed with uM9u 5 uMu 2 1. Proof. The proof is based on the observation that the cycles in DM can be patched up together into one acyclic component while reducing the cardinality of the resulting matching, relative to the original matching, by one unit. Let {ui, li} [ M be a node in DM that belongs to cycle i in DM, i 5 p 1 1, . . . , q. Without loss of generality, assume that
744
/
˙EWICZ, DROR, KATOH, KUBIAK, BŁAZ
AND
˝ CK RO
r~u p11 ! < · · · < r~u q !,
(1)
and r~u i ! > r~l i !,
i 5 p 1 1, . . . , q.
(2)
Downloaded from informs.org by [192.30.84.47] on 04 October 2016, at 05:43 . For personal use only, all rights reserved.
Define M9 as follows:
S
M9 5 M 2
q
ø $$u i , l i %% i5p11
D øS ø
q21
i5p11
D
$$u i , l i11 %% .
(3)
M9 is a matching in }G, and its cardinality is one less than that of M. From (1) and (2), total resource requirements for pair {ui, li11}, i 5 p 1 1, . . . , q 2 1, do not exceed m. Moreover, since {ui, li11}, i 5 p, . . . , q 2 1 are in different components of DM, then {(ui, li11), (li11, ui)} ù A 5 À; consequently, {ui, li11} [ E, i 5 p, . . . , q 2 1. Therefore, M9 is feasible, and the lemma holds. □ The above construction of a feasible matching from a semifeasible one reduces the cardinality of the original matching by one. Now we investigate an extended reduction that turns a semifeasible matching into a feasible one with no decrease in cardinality, if possible. This reduction attempts to remove all cycles from the precedence graph of a semifeasible matching by merging two of its components together into one. This step is repeated as long as the merging is possible. Then, we rearrange the resulting matching inside cycles, if any are left, in order to make them acyclic. This step is also repeated as long as the rearrangement reduces the number of cycles. Finally, if cycles still remain, Lemma 1 is called in to make the matching feasible by reducing its cardinality by one. In Lemmas 2 and 3 and Theorem 1 we prove that the reduction process just outlined generates a maximum cardinality feasible matching. This result depends neither on an initial semifeasible matching nor on the order in which the components are merged. From now on we consider only perfect matchings. We can add uMCu dummy jobs with no resource requirements and no precedence relation to other jobs to make MC empty, where M is a maximum cardinality matching in }G. Moreover, we restrict the discussion to instances with exactly two jobs per chain, since any instance can easily be reduced to one with this property as follows: Let there be 2z jobs f1, . . . , f2z that are not included in two job chains. Notice that this number must be even, since we consider only instances with perfect matchings. We add 2z dummy jobs e1, . . . , e2z and chains ( f1, e1), . . . , ( f2z, e2z) to the original instance. We set resource requirements of the dummy jobs as follows: r(e1) 5 . . . 5 r(ez) 5 0, and r(ez11) 5 . . . 5 r(e2z) 5 m 1 2. Finally, we increase resource requirements of each original job by 1, and the original resource capacity by 2. Notice that jobs ez11, . . . , e2z can be matched only with jobs e1, . . . , ez in any perfect matching for the resulting instance. Before going any further we introduce the necessary definitions. Let {i, j} 5 e [ E and {k, l} 5 e9 [ E. Without loss of generality, assume that r(i) Ä r( j) and r(k) Ä r(l ). Pair {e, e9} is called a link if and only if {i, l} 5 f [ E and { j, k} 5 f9 [ E.
M If e [ HM s , and e9 [ Ht , where s Þ t, then {e, e9} is called a cross-link with respect to M. A matching C 5 (M 2 {e, e9}) ø { f, f9} is said to be a cluster with respect to {e, e9} and M. A pair of jobs d 5 {k, l} [ E is called a cross-node with M respect to M if and only if d ù TM s Þ À, and d ù Tt Þ À, for some components s and t, s Þ t.
# be two different perfect matchings Lemma 2. Let M and M G in } . If there is no cross-link with respect to M in DM, # then DM does not include a cross-node with respect to M. Proof. The proof is by induction on the number of ele# . Since there is no perfect matching M # ments in M 2 M # such that k 5 uM 2 Mu 5 1, Lemma 2 holds for k 5 1. # u 5 2. Then, M 5 M9 ø {{a, b}, {c, d}} Let k 5 uM 2 M # and M 5 M9 ø {{a, c}, {b, d}}, for some jobs a, b, c, and d. Since there is no cross-link with respect to M in DM, both {a, b} and {c, d} are in the same component, say i, of # changes only component i, leaving DM. Thus, matching M all remaining components of DM, if any, intact. Conse# quently, DM does not contain a cross-node with respect to M, and Lemma 2 holds for k 5 2. Given that the lemma holds for k Ä 2, we prove that it holds for k 1 1 as well. The proof proceeds by contradiction. Suppose that the lemma holds for k Ä 2, but not for # u. Then, there is no cross-link with respect k 1 1 5 uM 2 M # M to M in D , and there is a cross-node e* 5 {a, c} [ DM M with respect to M. Thus, {a, b} [ HM i and {d, c} [ Hj , for some components i Þ j and jobs b and d. If r(d) ¶ r(a), then e9 5 {b, d} [ E. However, e* [ E, so the pair {{a, b}, {d, c}} defines a cross-link with respect to M in DM, and we obtain a contradiction because we assumed that there is no cross-link with respect to M in DM. # is a perfect matching, then Now let r(d) . r(a). Since M # {d, f} [ M for some job f. Without loss of generality, we assume that r(a) 5 maxi[e*{r(i)} Ä maxj[e{r( j)} for any # cross-node e with respect to M in DM. Thus, f [ TM j ; otherwise, {d, f} would be a cross-node with respect to M # in DM and max{r(d), r( f )} . r(a). Since a [ TM i , {a, f} [ # 2 {{a, c}, {d, E. Thus, for a perfect matching M1 5 (M f}}) ø {{a, f}, {d, c}}, we have uM 2 M1u 5 k. However, {a, f} is a cross-node with respect to M in DM1, in contradiction with the induction hypothesis. Therefore, there is # no cross-node with respect to M in DM, and Lemma 2 holds for k 1 1, and by induction, for any number k. □ M M Let HM t be a cycle in D . Let e 5 {i, j} [ Ht and e9 5 M {k, l} [ Ht . Denote f 5 {i, l}, f9 5 { j, k}, and h 5 {i, k}, h9 5 { j, l}. A pair {e, e9} is called an inside link with respect to HM t if either:
(i) f [ E, includes includes (ii) h [ E, includes
f9 [ E, and one of the two sets f and f9 predecessors only. (In that case, the other successors only.) h9 [ E, and one of the two sets h and h9 predecessors only.
Note that an inside link can make a component acyclic.
˙EWICZ, DROR, KATOH, KUBIAK, BŁAZ
Downloaded from informs.org by [192.30.84.47] on 04 October 2016, at 05:43 . For personal use only, all rights reserved.
A matching S 5 (M 2 {e, e9}) ø { f, f9}, if (i) in definition of inside link holds, or S 5 (M 2 {e, e9}) ø {h, h9}; otherwise, it is said to be a cut with respect to {e, e9} and M. Lemma 3. Let M be a semifeasible perfect matching in }G. # be a perfect matching in }G. If there is neither a Let M cross-link with respect to M in DM nor an inside link with # respect to any cycle of DM, then DM has at least as many M cycles as D . Proof. The proof is by induction on the number of # . Since there is no perfect matching elements in M 2 M # # u 5 1, Lemma 3 holds for k 5 1. M such that k 5 uM 2 M # Let k 5 uM 2 Mu 5 2. Then, M 5 M9 ø {{a, b}, {c, d}} # 5 M9 ø {{a, c}, {b, d}}, for some jobs a, b, c, and M and d. Since there is no cross-link with respect to M in DM, then both {a, b} and {c, d} are in the same compo# changes only comnent, say i, of DM. Thus, matching M ponent i, leaving all remaining components of DM, if # changes it into another any, intact. If i is a cycle, then M cycle; otherwise, {{a, b}, {c, d}} would make up an inside link with respect to HM i . This is sufficient to show that is Lemma 3 holds for k 5 2, since the case when HM i acyclic is obvious. Given that the lemma holds for k Ä 2, we prove by contradiction that it holds for k 1 1 as well. Suppose that the lemma holds for k, k Ä 2, but not for k 1 1. If there is no cross-link with respect to M in DM, then there is no # cross-node with respect to M in DM according to Lemma 2, which implies that no pair of jobs that are in different # . Then, there exist components of DM can be matched in M # # M M M cycle i in D and node {a, c} in D with a, c [ TM i 5 Ti , both jobs of which are either predecessors or successors. Let {a*, c*} be such a node with the highest value of max{r(a), r(c)}. Without loss of generality, we assume that M r(a*) Ä r(c*). Then, {a*, b*} [ HM i and {e*, c*} [ Hi for some jobs b* and e*. Also, {e*, f *} for some f *, is a # # node in DM with e*, f * [ TM i . These two claims hold, since # both M and M are perfect and no pair of jobs that are in # . Notice different components of DM can be matched in M that both in {a*, b*} and in {e*, c*} one job is predecessor and the other successor; otherwise, component HM i would be acyclic. Moreover, r(e*) . r(a*); otherwise, {a*, b*} and {e*, c*} would make up an inside link with respect to HM i . Thus, one job in {e*, f *} is a predecessor while the other is a successor; otherwise, both jobs in {e*, f *} would be either successors or predecessors, and r(e*) . r(a*), which cannot happen by definition of {a*, c*}. If r(b*) 1 r(e*) ¶ m, then {e*, b*} [ E. Thus, {a*, b*} and {e*, c*} would make up an inside link with respect to HM i , which contradicts the assumption that there is no inside link with respect to any cycle in DM. If r(b*) 1 r(e*) . m, then r(e*) . r(a*). Consequently, r(a*) 1 r( f *) ¶ m, and it can be checked that both a* and f * are either predecessors or successors, so {a*, f *} [ E.
AND
˝ CK RO
/
745
# 2 {{a*, c*}, Thus, for a perfect matching S 5 (M {e*, f *}}) ø {{a*, f *}, {e*, c*}}, we get that uM 2 Su 5 k and S has fewer cycles than M, in contradiction with the # therefore has at least as many induction hypothesis. M cycles as M, and the lemma holds for k 1 1, and by induction, for any k. □ The following algorithm describes details of the extended reduction. Algorithm 1 STEP 1. Compute DM 5 {HM i } for a maximum cardinality perfect matching M in }G 5 (V, E). If DM is acyclic, then Stop (*–M is a result–*). STEP 2. (*– component clustering–*) Set S :5 M. If there are nodes e [ VSi and e9 [ VSj in different components i and j, which make up a crosslink with respect to S, then replace S by a cluster with respect to {e, e9} and S. Continue until either there is one component in DS, or there is no cross-link with respect to S. STEP 3. If DS 5 {HSi } is acyclic, then Stop (*–S is a result–*). STEP 4. (*– cycle cutting–*) Set P :5 S. If there are nodes e, e9 in cycle VPi , which make up an inside link with respect to HPi , then replace P by a cut with respect to {e, e9} and P. Continue until there is no inside link with respect to any cycle in DP. STEP 5. If DP is acyclic, then Stop (*–P is a result–*). STEP 6. Given matching P, compute matching R as in Lemma 1. Stop (*–R is a result–*). □ Now we prove that Algorithm 1 finds an optimal solution to the scheduling problem in polynomial time. Theorem 1. Algorithm 1 finds a maximum cardinality feasible matching in }G in O(n3) time. Proof. The merger of components i and j in a cluster with respect to {e, e9} and S reduces the number of components in Step 2, so the algorithm is bound to stop. Matchings M, S, and P at the end of Steps 1, 3, and 5, respectively, are all maximum cardinality feasible matchings in }G. This is not the case for matching R in Step 6. However, for this case we shall prove that there is no cross-link with respect to P in DP, where P is the matching at the end of Step 5. This combined with the fact that there is no inside-link with respect to P in DP will make the correctness of Algorithm 1 follow from Lemmas 3 and 1. The proof proceeds by contradiction. Suppose that there is cross-link {i, j} 5 e [ HPs and {k, l} 5 e9 [ HPt , s Þ t, with respect to P. The cuts in Step 4 neither changed the number of components nor moved jobs between them. Thus, without loss of generality we have i, j [ TSs and k, l [ TSt . Now, consider cluster P9 5 (P 2 {e, e9}) ø { f, f9}, where f 5 {i, l} and f9 5 { j, k} with respect to {e, e9} and
Downloaded from informs.org by [192.30.84.47] on 04 October 2016, at 05:43 . For personal use only, all rights reserved.
746
/
˙EWICZ, DROR, KATOH, KUBIAK, BŁAZ
AND
˝ CK RO
P. Both S and P9 are perfect matchings; furthermore, there is no cross-link with respect to S in DS. Thus, by Lemma 2, DP9 does not have a cross-node with respect to S, but this leads to a contradiction, since both f and f9 are crossnodes with respect to S. Finally, since a maximum cardinality matching in Step 1 can be computed in O(n2.5) time (Kariv and Even 1975), n q21 q ¥i51 ¥j5i11 Step 1 takes O(n2.5) time. Step 2 takes O(¥q51 S S 3 uVi uuVj u) time, which is O(n ). It is not difficult to verify that all remaining steps take O(n2) time. Thus, the theorem holds. □
ACKNOWLEDGMENT The research of the first author was supported in part by the Natural Sciences and Engineering Research Council of Canada under Grant OGP0105675. The research of the second author was sponsored by KBN grant no. 8T11C04012. The authors are thankful to the two referees for their careful reading of this manuscript. Their observations, comments, and suggestions resulted in a more focused and clearer presentation of the results.
REFERENCES ˙EWICZ, J., W. CELLARY, R. SŁOWIN ´SKI, AND J. WE¸GLARZ. BŁAZ 1987. Scheduling Under Resource Constraints: Deterministic Models. J. C. Baltzer, Basel, Germany. ˙EWICZ, J., K. ECKER, G. SCHMIDT, AND J. WE¸GLARZ. 1993. BŁAZ Scheduling in Computer and Manufacturing Systems. Springer Verlag, Berlin and New York. ˙EWICZ, J., J. K. LENSTRA, AND A. H. G. RINNOOY KAN. BŁAZ 1983. Scheduling Subject to Resource Constraints: Classification and Complexity. Discrete Appl. Math. 5, 11–24. FUJII, M., T. KASAMI, AND K. NINOMIYA. 1969. Optimal Sequencing of Two Equivalent Processors. SIAM J. Appl. Math. 17, 784 –789. GAREY, M. R. AND D. S. JOHNSON. 1975. Complexity Results for Multiprocessor Scheduling Under Resource Constraints. SIAM J. Comput. 4, 397– 411. GRAHAM, R. L., E. L. LAWLER, J. K. LENSTRA, AND A. H. G. RINNOOY KAN. 1979. Optimization and Approximation in Deterministic Sequencing and Scheduling Theory: A Survey. Ann. Discrete Math. 5, 287–326. KARIV, O. AND S. EVEN. 1975. An O(n2.5) Algorithm for Maximum Matching in General Graphs. Sixteenth Annual Symposium on Foundations of Computer Science, IEEE, 100 –112. ¨ CK, H. 1984. Unpublished Result. RO WARMUTH, M. 1984. Unpublished Result.