Computers & Operations Research 36 (2009) 2913 -- 2925
Contents lists available at ScienceDirect
Computers & Operations Research journal homepage: w w w . e l s e v i e r . c o m / l o c a t e / c o r
Scheduling projects with limited number of preemptions夡 Francisco Ballestín a , Vicente Valls b , Sacramento Quintanilla c,∗ a
Dpto. de Estadística e Investigación Operativa, Facultad de Económicas y Empresariales, Universidad Pública de Navarra, Pamplona, Spain Dpto. de Estadística e Investigación Operativa, Facultad de Matemáticas, Universitat de Valencia, Spain c Dpto. de Economía Financiera y Matemática, Facultad de Económicas y Empresariales, Universitat de Valencia, Spain b
A R T I C L E
I N F O
Available online 22 January 2009 Keywords: Resource constrained project scheduling Heuristic algorithms Preemption Due dates
A B S T R A C T
A recent paper (Ballestín F, Valls V, Quintanilla S. Preemption in resource-constrained project scheduling. European Journal of Operational Research 2008;189:1136–152) revealed the potential benefits of allowing one interruption when scheduling activities in a resource-constrained project. This paper further investigates the effect of interruption on project length in more general cases. To achieve this, a new model that covers most practical applications of discrete activity preemption is proposed and a metaheuristic algorithm for the problem is developed. Computational experiments on the standard j120 and j30 sets generated using ProGen study the difference in makespan between allowing m interruptions per activity, m = 0, 1, 2, . . . . In the second part of the paper the usefulness of preemption in the presence of due dates is analysed. © 2009 Elsevier Ltd. All rights reserved.
1. Introduction Preemption plays a role in the execution of many daily work activities. Stopping a machine when the night or the weekend comes, answering a call while writing a work paper, switching between projects while programming, etc. This fact has been investigated by researchers who have incorporated preemption in several project scheduling problems: Bock and Patterson [6], while examining a rule-based approach for setting due dates in a multiproject, Tsubakitani and Deckro [24], considering multiple projects or Slowinski [21] and Weglarz [30] with continuously divisible processing times. Nudtasomboon and Randhawa [19] work with a model including activity preemption, renewable and non-renewable resources, time-resource tradeoffs, variation in resource availability and multiple objectives. In addition, all main project management software packages include preemptability among their capabilities. Nevertheless, literature on discrete activity preemption is almost void when the objective function is to minimise project length and constant resource availability levels are defined. This is the field this paper is dedicated to. A possibility for the absence of research can be the conclusion found in the papers by Demeulemeester and Herroelen [7] and Kaplan [12,13]. They stated that preemption had little effect unless
夡 This research was partially supported by the Ministerio de Educación y Ciencia under Contract DPI2007-63100. ∗ Corresponding author. Tel.: +34 6 3828396. E-mail addresses:
[email protected] (F. Ballestín),
[email protected] (V. Valls),
[email protected] (S. Quintanilla). 0305-0548/$ - see front matter © 2009 Elsevier Ltd. All rights reserved. doi:10.1016/j.cor.2009.01.006
variable resource availability levels are considered. They worked with the preemptive resource-constrained project scheduling problem (PRCPSP), an extension of the basic RCPSP, where each activity can be split into parts of one unit of duration. However, their conclusions might have been biased by the instance set they worked with (see Ballestín et al. [4]). In this last paper, it was in fact shown that allowing one interruption per activity (which leads to so-called problem 1-PRCPSP) helps decrease the project length when using heuristic algorithms for solving the RCPSP. All in all, deeper research into the usefulness of preemption in this field seems to be needed. However, a new model is necessary composed of more practical applications, because up to now only those two (very restrictive) problems have been studied, the PRCPSP and the 1-PRCPSP. Their biggest restriction comes from handling all activities in the same way. Some activities may not be interrupted at all due to technical or other types of reasons. Clear examples are chemical reactions that cannot be stopped once they have started or activities that require the expensive setup of certain resources such as machines. However other activities, such as administrative tasks, the transportation of material or revisions of work can be interrupted more than once without any additional cost. For practical reasons it is advisable to limit the number of times a task is interrupted or the minimum duration of each of the parts. This article proposes a project length minimization heuristic algorithm, flexible from the point of view of the interruption, which takes advantage of the possibly different nature of the project activities regarding the interruption. Each task has its own policy of interruption: if it can be interrupted or not, the maximum number of permitted interruptions and/or the
2914
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
Min
Startn +1
(1)
s.t.
Start0,1 = 0
(2)
Start j,1 ≥ Starti, maxninti +1 + duri, maxninti +1 , (i, j) ∈ A
(3)
∑ rik ≤ R k , t = 0,1, ,..., UB; k = 1,..., K
(4)
Starti, j+1 ≥ Startij + durij , i = 1,.., n with maxninti > 0; j = 1,..., maxninti
(5)
i∈A t
maxnint i +1
∑ duri, j = pi , i ∈ V
(6)
j=1
duri, j ≥ εi x ij , i ∈ V, j = 1,..., maxninti + 1
(7)
x i, j+1 ≤ x ij , i ∈ V with maxninti > 0; j = 1,..., maxninti
(8)
Startij , durij ∈ N 0 , i ∈ V, j = 1,..., maxninti + 1
(9)
x ij ∈ {0,1}, ∀ i ∈ V, j = 1,..., maxninti + 1
(10)
Fig. 1. Conceptual model for the Maxnint_PRCPSP.
minimum duration of each of the parts in which the activity is divided. The rest of the paper will be as follows: In Section 2 we will formally introduce the new model for discrete preemption. Section 3 describes the evolutionary algorithm we have developed for the problem, with a suitable codification and crossover operator. The computational results with regard to this part of the paper are shown in Section 4. Section 5 contains the second part of the paper where we consider due dates. We include some changes in the algorithm presented to cope with the two new problems we work with, in addition to computational tests proving the usefulness of preemption in those cases. The final section is reserved for concluding remarks. 2. Problem Maxnint_PRCPSP The problem Maxnint_PRCPSP can be stated as follows: A project consists of n+1 activities numbered 0 to n+1 where dummy activities i = 0 and i = n + 1 mark the beginning and end of the project. There are precedence relations between the activities. A = {(i, j) ∈ V × V/i must finish before j can start} is the set of those relationships where V is the set of activities. Each activity i has a duration pi and needs some renewable resources to ensure it is carried out. There are K different resource types with availability in each time period of Rk units, k=1, . . . , K. Each activity i requires rik units of resource k during each period of time in which it is processed. Dummy activities i = 0 and n+1 have zero duration and resource usage. The execution of an activity i can be interrupted a given maximum number maxninti of times without additional cost. Interruptions always occur at integral points. The case maxninti = 0 means that activity i must be processed without preemption. We define maxnsub = i∈V (maxninti + 1) as the maximum number of parts of activities in any feasible schedule. For each activity i, a minimum execution time i is prescribed during which i has to be in progress without interruption. We obviously set i := pi for non-preemptable activities i. We can update maxinti = min(maxinti , pi / i − 1). In the rest of the paper we will consider that this update has been made. All parameters considered above are assumed to be non-negative integer valued. See [18] for another definition of a problem with activity preemption and i . The essential difference between this problem and problem Maxnint_PRCPSP is that in that problem preemption is produced due to calendarization and the execution of an activity i interrupted at some time has to be resumed exactly when all resource types involved inthe processing of i become available again. In our problem, however, preemption is introduced as a way of reducing the final length of the solution. A solution or schedule S for the Maxnint_PRCPSP is a pair (Start, dur), where both Start and dur are matrixes, Start =
(Start0 , Start1 , . . . , Startn+1 ) and dur = (dur0 , dur1 , . . . , durn+1 ). For each activity i, both sets Starti and duri contain maxninti + 1 elements. Startij and durij are the j-th element of the corresponding set and stand for the start time and duration of the j-th part (or subactivity) of activity i, respectively. Conceptually, the resource constrained project scheduling problem with a maximum number of interruptions per activity, the Maxnint_PRCPSP, can be formulated as in Fig. 1, where At denotes the set of activities in progress in time interval [t, t + 1[: At = {i ∈ V/∃j ∈ {1, . . . , maxninti + 1} with Startij t < Startij + durij }. We also need some auxiliary variables to control activities that are split into less parts than their maximum maxninti + 1. In those cases the last parts of an activity will be dummy parts with duration 0. Their start and finish times will be the finish time of the last non-dummy part. Concretely, we define binary variables xij , which are 1 if part j of activity i is a non-dummy part, i.e., does not have duration 0. Finally, UB is an upper bound on the project length, e.g. the sum of the activities' durations. Restrictions (2) assign a start (and completion) time 0 to the dummy activity 0. The precedence constraints given by (3) indicate that the start of an activity j must wait for the end of the last subactivity of all the predecessor activities of j. The resource constraints given in (4) indicate that the renewable resource amounts for each resource type k required by the activities in progress cannot exceed the resource availability. Eq. (5) assures that a subactivity of an activity i does not start sooner than the end of the previous subactivity of the same activity. Conditions on the durations of subactivities are reflected in (6)–(8). In (6) the duration of all parts of an activity i must be equal to the processing time of i. In (7) the duration of each subactivity must be at least the minimum execution time, but only if the part is a non-dummy one. Restrictions (8) assure that the nondummy parts of each activity are the first parts. The variables xij are binary (9) and the rest of variables must be non-negative integrals, as stated in (9). A feasible solution for the Maxnint_PRCPSP is a solution that fulfils restrictions (2)–(10). The objective of the problem is to find a feasible solution such that the project length of the schedule Startn+1,1 (=finish time of n + 1) is minimised. The Maxnint_PRCPSP is a generalisation of the m_PRCPSP, the problem where we allow, at most, m interruptions per activity. We only need to fix maxninti = max{m, pi − 1} for all i in V. In fact, it is a generalisation of both problems which have been studied in the literature, the PRCPSP and the 1_PRCPSP. Since the RCPSP is also a particular case (maxninti = 0 ∀i ∈ V) of the Maxnint_PRCPSP, our problem is NPhard in the strong sense (see Blazewicz et al. [5] for the NP-hardness of the RCPSP).
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
2/1
1/3
4/2
1
2
6
pi /ri
i
0/0
4/1
0/0
0
4
7
3/1
1/3
3
5
K=1 R1=3
maxnint = (0 0 1 2 0 1), ε = (1 1 1 1 1 2)
Fig. 2. Project example.
3a
4c
4a
2
4b
5 6
1 0
1
3b 2
3
4
5
6
7
8
9
Fig. 3. Feasible solutions S.
The most important aspect of the problem is that we can work at the same time with non-preemptable activities (maxninti = 0) and preemptable activities (maxninti > 0), in addition to activities with different numbers of allowed interruptions. Let us introduce a project example that we will refer to throughout the text. The project depicted in Fig. 2 consists of six nondummy activities, with a renewable resource of availability 3. The vector of the maximum number of allowed interruptions is maxnint= (0 0 0 1 2 0 1 0), i.e., activities 1, 2 and 5 cannot be interrupted, while activities 3 and 6 can be interrupted once and 4 is the only activity allowed to be interrupted twice. There is only one further restriction with respect to the minimum duration of a subactivity, 6 = 2. Fig. 3 displays a solution S for this project. We denote ia, ib and ic the first, second and third part of activity i in the Gantt diagrams, respectively. If the activity i has only one part, we will just use i and not ia. S is feasible, because activities 3 and 4 are interrupted once and twice, respectively, while the rest of the activities are uninterrupted. Furthermore, resource restrictions and precedence relationships are met. The makespan of this solution is 9. In [4], an example shows how allowing 1 and 2 interruptions per activity sometimes leads to better solutions than if no interruption is allowed. This example can be easily extended to prove that there exist projects where allowing m + 1 interruptions in one activity permits the finding of a better solution than allowing m interruptions in all activities. 3. The algorithm We have developed an evolutionary algorithm, EvoAlg, for the Maxnint_PRCPSP. Evolutionary algorithms work with a “population” of individuals (codifications of solutions), not from a single point like other metaheuristic algorithms like simulated annealing or tabu search. In our algorithm we have adopted the so-called ( + ) strategy. This means that the size of the population is and that is the number of children generated at each iteration. The population for the next iteration consists of the best individuals out of the ( + ) solutions available. In addition, we also work with the notion of life span (Michalewicz, [17]), which was introduced to solve the problem of super-individuals. Super-individuals far exceed, in
2915
fitness, other solutions of the population and their existence might result in premature convergence to a local optimum. EvoAlg defines the life span of an individual at “birth” by 0. At each iteration, the life span of each surviving individual is increased by 1. When the life span reaches a certain number maxlife, the individual dies and is removed from the population. Two opposite strategies are achieved. On the one hand, with maxlife = 0 we achieve the (,) strategy in which the new population is formed with the best < children. On the other hand, if maxlife = ∞ we reproduce the elitist strategy; each individual is maintained in the population until individuals better than it have been generated in total. The outline of the algorithm is shown in Scheme 1 . In the first and second steps the algorithm creates the initial population of individuals with the aid of a procedure called CalculateInitialSolution (Section 3.3). Each individual is a codification of a solution (Section 3.1). For each iteration of the main loop (step 3), individuals are created, on average 100 · pcrossover% of the times with a crossover operator (Section 3.4) and the remaining times with a unary operator (Section 3.5). For the first (second) case, two (one) individuals are selected from the population. The better the individual in terms of fitness, the more probable that it is selected, following the regret-based biased random sampling [8]. Throughout the algorithm, each codification is transformed into a feasible solution for the problem with the schedule generation scheme (SGS) called Maxnint_Serial SGS (Section 3.2). Furthermore, we apply a local search to every solution created called Maxnint_DJ (Section 3.6). Finally, the function redefinition transforms a feasible solution of the problem into a codification that reflects its characteristics (Section 3.7). 3.1. Individuals and codification of a solution in the Maxnint_PRCPSP We propose codifying the solutions of problem Maxnint_PRCPSP by means of a pair of vectors = (, d): a vector that we will call a subactivity list and a duration vector d. The subactivity list contains each activity as many times as subactivities, which can appear in in any position after all its predecessors. The j-th part of activity i, subactivity ij, is considered a predecessor of i(j + 1). The j-th position in d, d(j), stores the duration of the subactivity (j). Note that d(j) must be greater or equal than i and that can contain maxninti subactivities of activity i at most. In the case where an activity i is not interrupted it only appears once in (let us say, in position j), and d(j) = pi . The common length of the vectors and d will be denoted by nsub. It represents the total number of subactivities in the solution. Given a codification it is straightforward to construct the interruption vector nint which stores in its jth position the number of interruptions of activity j according to and then to calculate nsub = i∈V (nint(i) + 1). It holds that nint(i) maxninti for all i and nint(i)=0 if i is not interrupted. Given a codification we will always assume that nsub and nint have been calculated. We define the representation of a schedule S = (Start, dur) as a pair = (, d), of a subactivity list and a duration vector with the following features: The subactivity list is a permutation of the subactivities defined by S, in increasing order of their start times according to Start. The duration vector d stores the duration of each subactivity according to dur in the same order as in . Algorithm EvoAlg works with representations of schedules as individuals. With respect to the project depicted in Fig. 2, a representation of schedule S of Fig. 3 is = (, d), with = (0 1 3 4 2 3 4 5 4 6 7) and d = (0 2 2 2 1 1 1 1 1 4 0). We also have nsub = 11 and nint = (0 0 0 1 2 0 0 0). In the subsequent paragraph we will define a specific decoding procedure for the Maxnint_PRCPSP. It will transform a representation of a solution S in the schedule S itself, provided that S has been obtained with the aim of the new procedure.
2916
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
Scheme 1. Outline of algorithm EvoAlg.
3.2. Decoding procedure for the Maxnint_PRCPSP In this subsection we define a specific decoding procedure for problem Maxnint_PRCPSP that will be called Maxnint_Serial SGS. Given a pair (, d) of a subactivity list and a duration vector, the decoding procedure generates a feasible solution. It is inspired by the Serial SGS [14], a usual decoder in the RCPSP which schedules each activity as soon as possible in a certain order. The Maxnint_Serial SGS works as follows: First, the dummy beginning activity is started at time 0. Then, the subactivities are scheduled in the order prescribed by the subactivity list . Let us suppose that ik is the next subactivity to be scheduled and that it appears in position j in . The subactivity ik represents the kth part of activity i with a duration of duri,k = d(j) time units. If d(j) = pi , activity i is not interrupted and k must be equal to 1. When scheduling ik two cases can be considered: (a) Case k =1. If nint(i)=maxninti or duri,1 < 2∗ i , then subactivity i1 is not interrupted and it is scheduled at the earliest precedence and resource feasible start time. Otherwise, it looks for the first time instant, t, where all predecessors of i have finished and at least i units of i can be scheduled. Next, it calculates the maximum number, h, of units of i that can be scheduled without interruption at time t. If h > duri,1 , i1 is completely scheduled in [t, t + duri,1 [, otherwise the procedure interrupts i1. In this case, Maxnint_Serial SGS schedules the first h1 = min(h, duri,1 − i ) units of i1 in [t, t + h1 [. Then, nint(i) is increased by one and, finally, the rest of i1 is treated as a new subactivity. Note that h1 i because duri,1 2∗ i . (b) Case k > 1. Let t be the finish time of i(k − 1). Let h2 be the maximum number of units of i that can be scheduled without
4a
2 1
0
1
2
3
4
5
6
7
8
9
Fig 4. Partial schedule before scheduling activity 3.
interruption at time t. If h2 duri,k , Maxnint_Serial SGS schedules ik at time t, nint(i) is decreased by one and duri,k−1 is updated as duri,k−1 = duri,k−1 + duri,k . If h2 < duri,k , the procedure schedules h3 := min{h2 , duri,k − i } at t; duri,k−1 is updated as duri,k−1 = duri,k−1 + h3 and duri,k is updated as duri,k = duri,k − h3 . The rest of ik is treated as a new subactivity, taking i(k − 1) as its predecessor. Similarly to the non-preemptive case, it is not difficult to show that the Maxnint_Serial SGS is able to find an optimal schedule for every feasible Maxnint_PRCPSP instance. The following example illustrates how this procedure works. Let us consider = (, d), with = (0 1 2 4 3 4 5 6 4 7), d = (0 2 1 1 3 1 1 4 2 0), nint = (0 0 0 0 2 0 0 0) and nsub = 10. The Maxnint_Serial SGS applied to begins by scheduling activities 1 and 2 as early as possible, since they cannot be interrupted they are scheduled as in the RCPSP. The same happens to the subactivity 4a, with duration 1, leading to the partial schedule of Fig. 4 . In the
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
3a 4a
2
5
1 0
1
3b 2
3
4
5
6
7
8
9
Fig 5. Partial schedule before scheduling activity 6.
next iteration the procedure has to schedule activity 3. This activity cannot be scheduled in [0, 3[ due to resource restrictions. However, the activity can be split into two parts, one part 3a with two units and another 3b with 1. If we do this, we can schedule 3a in [0, 2[ and 3b in [3, 4[. Accordingly, we increase nint(3) by 1. Next we schedule activity 5 in [4, 5[. If we only consider resource restrictions, subactivity 4b can be placed in [0, 1[, however, it must be scheduled after 4a, and hence we schedule it in [1, 2[. Therefore, 4a and 4b form a single subactivity, 4a, giving place to the partial schedule of Fig. 5. Afterwards, the Maxnint_Serial SGS deals with activity 6. This activity is allowed to be interrupted once, and one unit of 6 fits in [3, 4[. However, 6 = 2, which means that we cannot schedule one unit in isolation. Therefore, we have to schedule 6 in [5, 9[. The last subactivity is 4c (now it could be considered 4b after we have joined 4a and 4b in 4a) with duration 2. Before applying the Maxnint_Serial SGS to , 4c could not be preempted because the maximum number of interruptions for activity 4 was two. However, after joining 4a and 4b, we have nint(4) = 1, thus we can now interrupt 4c obtaining the solution S of Fig. 3. With this example we can see how the same phenotype (schedule S) has several genotypes ( and ). Furthermore, the Maxnint_Serial SGS is able to create new interruptions when appropriate and also to eliminate them when not needed. An important consequence of this property is the diversity it introduces into the population weakening the need of additional mechanisms to produce new interruptions. Note that the serial_SGS could be used to obtain a feasible schedule for the Maxnint_PRCPSP, working with each subactivity as it was an activity, but this would not allow changing the duration of the parts of the activities when scheduling. Note, also, that if ( , d ) is a representation of a solution S then the Maxnint_Serial SGS applied to ( , d ) yields S. 3.3. CalculateInitialCodification This procedure iteratively generates a codification = (, d). At iteration j it selects an activity i from a set Elig and fixes (j) = ik if k − 1 parts of i have been previously introduced in . It also decides whether to split it or not, specifically calculating how many units of activity duration i to assign to d(j) = duri,k . The set Elig contains the activities whose predecessors (the subactivities in which their predecessors have been split) have already been selected. We employ the regret based biased random sampling method together with the Latest Finish Time priority rule to select the activity i at iteration j. The latest finish times of the activities are computed on the original graph (V, A). To iteratively construct vector d an auxiliary vector leftdur of length n is maintained, leftdur(i) containing the number of units of i, i 0, n+1, that have not been assigned yet. If activity i, i 0, n+1, has already been interrupted maxnint(i) times or leftdur (i) 2i , then it cannot be further interrupted. Therefore, we fix d(j) = leftdur(i), eliminate i from Elig and update Elig when necessary, otherwise it is randomly decided whether to interrupt activity i or not. A random number between 0 and 1 is generated. If this number is less than a parameter perceninterrup, then activity i is not interrupted.
2917
Therefore, we fix d(j) = leftdur(i), eliminate i from Elig and update Elig when necessary. If the random number is greater or equal than perceninterrup, then d(j) is calculated as a random integer number between i and leftdur(i) − i . Activity i is not eliminated from Elig and leftdur(i) is updated by subtracting d(j) from it. The procedure ends when Elig is empty, i.e., when all the units of all activities have been assigned. This procedure builds a codification in nsub iterations, where nsub is unknown until the end of the procedure. Note that the designed procedure is able to generate every possible codification for the problem. 3.4. BeginEndOnePointCrossover The one-point crossover proposed by Hartmann [9] is a wellknown crossover used in many genetic algorithms [9]. In project scheduling it has been applied to cross vectors of equal length. In our case, however, the lengths of the subactivity lists and duration vectors of different representations are usually different. To overcome this problem and to incorporate the capability of modifying the interruption patterns of the parents we have adapted the onepoint crossover to our problem, creating the begin-end one-point crossover. To generate a daughter the new crossover works as follows: Let M = (M , dM ) and F = (F , dF ) be the selected mother and father. A random integer number p between 1 and nsubM is generated. The first p subactivities and their durations are copied from the mother to the daughter D = (D , dD ) in the same positions. Next, the procedure iteratively considers the father subactivities, starting from the last, for being placed in D starting from the last position backwards. The initial length of vectors D and dD is maxnsub. At iteration j, the procedure considers the subactivity i = F (nsubF − j + 1) with duration d∗ = dF (nsubF − j + 1). The next step is to decide whether the chosen activity can be further interrupted or not. If nintD (i)=maxint(i) or leftdurD (i) < i + d∗ , then i is not further interrupted and we make dD (k)=leftdurD (i) where k is the last unfulfilled position in D . Otherwise, we make dD (k) = min(leftdurD (i), d∗ ). The procedure ends erasing the blank cells from D and dD . Similarly, a son can be obtained by interchanging the roles of the father and the mother. To illustrate the above procedure we have applied it to the mother M = (M , dM ) = ((0 1 2 4 3 4 3 5 3 2 6), (0 2 2 2 2 3 1 1 1 1 0)) and father F = (F , dF ) = ((0 1 2 3 4 5 4 2 6), (0 2 2 4 3 1 2 1 0)) of Tables 1a and b, which are representations in a Maxnint_PRCPSP problem where p1 = 2, p2 = 3, p3 = 4, p4 = 5, p5 = 1, maxnint1 = 0, maxnint2 = 2, maxnint3 = 2, maxnint4 = 1, maxnint5 = 0 and 4 = 2. Then, maxnsub = 7 + 1 + 2 + 2 = 12. Suppose that the value p = 4 has been chosen. After copying the four first subactivities from M: D = (0 1 2 4 0 0 0 0 0 0 0 0) and dD = (0 2 2 2 0 0 0 0 0 0 0 0). After the first three iterations copying from F, the daughter is D = (0 1 2 4 0 0 0 3 5 4 2 6) and dD = (0 2 2 2 0 0 0 4 1 3 1 0). In the case of activity 4, we have assigned to it three units of duration, although the duration of this subactivity in the father is 2. If we had assigned two units of duration, we would have somewhere another part of activity 4 with duration 1 and three parts in total, but this would have been in contradiction with 4 =2 (and with maxnint4 =1). Afterwards, activities 5 and 3 receive the duration they have in the father (Table 1c). This last activity has 2 interruptions in the mother, but none in the father and daughter. After erasing the blanks cells, we obtain the daughter of Table 1d: D = (0 1 2 4 3 5 4 2 6) and dD = (0 2 2 2 4 1 3 1 0), with nsubD = 9. A desirable property of a crossover is that the children inherit the structures shared by the parents. Our crossover has this property. Activities with just one apparition in both activity lists appear also just once in the children. Also, activities with the same number of parts and the same part durations in both parents are also transferred
2918
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
Table 1 (a) Mother; (b) Father; (c) Daughter before erasing blanks and (d) Daughter. (a) Position Subactivity Duration
1 0 0
2 1 2
3 2 2
4 4 2
5 3 2
6 4 3
7 3 1
8 5 1
9 3 1
10 2 1
11 6 0
12
(b) Position Subactivity Duration
1 0 0
2 1 2
3 2 2
4 3 4
5 4 3
6 5 1
7 4 2
8 2 1
9 6 0
10
11
12
(c) Position Subactivity Duration
1 0 0
2 1 2
3 2 2
4 4 2
5
6
7
8 3 4
9 5 1
10 4 3
11 2 1
12 6 0
(d) Position Subactivity Duration
1 0 0
2 1 2
3 2 2
4 4 2
5 3 4
6 5 1
7 4 3
8 2 1
9 6 0
10
11
12
in that way to the children. For instance, activity 2 has two parts in the father and the mother, one at the beginning and one at the end, with 2 and 1 units of duration, respectively. The daughter inherits the same number of subactivities of activity 2 with the corresponding durations. 3.5. Unary operator The unary operator selects some subactivities from the subactivity list at random and applies a certain change to them. On average pmut · nsub subactivities are selected. If subactivity ik is chosen, either its position is changed in , or ik is eliminated and its duration duri,k is transferred to the first appearance of the activity (duri,1 := duri,1 + duri,k and nint(i) := nint(i) − 1). This last possibility is only allowed if i is not a whole activity (nint(i) > 0) and in this case it is applied with probability 0.5. To change the position of a subactivity ik, the procedure first calculates the minimum and the maximum possible positions for ik in the subactivity list. These two figures can be easily calculated from the positions of the predecessors and successors of the subactivity, bearing in mind that previous (posterior) appearances of the activities are also considered predecessors (successors) of the subactivity. It now randomly chooses a position in this interval and places ik in that position. We must emphasize that it is a deliberate choice that the unary operator does not introduce more interruptions in the codification by splitting subactivities. Preliminary tests with such (and other) operators did not lead to improved results. A (partial) reason could be that other procedures of the algorithm such as SGS and Maxnint_DJ already produce new interruptions in the solutions. This unary operator can be interpreted as a mutation operator. In the computational tests we will study the possibility of always applying it after the crossover as a mutation operator. 3.6. Maxnint_DJ The justification of a schedule in RCPSP was introduced in 1964 by Wiest [31], but has not been used to its full potential until recently. The justification of a schedule S to the right (left) consists of fixing the dummy activity n + 1(0)int = T(S)(t = 0) and scheduling each activity as late (early) as possible in decreasing (increasing) order of their finish (start) times. Valls et al. [25] have used the justification in a very concrete and effective way, by terms of the double justification or DJ. A similar technique called forward-backward pass was used in Tormos and Lova [23]. The DJ of a schedule S consists in justifying it to the right
and then justifying the resulting schedule to the left. It is a very easy and rapid procedure that never increases the makespan of a schedule and in many cases shortens it. Two of the current best heuristic algorithms include the DJ as one of their most important features [25,27]. To define Maxnint_DJ we need to introduce the concept of reverse project. The reverse project is the network obtained by simply reversing the precedence relationships of the original project. It has been proved in the context of the RCPSP [1] that applying the DJ to a schedule S is the same as twice applying the serial SGS. Firstly, in the reverse project, to the activity list (for the reverse project) formed with the activities in non-increasing order of their finishing times in S, obtaining S . Secondly, in the original project, to the activity list formed with the activities in non-decreasing order of their starting times in S . Taking this into account, we define the Maxnint_DJ as follows: apply Maxnint_Serial SGS twice, firstly in the reverse project and secondly in the original project. Maxnint_DJ can modify the interruptions in a schedule. Note that although new preemptions can appear the procedure never increases the makespan of a schedule. 3.7. Redefinition In many combinatorial problems like the TSP (with permutations of the cities as codifications) a codification can be clearly identified or is very similar to the solution it represents. In other problems, however, the decoding procedure obtains a solution which usually possesses different characteristics than the codification. In our case, the procedure Maxnint_Serial SGS may change the number of interruptions for some activities or the duration of some subactivities with respect to the initial codification . The generated solution S can again be changed by Maxnint_DJ, which can be viewed as a second step of the genotype calculation. The function redefinition translates all these modifications into a new individual (genotype) which is the representation of the schedule S (phenotype) generated by Maxnint_DJ. Subsequently, the algorithm works with instead of with the original . Simply by omitting this function we obtain a version of the algorithm without inheritance. Both versions will show the same computational times, since the computational effort of redefinition is negligible when compared to that of the SGS or Maxnint_DJ. Without any further tests it could be claimed that to redefine an individual should always lead to better results, since the new genotype reflects much better the real features of the solution. However, this conclusion cannot be assumed beforehand. Hartmann [10] obtained worse results by applying the corresponding redefinition (without using this name) in the RCPSP with multiple
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
2919
Table 2 Different versions of the algorithm and their meanings.
PRCPSP 1_PRCPSP
EvoAlg
V2
V3
V4
V5
V6
V7
V8
V9
V10
V11
V12
V13
29.03 29.91
35.06 35.70
30.49 31.65
29.17 30.25
29.35 30.24
29.15 30.16
29.14 30.00
29.07 30.00
29.03 30.01
29.16 30.12
29.53 30.52
29.10 30.01
29.20 30.23
modes and non-renewable resources (the so called MRCPSP). We refer to that paper for a deeper discussion on this issue and for an explanation of why redefinition may not work. We will prove in the computational results section that the redefinition does improve our algorithm. 4. Computational results The performance of the algorithm presented in the previous section is examined by means of computational experiments. The coding was performed in C using the Microsoft Visual C + +6.0 programming environment, and the experiments were run on a Samsung X15 Plus portable computer with Pentium M processor with 1400 MHz clock speed and 512 MB RAM, equipped with Windows XP. As test instances we have used the standard sets j30 and j120 for the RCPSP. They were generated using PROGEN [16] under a full factorial experimental design with the following three independent problem parameters: network complexity (NC), resource factor (RF), and resource strength (RS). The set j120 (j30) consists of 600 (480) projects with 120 (30) non-dummy activities. Both sets require four resource types. Further details of these problem instances are given in [16]. They are available in the Project Scheduling Library (PSPLIB: http://www.bwl.uni-kiel.de/Prod/psplib/index.html) along with their optimum or the best from all the known makespans. Among the four RCPSP instance sets in PSPLIB, we have selected the j30 set because it is the only set for which the optimal solution is known for all the instances in the set. j120 is the set with the largest and most difficult projects in the library. To use these sets of instances for the m_PRCPSP it is only necessary to add the possibility of interrupting each activity at most m times. Throughout the text we will not consider the 120 instances of j30 with RS = 1, since they are trivial both for the RCPSP and the m_PRCPSP (the ES schedule is feasible and then optimal). In the RCPSP, it is a common practice (see, for example [11]) to compare heuristic algorithms by comparing the quality of the best schedules obtained by the algorithms when the maximum number of schedules that can be generated is limited to a certain maximum. The most usual number is 5000, although several other limits have been considered. Throughout this section we will use the following measures of the quality of an algorithm. We will denote by CP_dev the average percentage deviation of an algorithm from the critical path makespan, which is a lower bound for the Maxnint_PRCPSP. % imp_inst stands for the percentage of instances for which the corresponding algorithm has obtained a shorter solution than HGA. HGA is currently one of the best heuristics for the RCPSP [15]. Let HGA(i) and Alg(i) be the solution obtained in the instance i by HGA and algorithm Alg, respectively. We define the improvement obtained by the algorithm in the instance i as (HGA(i) − Alg(i))/Alg(i). Aver_imp (max_imp) stands for the average (maximum) improvement of the algorithm in the corresponding set. 4.1. Comparison between different version of the algorithm In this section we want to compare several versions (V1–V12) of our algorithm and thus state the importance of the different parameters and techniques. As a sign of the quality of an algorithm we will
Table 3 Results of the different versions in j120. V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13
Without Maxnint_DJ Without redefinition Apply the unary operator as a mutation after the crossover and do not use it independently maxlife = ∞ Apply the unary operator as a mutation after the crossover and, also, independently Two children instead of one in crossover maxlife = 6 for all individuals in POP pcrossover = 0.5 maxlife = 6, = /2 maxlife = 6, = /8 Calculate only individuals in initial population instead of 4 perceninterrup = 0.2
use CP_dev in the cases 1_PRCPSP and PRCPSP (see Table 3). In the standard version of our algorithm EvoAlg, we have used the following parameters: =50, =/4, pcrossover=0.75, perceninterrup=1, pmut = 0.05. In each iteration, we fix maxlife = 6 for every individual except for the best individual of the current population for which maxlife = ∞. These values have been fixed after same preliminary tests. Table 2 defines the differences between each version and the standard algorithm EvoAlg (Table 3). V2 and V3 show the usefulness of the justification as a local search and of redefinition. Clearly, the application of Maxnint_DJ produces an important quality jump, something that also happens in the RCPSP [25]. Using two different operators instead of the more usual combination of crossover and mutation seems also slightly better according to the results of V4. However, using both the crossover+mutation and unary operator does not lead to an increase in the quality (V6). The last idea that has also contributed to the quality of the algorithm is the use of a life span, because its omission (V5, maxlife = ∞) also slightly deteriorates the results. Concerning other choices of parameters or changes in the algorithm, neither calculating two children instead of one, nor applying in the same proportion the crossover and unary operators or calculating fewer individuals in the initial population, lead to an increase in the solution quality. Furthermore, we do not obtain better results either if we erase the best solution from POP when its life span is equal to maxlife, or adopt other strategies in the creation of the next population. It is worth noting that the algorithm seems quite robust to (slight) changes in the parameters and to the use of several elements. A very concrete setting of parameters and use of the different elements is not needed to achieve a quality between 29% and 29.50% in PRCPSP and 30% and 30.50% in 1_PRCPSP. Only the non-inclusion of two of the studied procedures, the justification and the redefinition, lead to an important deterioration of the quality. 4.2. Comparison between m_PRCPSP results with 5000 schedules Table 4 summarises the results of the experiments in j120 for 0 (HGA), 1, 2, 3 and unlimited interruptions (EvoAlg), with a limit of 5000. The first column indicates the maximum number of interruptions the results shown in each row refers to. The next columns contain figures explained in the previous section. Table 5 shows the same information as Table 4, but regarding the set j30. The second column refers to the deviations with respect to the optimal solutions
2920
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
Table 4 Computational results on the set j120.
Table 6 Improvement with durations in [1, 100].
m
CP_dev (%)
% imp. inst.a
Aver. imp.
max. imp.
m
CP_dev (%)
Aver. imp. (%)
max. imp. (%)
0 1 2 3 Unlimited
32.54 29.91 29.30 29.12 29.03
– 94.87 95.58 96.65 96.65
– 1.85 2.26 2.38 2.45
– 8.26 8.93 9.15 9.82
0 1 2 3 5 10 Unlimited
35.16 31.34 30.51 30.27 30.01 29.95 29.92
– 2.40 2.91 3.05 3.20 3.25 3.26
– 8.39 10.02 11.07 10.99 11.37 12.42
a Without taking into account the 152 instances where HGA = CPM. In these instances no improvement is possible.
Table 5 Computational results on the set j30 (without instances with RS = 1). m
opt_dev (%)
% imp. inst.
Aver. imp. (%)
max. imp. (%)
0 1 2 3 Unlimited
0 −1.45 −1.53 −1.57 −1.55
– 68.94 69.70 70.83 71.21
– 1.50 1.59 1.64 1.61
– 7.84 8.62 9.62 7.84
of the RCPSP. There are instances for which the solution found in the case of preemption is better than the optimal one in the RCPSP. In these cases we have a negative deviation. Regarding CP_dev, there is an important difference in j120 between the algorithms with and without interruption, with better results when preemption is allowed. In this set, there is a difference in CP deviation of 3.51%, 3.31%, 3.24% and 2.63% between EvoAlg with unlimited, 3, 2 and 1 interruptions and HGA. There is a percentage of improved instances of more than 90% and an average improvement of more than 2.2% if m > 1 and equal to 1.85% for m = 1. In j30 (without instances with RS = 1), the difference in deviation from the optimal solution is less than −1.5% if m > 1 and −1.45% for m = 1. The percentage of improved instances is approximately 70% and the average improvement lies between 1.50% and 1.60%. Summing up, we can conclude that the interruption clearly favours the achievement of better solutions within the same limit on the number of schedules generated. So, if a real problem admits preemption, it would be sensible to program a heuristic algorithm that takes advantage of it. It is worth noting that the deviation of EvoAlg (unlimited) from the optimal solutions for the RCPSP in j30 is negative, −1.55%. This means that the gap between the optimal solutions for the RCPSP and the PRCPSP is at least 1.55%, on average. The impact of the preemption is not the same in the two sets. The differences are clearly larger in j120 than in j30. This behaviour has also been observed and explained in Ballestín et al. [4]. Two reasons were pointed out, the difference in parameters used for the construction of both sets and the size of problems. According to the information of the table, there is not much improvement when allowing unlimited interruptions per activity instead of 3. To further analyse this topic we have performed another study. Concretely, we have modified the instances of the j120 set so that the durations of the activities are random integers between 1 and 100. We have run the algorithm with different limits on the number of interruptions, obtaining the results shown of Table 6. There is a difference in CP deviation of 3.82%, 4.66%, 4.89%, 5.15%, 5.21% and 5.24% between EvoAlg with 1, 2, 3, 5, 10 and unlimited interruptions and EvoAlg without preemption, respectively. Note that there is no information of HGA for these instances and we have had therefore to obtain the results for 0 interruptions with EvoAlg. Both the differences in CP deviation and the average improvements are bigger than in the previous case. Regarding the number of interruptions, the greatest difference appears again from 1 to 2 interruptions, whereas the solution quality does not increase so much if we allow
Table 7 (a) CP_dev depends on the number of schedules calculated (j120); (b) Average improvement with respect to HGA (j120) and (c) Maximum average improvement with respect to HGA (j120). Limit of schedules/m
0 (%)
1 (%)
2 (%)
3 (%)
Unlimited
(a) 5000 10,000 25,000 100,000
32.54 32.04 31.52 30.95
29.91 29.53 29.02 28.41
29.30 28.92 28.48 27.95
29.12 28.76 28.33 27.83
29.03 28.68 28.29 27.74
(b) 5000 10,000 25,000 100,000
1.85 1.78 1.77 1.81
2.26 2.18 2.12 2.11
2.38 2.29 2.21 2.19
2.45 2.35 2.25 2.25
(c) 5000 10,000 25,000 100,000
8.26 7.34 7.34 7.34
8.93 7.34 7.59 9.35
9.15 8.33 9.68 8.13
9.82 8.72 9.68 8.33
more than 5 (or even 2 or 3) interruptions. Nevertheless, this difference is greater than when the maximum duration is 10, and this is especially clear in the maximum improvement. This may be seen as another advantage of allowing preemption: it is enough to allow a low number of interruptions per activity to achieve the maximum improvement obtainable by preemption. This reduces the technical or human problems that may arise due to interrupting the activities many times. 4.3. Comparison between m_PRCPSP results with different limits of schedules The previous subsection has shown that preemption permits obtaining better solutions if there is a limit of 5000 schedules, however, this gap could theoretically disappear if more schedules were computed. In the limit, the optimal solutions for problems RCPSP and PRCPSP might have a very similar (even the same) makespan. In order to evaluate these possibilities we have designed the following experiment. We have run EvoAlg in j120 with a limit of 10,000, 25,000 and 100,000 schedules in the m_PRCPSP with m = 1, 2, 3 and unlimited. Each version is allowed to have a different number of individuals in the population, but the rest of the parameters are the same. The results are shown in Table 7a–c. The first column indicates the limit on the number of schedules, while the rest of columns contain the same information as in Table 4. Fig. 6 shows the differences between the CP_dev for different values of m and the CP_dev for HGA. The first conclusion we can draw from the first table is that EvoAlg is capable of calculating better solutions if more schedules are evaluated. As far as the difference between interrupting activities or not, we can see that the differences decrease, although it seems to stabilise and is still between 2.5% and 3.25% in 100,000. The maximum improvement does not decrease and the average improvement does
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
3.65
1_PRCPSP 2_PRCPSP
3.45
3_PRCPSP
2921
Table 8 CP_dev for different algorithms with different limits on the number of schedules. Limit of schedules
Ballestín et al. 1_PRCPSP (%)
EvoAlg in 1_PRCPSP (%)
HGA in PRCPSP (%)
EvoAlg in PRCPSP (%)
5000 10,000 25,000 100,000
30.35 29.78 29.34 28.71
29.91 29.53 29.02 28.41
29.51 29.21 28.86 28.57
29.03 28.68 28.29 27.74
PRCPSP
3.25 3.05 2.85 2.65 2.45 5000
10000
25000
100000
Fig 6. CP_dev differences with respect to HGA.
6.00 unlimited 5.50
3 2
5.00
1
4.50 4.00 3.50
93
84
75
66
57
48
39
30
21
12
3
3.00
Fig 7. Improvement with preemption in the first solutions of the algorithm.
not decrease much either. Taking everything into account, the preemption seems to also be useful when many schedules are calculated. The results could also be considered as an indication that there is a certain gap between optimal makespans when different types of preemption are allowed. The gaps between the results for different numbers of interruptions seem to be maintained even if more schedules are allowed. Regarding the j30 set, we have obtained that optimal solutions of the RCPSP are on average 1.79% worse than solutions obtained by EvoAlg with a limit of 100,000 schedules. This figure increases to 3.31% if we only consider instances where an improvement is achieved. 4.4. Preemption in the first calculated schedules We have already seen the difference between considering preemption or not with 5000 and more schedules. In this subsection we want to show the evolution of the makespan difference during the first iterations of the algorithm, as an indication of the role of preemption when (very) few solutions can be calculated. Sampling methods based on priority rules (followed sometimes by justification) are widely applied to calculate the first schedules in heuristic algorithms for the RCPSP. In fact, two of the best algorithms for this problem [25,27] use exactly the same LFT rule and a similar sampling as the one we have used in EvoAlg. Therefore, if we allow no preemption, the performance of EvoAlg in the first iterations is very similar to that of many state-of-the-art heuristics for this problem. The graph of Fig. 7 shows the average improvement of the algorithm with 0, 1, 2, 3 and unlimited interruptions with respect to the
solution obtained without interruption in the first 100 solutions of the algorithms in j120. We count each application of Maxnint_DJ as two schedules. In the first couple of iterations, solutions for the mPRCPSP with m > 1 are 5–5.50% better than without interruptions. With 1 interruption the improvement is 4–4.50%. In all cases there is a heavy descent in the difference at the beginning, later becoming more gradual. At any rate, it is clear that preemption is especially useful when (very) few solutions can be calculated. We only have to compare these values with the 1.8–2.5% range of improvement of Table 7b. Apparently it is easier to obtain good solutions when preemption is present, while to calculate good solutions without it we need to fit correctly the activities and for that we need more time and a deeper search in the solution space. These figures allow us to say that preemption can be very beneficial for rescheduling. Sometimes, during project execution, changes in the project data may make the initial solution unfeasible. In that case a new solution must be calculated, either trying to minimise the same objective function as at the beginning (in our case the makespan) or to obtain a new solution that is as close as possible to the old one, in order to reduce nervousness (see, e.g. [28]). Let us suppose that we are still interested in minimising the makespan of our solution each time we suffer a change in the input data. If we had to produce the new solution online or with a very short period of time, we would only be able to calculate very few solutions with any algorithm. In this case, allowing preemption could mean an improvement of 5% (on average) in the solution we obtain. 4.5. Comparison with other state-of-the-art algorithms As stated above, there are few algorithms that deal with preemption in the RCPSP, and none for the Maxnint_PRCPSP. Therefore, we cannot compare the performance of our algorithm with that of any other algorithm when solving the general problem Maxnint_PRCPSP. However, we can make comparisons when solving particular cases of problem Maxnint_PRCPSP. We have compared our algorithm for the 1_PRCPSP (third column of Table 8) with the algorithm presented in Ballestín et al. [4] (second column), which also works with the 1_PRCPSP. Besides, we have already said that heuristic algorithms for the RCPSP could be applied to solve the PRCPSP, working with transformed projects in which each activity i is split in pi subactivities of duration 1. We have applied HGA in this manner and we have compared its results (fourth column) with the obtained by EvoAlg (fifth column). Table 8 shows the different results for j120 in terms of deviation with respect to the CPM. EvoAlg outperforms the Ballestín et al. algorithm in the 1_PRCPSP in all cases. It also outperforms HGA in PRCPSP even more clearly. EvoAlg with 5000, 10,000 and 25,000 obtains better results than HGA with 10,000, 25,000 and 100,000 schedules, respectively. It seems that specific algorithms for the PRCPSP are clearly better than algorithms for the RCPSP used for this purpose. Finally, there are algorithms in the literature for the PRCPSP, although they have not worked with j120. The last published (working) paper we know is [29]. It tests two exact algorithms for the problem, being able to calculate the optimal solution with the best of them in 416 instances out of the 480 of set j30. Verma compares
2922
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
Table 9 Comparison with the exact algorithm of Verma. Decrease in makespan
0
1
2
3
4
5
6
Total
Count of problems Percentage Count of problems Percentage
158 53.38 165 45.83
56 18.92 74 20.56
52 17.57 78 21.67
21 7.09 31 8.61
7 2.36 8 2.22
1 0.34 2 0.56
1 0.34 2 0.56
296 100 360 100
his procedures with the algorithm of Demeulemeester and Herroelen [7], obtaining optimal solutions in more instances. The fact that three exact algorithms are not able to find all optimal solutions in j30 supports the need for heuristic algorithms when preemption is allowed. The second row in Table 9 shows the number of instances of j30 for which the difference between the optimal makespan, obtained when the algorithm of Verma is applied and the optimal noninterrupted makespan is equal to the number shown in the first row. The third row is reserved for the percentage with respect to the total instances calculated. Rows four and five show the same information, but now with respect to our algorithm. We have again not taken into account the 120 trivial instances where there are no resource restrictions. Given the data available, there is no way of comparing the quality of both algorithms. However, the distribution of the makespan decrease is similar for both algorithms, even bigger for EvoAlg when the decrease is not 0 (except in 4). This seems to indicate that EvoAlg finds the optimal solution in most of the instances. 5. Preemption in presence of due dates Our experience with preemption tells us that its incorporation allows us to obtain schedules in which (some) activities are scheduled earlier than in solutions for the non-preemptable case. When minimising the makespan, this feature leads sometimes to a lower makespan, as we have witnessed in the previous section. Thanks to this property, preemption can also be beneficial in other generalisations of RCPSP, especially when the objective function is regular. To prove this we have chosen to study the usefulness of preemption in the presence of due dates, an essential feature of many real projects. As far as we know, this is the first time this topic has been raised. Concretely, we have worked with two problems, the TardinessRCPSP and the DeadlineRCPSP. In the TardinessRCPSP the due dates are only present in the objective function, the total tardiness. So, this problem has the same restrictions as the Maxnint_PRCPSP, but optimises a different (regular) objective function. On the other hand, the DeadlineRCPSP shares with Maxnint_PRCPSP the objective function, the makespan minimisation. However, it has more restrictions to enforce the due dates, which in this problem are (strict) deadlines. In the DeadlineRCPSP it is NP-complete to obtain a feasible solution. In Ballestín et al. [3] these problems were addressed using several approaches inherited and adapted from the classical RCPSP, e.g. priority rules, sampling methods, metaheuristic methods. In this paper, we have developed a new algorithm, EvoAlg_dd, for these problems. It is based on EvoAlg and incorporates (adaptations of) techniques that provided good results in that paper. The first one is the Parallel SGS to be used with the priority rule EDD in the sampling procedure applied to calculate the initial population. EDD stands for earliest due date and assigns each activity its due date as priority. The Parallel SGS only takes decisions at the finish time of an activity, beginning at 0, the finish time of the dummy activity 0. At each decision time t, the procedure starts as many activities as possible, taking into account both precedence and resource restrictions. In a problem without preemption, starting an activity i at t means finishing it at t + pi . Even if preemption is allowed, the activity i cannot be
Scheme 2. Description of the ILS algorithm in Ballestín and Trautman [2].
scheduled before time t. This means that the Parallel SGS does not create interruptions by itself. The procedure creates so called nondelay schedules [22]. We could introduce preemption in the codifications before applying the Parallel SGS, thus building schedules with preemption, but this policy has not worked well with the Serial SGS (Section 4.1). It is worth mentioning that, if S is a non-delay schedule and is its representation, the Maxnint_Serial SGS applied to leads to S in spite of the fact that this SGS has the capability of creating interruptions. The second technique is an extension of the justification, defined in [26], called justification by eligibles. In the justification by eligibles to the left (right), each eligible activity can be selected at each iteration to be scheduled as early (late) as possible. An activity is eligible when all its predecessors (successors) have been justified. The double justification by eligibles we are going to use in this paper, DJelig, justifies all subactivities once to the right in a specific order and then justifies all subactivities once to the left in another concrete order. Note that the DJ used in EvoAlg does exactly the same, but restricts itself to a non-decreasing order of the finishing times of the activities in the justification to the right and to a non-increasing order of the start times of the activities in the justification to the left. Many rules were tested in Valls et al. [26], of which we have implemented the following: when justifying to the right, select the eligible subactivity with the largest finishing time; when justifying to the left, select the eligible subactivity with smallest tentative start time that offers the best improvement in the objective function. The tentative start time is the start time that would be obtained if the subactivity had been selected to be justified at this step. Note that the justification by eligibles may worsen a solution in the TardinessRCPSP, as well as transform a feasible solution for the DeadlineRCPSP into an infeasible one. Nevertheless, it has been shown in [26] the benefits of incorporating the justification by eligibles to some algorithms for both problems, especially when it is applied with the appropriate rules. There are some other differences between EvoAlg_dd and EvoAlg. EvoAlg_dd does not use the concept of life span, i.e., it works with maxlife=∞. Also, it applies the unary operator after the crossover as a mutation, but does not use it alone. Thus, it is equivalent in that sense to V4 of the previous section. Finally, the biggest difference is that EvoAlg incorporates a second phase. After having calculated 4000 schedules we apply the so-called iterated local search (ILS [20]) for the rest 1000 schedules, beginning with the best solution calculated in the first phase. A recent application of ILS can be found in [2]. ILS can be described in Scheme 2.
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
2923
Scheme 3. Outline of algorithm EvoAlg_dd.
Table 10 Comparison of different versions of the algorithm in TardinessRCPSP and DeadlineRCPSP. Algorithm
# inter.
Loose
Medium
Tight
# feas. sol.
EvoAlg_dd
1 Unlim.
6.09 5.73
159.54 151.70
1016.85 994.00
413 431
EvoAlg
1 Unlim.
41.59 38.72
239.36 225.21
1151.94 1111.03
185 195
EvoAlg with DJelig
1 Unlim.
6.46 6.01
164.36 155.80
1031.17 1003.43
408 421
EvoAlg_dd 2500–2500
1 Unlim.
5.86 5.49
159.46 152.02
1020.71 997.49
416 430
We have used the unary operator as Perturbation and DJelig as a LocalSearch, although it is in reality not a local search. As acceptance criterion we have used a simple one, we change from the old to the new solution only if the new one is better. The outline of EvoAlg_dd is as in Scheme 3. In [3] a generator of due dates was created, which introduced due dates in instances from the j120 set with different levels of tightness. Concretely, three sets were created, the loose, the medium and the tight set. In the loose (tight) set, good solutions in the search space will usually have few (many) delayed activities. The medium set lies between those two sets in terms of difficulty. In the TardinessRCPSP we use these three sets as test sets, but only the loose set is used in the DeadlineRCPSP, given the unfeasibility of most instances
in the medium and tight sets. Table 10 shows the results of different versions of the algorithm in both problems: EvoAlg_dd, EvoAlg, EvoAlg with DJelig (=EvoAlg_dd without using ILS) and a version of EvoAlg_dd in which both phases calculate 2500 schedules. The first column states the algorithm we apply, the second how many interruptions per activity are allowed. The third, fourth and fifth column refer to the TardinessRCPSP and contain the average of the tardiness over the loose, medium and tight sets, respectively. The last column reflects the number of feasible solutions each algorithm finds in the DeadlineRCPSP. These results clarify the importance of DJelig. Also the second phase of the ILS contributes to the quality of EvoAlg_dd, although increasing the relevance of ILS inside the algorithm does not improve significantly
2924
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
Table 11 Usefulness of preemption in TardinessRCPSP and DeadlineRCPSP. Algorithm EvoAlg_dd in problem
Loose
Medium
Tight
# feas. sol.
PRCPSP 3_PRCPSP 2_PRCPSP 1_PRCPSP Best results in Ballestín et al. [4]
5.73 5.79 5.69 6.09 11.40
151.70 154.14 154.91 159.54 199.015
994.00 1001.41 1005.08 1016.85 1119.18
431 433 426 413 342
the performance of EvoAlg_dd. There is not much difference between EvoAlg_dd and the version with 2500 schedules in each phase. We have chosen the first one as the standard because it offers better results in the tight set, a set where the impact of preemption is the smallest. Finally, we want to assess the impact of allowing preemption in the TardinessRCPSP and DeadlineRCPSP. To do this, the results of EvoAlg_dd are compared with the best results achieved in [3]. The last row of Table 11 contains the best results achieved [3], without allowing preemption. The rest of the rows are dedicated to EvoAlg_dd, with different numbers of interruptions permitted. In the TardinessRCPSP, results with unlimited interruptions are a 49.74% (=(11.40 − 5.73)/11.40), 23.77% and 11.18% less than the best results without preemption in the loose, medium and tight set respectively. Besides, in the DeadlineRCPSP, the algorithm with 2, 3 and unlimited interruptions find approximately 25% more possible solutions than the best algorithm without preemption. This algorithm obtains a makespan 1.75% worse than the algorithm with unlimited interruptions. If we do not use the EDD rule in the initial population, the deterioration grows to 2.22%, although the number of instances where a feasible solution is found decreases to 393. Bearing in mind all these results, we can say that preemption is useful in presence of due dates, perhaps much more useful than in the RCPSP. There is little difference between 2, 3 or unlimited interruptions. 6. Concluding remarks To the best of our knowledge there is no model in the literature which deals with activities with different numbers of allowed interruptions. We have defined such a model, also incorporating the possibility of restricting the minimum duration of the subactivities and due dates. We have proposed an evolutionary algorithm for the new problem Maxnint_RCPSP, with a suitable codification and crossover. With this algorithm we are able to solve the m-PRCPSP, the problem in which each activity is allowed to be interrupted at most m times. In the computational experiments we have studied the improvement achievable in the makespan if one allows 1, 2, 3 or unlimited interruptions per activity. Naturally, we study this issue from the point of view of our algorithm, which presumably offers good solutions for these problems. However, we can only obtain an estimation—the unique estimation available—of the real gap. At any rate, in the perhaps most important case—RCPSP vs. m-PRCPSP—we compare our results with those of HGA. According to the results, allowing interruption leads to a certain improvement in the makespan if we calculate 5000 schedules, which amounts to 3.5% in the average deviation to the critical path. Increasing the limit of schedules leads at the beginning to a decrease in this improvement, but then there is a stabilisation. Regarding the difference between 1, 2, 3 and unlimited interruptions, we could basically say that there is some gap between 1 and more interruptions, but more than 2 interruptions does not seem to add much to the solution quality. Two important conclusions never before mentioned in the literature can be drawn from the last sections of the paper. Firstly, preemption seems especially useful in the first steps of the algorithm
when only few solutions are calculated. This makes preemption very attractive for rescheduling, when the objective function is still the makespan. It would be interesting to study its usefulness when the goal is robustness, as well as with other non-regular objective functions. Secondly, preemption also helps find better solutions when due dates are present. We have proved its advantages in two different problems, reaching an improvement in the objective function of 50% when due dates are loose in the TardinessRCPSP and obtaining a feasible solution in 25% more of instances in the DeadlineRCPSP. References [1] Ballestín F. Nuevos métodos de resolución del problema de secuenciación de proyectos con recursos limitados. Unpublished PhD dissertation, Universidad de Valencia; 2002. [2] Ballestín F, Trautmann N. An iterated-local-search heuristic for the resourceconstrained weighted earliness-tardiness project. International Journal of Production Research 2008;46:6231–49. [3] Ballestín F, Valls V, Quintanilla S. Due dates and RCPSP. In: ózefowska J, Weglarz J, editors. Perspectives in modern project scheduling. Berlin: Springer; 2006. p. 79–104 [chapter 4]. [4] Ballestín F, Valls V, Quintanilla S. Pre-emption in resource-constrained project scheduling. European Journal of Operational Research 2008;189:1136–52. [5] Blazewicz J, Lenstra JK, Rinooy Kan AHG. Scheduling subject to resource constraints: classification and complexity. Discrete Applied Mathematics 1983;5:11–24. [6] Bock DB, Patterson JH. A comparison of due date setting, resource assignment and job pre-emption heuristics for the multiproject scheduling problem. Decision Sciences 1990;21:387–402. [7] Demeulemeester E, Herroelen W. An efficient optimal procedure for the preemptive resource-constrained project scheduling problem. European Journal of Operational Research 1996;90:334–48. [8] Drexl A. Scheduling of project networks by job assignment. Management Science 1991;37:1590–602. [9] Hartmann S. A competitive genetic algorithm for resource-constrained project scheduling. Naval Research Logistics 1998;45:733–50. [10] Hartmann S. Project scheduling with multiple modes: a genetic algorithm. Annals of Operations Research 2001;102:111–35. [11] Hartmann S, Kolisch R. Experimental evaluation of state-of-the-art heuristics for the resource-constrained project scheduling problem. European Journal of Operational Research 2000;127:394–407. [12] Kaplan LA. Resource-constrained project scheduling with pre-emption of jobs. Unpublished PhD dissertation, University of Michigan; 1988. [13] Kaplan LA. Resource-constrained project scheduling with setup times. Unpublished paper, Department of Management, University of Tenessee, Knoxville; 1991. [14] Kolisch R, Hartmann S. Heuristic algorithms for the resource-constrained project scheduling problem: classification and computational analysis. In: Weglarz J, editor. Project scheduling—recent models algorithms and applications. Boston: Kluwer Academic Publishers; 1999. p. 147–78. [15] Kolisch R, Hartmann S. Experimental investigation of heuristics for resourceconstrained project scheduling: an update. European Journal of Operational Research 2006;174(1):23–37. [16] Kolisch R, Sprecher A, Drexl A. Characterization and generation of a general class of resource-constrained project scheduling problems. Management Science 1995;41:1693–703. [17] Michalewicz Z. Genetic algorithms + data structures = evolution programs. New York: Springer; 1994. [18] Neumann K, Schwindt C, Zimmermann J. Project scheduling with time windows and scarce resources. Berlin: Springer; 2003. [19] Nudtasomboon N, Randhawa S. Resource-constrained project scheduling with renewable and non-renewable resources and time-resource tradeoffs. Computers & Industrial Engineering 1997;32(1):227–42. ¨ [20] Lourenço HR, Martin O, Stutzle T. Iterated local search. In: Glover F, Kochenberger G, editors. Handbook of metaheuristics. Norwell, MA: Kluwer Academic Publishers; 2002. p. 321–53. [21] Slowinski R. Two approaches to problems of resource allocation among project activities—a comparative study. Journal of the Operational Research Society 1980;31(8):711–23. [22] Sprecher A, Kolisch R, Drexl A. Semi-active active and non-delay schedules for the resource-constrained project scheduling problem. European Journal of Operational Research 1995;80:94–102. [23] Tormos P, Lova A. A competitive heuristic solution technique for resourceconstrained project scheduling. Annals of Operations Research 2001;102: 65–81. [24] Tsubakitani S, Deckro RF. A heuristic for multiproject scheduling with limited resources in the housing industry. European Journal of Operational Research 1990;49:80–91. [25] Valls V, Ballestín F, Quintanilla S. Justification and RCPSP: a technique that pays. European Journal of Operational Research 2005;165:375–86. [26] Valls V, Ballestín F, Quintanilla S. Justification technique generalisations. In: Józefowska J, Weglarz J, editors. Perspectives in modern project scheduling. Berlin: Springer; 2006. [chapter 9].
F. Ballestín et al. / Computers & Operations Research 36 (2009) 2913 -- 2925
[27] Valls V, Ballestín F, Quintanilla S. A hybrid genetic algorithm for the resourceconstrained project scheduling problem. European Journal of Operational Research 2008;185(2):495–508. [28] Van de Vonder S. Proactive-reactive procedures for robust project scheduling. PhD dissertation, No. 247, Katholieke Universiteit Leuven; 2006. [29] Verma S. Exact methods for the preemptive resource-constrained project scheduling problem. Working Paper no. 2006-03-08; 2006.
2925
[30] Weglarz J. Project scheduling with continuously-divisible, doubly constrained resources. Management Science 1981;27(9):1040–53. [31] Wiest JD. Some properties of schedules for large projects with limited resources. Operations Research 1964;12:395–418.