Three is easy, two is hard: open shop sum-batch scheduling problem refined

Three is easy, two is hard: open shop sum-batch scheduling problem refined

Operations Research Letters 34 (2006) 459 – 464 Operations Research Letters www.elsevier.com/locate/orl Three is easy, two is hard: open shop sum-ba...

151KB Sizes 1 Downloads 47 Views

Operations Research Letters 34 (2006) 459 – 464

Operations Research Letters www.elsevier.com/locate/orl

Three is easy, two is hard: open shop sum-batch scheduling problem refined Irina V. Gribkovskaiaa , Chung-Yee Leeb , Vitaly A. Strusevichc,∗ , Dominique de Werrad a Molde University College, Molde, Norway b Hong Kong University of Science and Technology, Hong Kong c University of Greenwich, London, UK d École Polytechnique Fédérale de Lausanne, Lausanne, Switzerland

Received 23 September 2004; accepted 25 July 2005 Available online 22 September 2005

Abstract For the two-machine open shop sum-batch problem to minimize the makespan an optimal schedule is known to contain one, two or three batches on each machine, and finding a two-batch optimal schedule is NP-hard. We adapt the open shop algorithm by de Werra for finding a three-batch optimal schedule in linear time. © 2005 Elsevier B.V. All rights reserved. Keywords: Scheduling; Open shop; Batching; Polynomial-time algorithm

1. Introduction In discrete optimization the complexity of a problem often increases dramatically when a numerical parameter changes its value from 2 to 3. Fascinated with this issue, Eugene Lawler wrote: “Sad to say, but it will be many more years, if ever, before we really understand the Mystical Power of Twoness (or what Jan Karel [J.K. Lenstra] calls the Magical Power of Threeness): 2-SAT is easy, 3-SAT is hard, 2-dimensional matching is easy, 3-dimensional matching is hard... Why? Oh, ∗ Corresponding author. Tel.: +44 0 20 8331 8662; fax: +44 0 20 8331 8665. E-mail address: [email protected] (V.A. Strusevich).

0167-6377/$ - see front matter © 2005 Elsevier B.V. All rights reserved. doi:10.1016/j.orl.2005.07.006

why?”; see [5]. In this note we give a rare example of a problem that exhibits the opposite behavior. Our main problem is a version of the two-machine open shop scheduling with batching. In the classical open shop problem, we are given a set N = {1, . . . , n} of jobs. Each job j has two operations which require processing on machines A and B, and the corresponding processing times are denoted by aj and bj , respectively. For each job the order in which the job passes through the machines is immaterial and can be chosen by the decision-maker. It is not allowed to process a job on both machines at a time, and to process more than one job on a machine simultaneously. The corresponding problem of finding a schedule S that minimizes the makespan (the maximum completion time) Cmax (S) is denoted by O2| |Cmax .

460

I.V. Gribkovskaia et al. / Operations Research Letters 34 (2006) 459 – 464

The problem of our primal concern is the open shop problem with a particular type of batching. On each machine, the jobs can be grouped into batches in an arbitrary way. Before a batch is processed, a setup time sA or sB is required on the relevant machine, A or B. A setup can be performed before the batch arrives at the corresponding machine, and the processing of a batch can be started on a machine only when all operations of jobs in this batch are available. The length or total processing time of a batch is the sum of the processing times of the operations in this batch. This type of batching is known as sequential batch processing. The completion time of each job in a batch on a particular machine is defined by the completion time of the last job in the batch. This is called batch availability. Following [2], we refer to the open shop model with batch availability and sequential batch processing as the open shop sum-batch. We denote the corresponding two-machine problem to minimize the makespan by O2|sum − batch|Cmax . If identical batches are used on the two machines, then the batches are said to be consistent. In this case they are denoted by N1 , . . . , Nu , where u is the number of batches. In this paper, for a non-empty set of jobs Q ⊆ N , we define a(Q) =

 j ∈Q

aj ,

b(Q) =



bj

j ∈Q

and define a(⭋) = b(⭋) = 0. As proved in [2], for problem O2|sum−batch|Cmax , there exists an optimal schedule with one, two or three consistent batches. Thus, throughout the remainder of this paper only consistent batches are considered. If there exists an optimal schedule S ∗ with a single batch then this schedule can be easily found, and Cmax (S ∗ )=min {sA + a(N), sB }+b(N), provided that sA sB . As proved in [2], finding an optimal schedule with two batches is essentially equivalent to the version of the knapsack problem, known as the subset sum problem [4] and is NP-hard in the ordinary sense. Driven by “The Mystical Power of Twoness”, the authors of [2] have implicitly assumed that finding an optimal schedule with three consistent batches is no easier than finding the one with two batches. We prove that if there exists an optimal schedule S ∗ with three batches then this schedule can be found in O(n) time.

2. How to create a three-batch schedule In this section we derive conditions under which a three-batch schedule that is optimal for problem O2|sum − batch|Cmax exists. In the remainder of this paper we assume that sA sB ; otherwise the machines can be appropriately renamed. If there exists an optimal schedule S ∗ with three consistent batches, then its makespan Cmax (S ∗ ) cannot be smaller than the total workload of each machine, i.e., smaller than T where T = max{3sA + a(N ), 3sB + b(N )}. We also assume that sA + a(N ) + b(N ) > T ;

(1)

otherwise, a schedule with one batch would be better than an optimal schedule with three batches. Additionally, we exclude from further consideration instances of problem O2|sum − batch|Cmax that contain a job j such that sA + aj + bj > T .

(2)

If (2) holds it is possible to create a schedule with two batches (one of them consisting of a single job j) such that the makespan is equal to sA + aj + bj . The value sA + aj + bj is a global lower bound on the makespan of any schedule, irrespective of the number of batches, since it represents the earliest possible completion time of job j. Thus, the described schedule is optimal. We therefore assume that sA + aj + bj T

(3)

holds for each job j. Without loss of generality, we may assume that T = 3sA + a(N ) = 3sB + b(N );

(4)

otherwise we can balance the machine loads by introducing a dummy job. If we can create a schedule with the makespan equal to T, this schedule will be optimal in the class of schedules with three consistent batches. The sequence of batches on some machine defines a schedule on that machine, provided that • the jobs in each batch are processed in an arbitrary order as a block without intermediate idle time;

I.V. Gribkovskaia et al. / Operations Research Letters 34 (2006) 459 – 464

A

N1

As

B

sB

N2

sA N2

sB

N3

sA N3

461

sB

N1

Fig. 1. A three-batch schedule S.

• there is no idle time between the completion of a batch and the setup of the subsequent batch; • the setup of the first of these batches starts at time 0.

RB1 = 3sB + b(N2 ) + b(N3 ) = T − b(N1 ) sA + a(N1 ) = CA1 .

The statement below gives the optimality conditions of a three-batch schedule.

Thus, the schedule is feasible and its makespan is T, therefore it is optimal. 

Lemma 1. Suppose that for problem O2|sum − batch|Cmax there exists an optimal schedule with three consistent batches N1 , N2 and N3 . If 2sA + a(N1 )sB + b(N2 ), sB + b(N1 )a(N3 ), sA + a(N1 ) + b(N1 )T ,

(5) (6) (7)

then processing the batches on machine A in the sequence(N1 , N2 , N3 ) and on machine B in the sequence (N2 , N3 , N1 ) results in an optimal schedule S with the makespan T. Proof. It is sufficient to prove that in schedule S there is no idle time on either machine in the time interval [0, T ], and the jobs in the same batch do not overlap. See Fig. 1 for a Gantt chart of S, where the setups are shown as double-framed boxes. For batch Nk , k ∈ {1, 2, 3}, and machine L ∈ {A, B}, let CLk and RLk denote the completion time of the last job in Nk and the starting time of the first job in Nk on machine L, respectively. If the jobs of a batch Nk follow the processing route (A, B) then CA,k RB,k , so that there is no overlap in processing the jobs in this batch. Similarly, if the jobs of a batch Nk are assigned the route (B, A) then CB,k RA,k . Due to (5) we have that CB2 = sB + b(N2 )2sA + a(N1 ) = RA2 . Similarly, we derive from (6) that RA3 = 3sA + a(N1 ) + a(N2 ) = T − a(N3 ) T − (sB + b(N1 )) = CB3 .

Finally, due to (7), we have that

3. How to form three batches We now present an algorithm that finds the three batches that satisfy the conditions of Lemma 1 and define an optimal three-batch schedule. Our algorithm is an extension of de Werra’s algorithm for problem O2| |Cmax with no batching. Recall that for problem O2| |Cmax there are several linear-time algorithms based on different ideas: (i) transformation of a flow shop schedule into an optimal open shop schedule by changing the route of one job [3], (ii) greedy scheduling combined with the special scheduling of one job [6], and splitting the jobs into blocks of non-overlapping jobs [1]. We first describe how to break the jobs into three batches so that certain properties hold. The algorithm below runs, provided that (1) is valid and (3) holds for all j ∈ N . Algorithm Break3 1. Scanning the jobs in an arbitrary order, find a job u 2 such that sA +

u−1 

(aj + bj ) T , sA +

j =1

u 

(aj + bj ) > T .

j =1

2. Define three batches N1 = {1, 2, . . . , u − 1}, N3 = {u + 1, . . . , n}. and stop.

N2 = {u},

462

I.V. Gribkovskaia et al. / Operations Research Letters 34 (2006) 459 – 464

Lemma 2. If for problem O2|sum − batch|Cmax there exists an optimal schedule with three consistent batches, then for each batch Nk , k ∈ {1, 2, 3}, found by Algorithm Break3 the inequality sA + a(Nk ) + b(Nk ) T

(8)

3. If inequality (10) holds, then output N1 = N2 , N2 = N3 , N3 = N1 ; otherwise go to Step 4. 4. If the inequality sB + b(N3 ) a(N2 )

holds.

(11)

holds then output Proof. Due to (1), job u in Step 1 of the algorithm exists, so that (8) holds for k = 1. Since we assume that (3) is valid for all j ∈ N , we derive that u 2 and therefore (8) holds for k = 2. Finally, since sA +

u 

(aj + bj ) = sA + a(N1 ) + b(N1 ) + a(N2 )

j =1

+ b(N2 ) > T it follows that 2sA + 3sB + a(N3 ) + b(N3 ) T , so that (8) also holds for k = 3, as required.



We now show how to find the required batches N1 , N2 and N3 that satisfy the conditions of Lemma 1 by relabelling the batches N1 , N2 and N3 generated by Algorithm Break3. Notice that any of these batches can be taken as batch N1 due to Lemma 2 to guarantee inequality (7). Thus, we only need to verify that the other two conditions of Lemma 1 also hold. Algorithm Relabel 1. If for the three batches N1 , N2 and N3 found by Algorithm Break3 the inequality 2sA + a(N1 )sB + b(N2 )

(9)

holds, then go to Step 2, otherwise to Step 3. 2. If the inequality sB + b(N1 )a(N3 )

N1 = N1 , N2 = N2 , N3 = N3 ; otherwise, output N1 = N3 ,

N2 = N1 ,

N3 = N2 .

otherwise, output N1 = N2 , N2 = N3 , N3 = N1 . Lemma 3. The three batches N1 , N2 and N3 found by Algorithm Relabel satisfy conditions (5)–(7). Proof. Due to Lemma 2, inequality (8) holds for any labelling of the original batches N1 , N2 and N3 found by Algorithm Break3, hence (7) is satisfied. If both inequalities (9) and (10) hold, then comparing these inequalities with (5) and (6), respectively, we deduce that Algorithm Relabel delivers the required batches. Consider first the case that (9) holds together with the inequality sB + b(N1 ) < a(N3 );

(12)

see Step 2. Adding these inequalities and subtracting the resulting inequality from (4), we obtain sA + a(N2 ) sB + b(N3 ), which in turn reduces to a(N2 ) sB + b(N3 ). Besides, (12) is stronger than 2sA + a(N3 ) sB + b(N1 ). Thus, the suggested relabelling is correct, i.e., (5) and (6) are satisfied for N1 = N3 , N2 = N1 , and N3 = N2 . We enter Step 3 if the inequality 2sA + a(N1 ) < sB + b(N2 )

(10)

holds, then output

N1 = N3 , N2 = N1 , N3 = N2 ;

(13)

is valid. Adding this and (10) and subtracting the resulting inequality from (4), we obtain sB + b(N3 ) < sA + a(N2 ), which is stronger than sB + b(N3 ) 2sA + a(N2 ). Besides, (13) is stronger than sB + b(N2 ) a(N1 ). Thus, the suggested relabelling is correct.

I.V. Gribkovskaia et al. / Operations Research Letters 34 (2006) 459 – 464

If in Step 4, the inequality (11) is valid, then adding it and (13) and subtracting the resulting inequality from (4), we obtain sB + b(N1 ) < sA + a(N3 ), which is stronger than sB + b(N1 )2sA + a(N3 ). This together with (11) implies that the suggested relabelling is correct. Finally, the fact that (11) does not hold implies the inequality sB + b(N3 ) < 2sA + a(N2 ). Besides, (13) is stronger than sB + b(N2 ) a(N1 ), as required.  Finding the batches N1 , N2 and N3 by Algorithm Break3 followed by their relabelling by Algorithm Relabel requires no more than linear time. The results of this section can be summarized as the following statement. Theorem 1. If for problem O2|sum − batch|Cmax there exists an optimal schedule with three consistent batches, then this schedule can be found in O(n) time, using Algorithm Break3 followed by Algorithm Relabel. The complete procedure for solving problem O2|sum − batch|Cmax can be stated as follows. Algorithm Main 1. If required, relabel the machines so that sA sB . 2. Find the best single-batch schedule S 1 in which all jobs go from machine A to machine B with Cmax (S 1 ) = max {sA + a(N), sB } + b(N). 3. If inequality (2) holds for some job j, find a twobatch schedule S 2 with batches N1 = {j } and N2 = {N\j } with Cmax (S 2 ) = sA + aj + bj and stop; otherwise go to Step 4. 4. Determine the batches N1 and N2 such that max {a(N1 ) + b(N1 ), a(N2 ) + b(N2 )} = min max {a(X) + b(X), a(Y ) + b(Y )} , X∪Y =N

where the minimum in the right-hand side is taken over all partitions of set N into two subsets. Find the best two-batch schedule S 2 for processing the batches N1 and N2 with Cmax (S 2 ) = max{2sA + a(N), 2sB + b(N), sA + max{a(N1 ) + b(N1 ), a(N2 ) + b(N2 )}}.

463

5. If required, introduce a dummy job to balance the machine loads, so that (4) holds. Run Algorithms Break3 and Relabel to determine the batches N1 , N2 and N3 . Find the best three-batch schedule S 3 for processing these batches. 6. Output the best of the found schedules S 1 , S 2 and S 3 as an optimal schedule S ∗ and stop. Each of schedules S 1 , S 2 in Step 3 and S 3 can be found in O(n) time, while finding schedule S 2 in Step 4 requires O nmaxj ∈N {aj + bj } time, provided that a subset sum algorithm by Pisinger [7] is used for determining the batches N1 and N2 . Thus, this paper refines our knowledge regarding problem O2|sum−batch|Cmax in the following way: 1. If there exists an optimal schedule with a single batch, it can be found in linear time. 2. If there exists an optimal schedule with three batches, it can be found in linear time. 3. If there exists an optimal schedule with two batches, then the problem is NP-hard in the ordinary sense. It is essentially equivalent to the subset sum problem and admits a pseudopolynomial-time algorithm and a fully polynomial-time approximation scheme; see [5, Chapter 4] for review and references. This settles the question of the complexity and approximability status of the problem. Recall that Glass et al. [2] have proved that for problem O2|sum−batch|Cmax there is no need to look for an optimal schedule with more than three batches. The same implication can be immediately derived from Algorithm Main.

Acknowledgements Irina Gribkovskaia has been supported by The Norwegian Council of Research. Vitaly Strusevich has been supported by INTAS (Project 03-51-5501).

References [1] D. de Werra, Graph-theoretical models for preemptive scheduling, in: R. Slowinski, J. Weglarz (Eds.), Advances in Project Scheduling, Elsevier, Amsterdam, 1989, pp. 171–185.

464

I.V. Gribkovskaia et al. / Operations Research Letters 34 (2006) 459 – 464

[2] C.A. Glass, C.N. Potts, V.A. Strusevich, Scheduling batches with sequential job processing for two-machine flow and open shops, INFORMS J. Comput. 13 (2001) 120–137. [3] T. Gonzalez, S. Sahni, Open shop scheduling to minimize finish time, J. Assoc. Comput. Mach. 23 (1976) 665–679. [4] H. Kellerer, U. Pferschy, D. Pisinger, Knapsack Problems, Springer, Berlin, 2004. [5] E.L. Lawler, Old stories, in: J.K. Lenstra, A.H.G. Rinnooy Kan, A. Schrijver (Eds.), History of Mathematical

Programming. A Collection of Personal Reminiscences, CWI and North-Holland, Amsterdam, 1991, pp. 97–106. [6] M. Pinedo, L. Schrage, Stochastic shop scheduling: a survey, in: M.A.H. Dempster, J.K. Lenstra, A.H.G. Rinnooy Kan (Eds.), Deterministic and Stochastic Scheduling, Riedel, Dordrecht, 1982, pp. 181–196. [7] D. Pisinger, Linear time algorithms for knapsack problems with bounded weights, J. Algorithms 33 (1999) 1–14.