an evolutionary algorithm for the resource-constrained project scheduling problem with minimum and...

16
J Sched (2011) 14:391–406 DOI 10.1007/s10951-009-0125-9 An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags Francisco Ballestín · Agustín Barrios · Vicente Valls Published online: 2 September 2009 © Springer Science+Business Media, LLC 2009 Abstract In this paper, we present an evolutionary algo- rithm (EVA) for solving the resource-constrained project scheduling problem with minimum and maximum time lags (RCPSP/max). EVA works on a population consisting of several distance-order-preserving activity lists representing feasible or infeasible schedules. The algorithm uses the conglomerate-based crossover operator, the objective of which is to exploit the knowledge of the problem to iden- tify and combine those good parts of the solution that have really contributed to its quality. In a recent paper, Valls et al. (European J. Oper. Res. 165, 375–386, 2005) showed that incorporating a technique called double justification (DJ) in RCPSP heuristic algorithms can produce a substantial im- provement in the results obtained. EVA also applies two double justification operators DJmax and DJU adapted to the specific characteristics of problem RCPSP/max to im- prove all solutions generated in the evolutionary process. Computational results in benchmark sets show the merit of the proposed solution method. Keywords Resource-constrained project scheduling · Maximum time lags · Meta-heuristic algorithms F. Ballestín ( ) Dept. de Estadística e Investigación Operativa, Universidad Pública de Navarra, 31006 Pamplona, Spain e-mail: [email protected] A. Barrios Dept. de Matemáticas y Física, Universidad del Norte, Barranquilla, Colombia e-mail: [email protected] V. Valls Dept. de Estadística e Investigación Operativa, Universidad de Valencia, 46100 Burjasot, Spain e-mail: [email protected] 1 Introduction The classical resource-constrained project scheduling prob- lem (RCPSP) consists in scheduling a set of activities sub- ject to resource restrictions and precedence relationships. Numerous publications have appeared in the last years for this problem, thus proving its importance, most of them heuristic algorithms (cf. Kolisch and Hartmann 1999, 2006). One of the reasons for this amount of research is that many project scheduling problems, among them practical appli- cations, are generalisations of the RCPSP. Hence, the study and development of new techniques for the RCPSP can and should have an important impact in these problems. Since heuristic algorithms are much more flexible than exact pro- cedures and can be therefore transferred easily to similar problems, these types of algorithms have been preferred over the exact ones. A very similar reasoning could be done with the RCPSP/ max, an extension of the RCPSP with generalised prece- dence constraints. The RCPSP/max is also the basis for many other academic problems. Moreover, it allows us to model many characteristics commonly found in practical scheduling problems. On top of that, the maximal time lags appearing in these applications demand special techniques that do not appear in the RCPSP. However, not so many publications exist for the RCPSP/max, and the lack is more important in (pure) heuristic algorithms. Among the inves- tigation within the OR community, we can cite the exact branch-and-bound algorithms by Bartusch et al. (1988), De Reyck and Herroelen (1998), Schwindt (1998), Fest et al. (1998) and Dorndorf et al. (2000). Different heuristics have been proposed by Franck et al. (2001), Cesta et al. (2002), Cirirelo and Smith (2004) and Smith (2004). In this paper, we present an evolutionary algorithm (EVA) for this problem. Its new features include a new

Upload: francisco-ballestin

Post on 15-Jul-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

J Sched (2011) 14:391–406DOI 10.1007/s10951-009-0125-9

An evolutionary algorithm for the resource-constrained projectscheduling problem with minimum and maximum time lags

Francisco Ballestín · Agustín Barrios · Vicente Valls

Published online: 2 September 2009© Springer Science+Business Media, LLC 2009

Abstract In this paper, we present an evolutionary algo-rithm (EVA) for solving the resource-constrained projectscheduling problem with minimum and maximum time lags(RCPSP/max). EVA works on a population consisting ofseveral distance-order-preserving activity lists representingfeasible or infeasible schedules. The algorithm uses theconglomerate-based crossover operator, the objective ofwhich is to exploit the knowledge of the problem to iden-tify and combine those good parts of the solution that havereally contributed to its quality. In a recent paper, Valls et al.(European J. Oper. Res. 165, 375–386, 2005) showed thatincorporating a technique called double justification (DJ) inRCPSP heuristic algorithms can produce a substantial im-provement in the results obtained. EVA also applies twodouble justification operators DJmax and DJU adapted tothe specific characteristics of problem RCPSP/max to im-prove all solutions generated in the evolutionary process.Computational results in benchmark sets show the merit ofthe proposed solution method.

Keywords Resource-constrained project scheduling ·Maximum time lags · Meta-heuristic algorithms

F. Ballestín (�)Dept. de Estadística e Investigación Operativa, UniversidadPública de Navarra, 31006 Pamplona, Spaine-mail: [email protected]

A. BarriosDept. de Matemáticas y Física, Universidad del Norte,Barranquilla, Colombiae-mail: [email protected]

V. VallsDept. de Estadística e Investigación Operativa, Universidadde Valencia, 46100 Burjasot, Spaine-mail: [email protected]

1 Introduction

The classical resource-constrained project scheduling prob-lem (RCPSP) consists in scheduling a set of activities sub-ject to resource restrictions and precedence relationships.Numerous publications have appeared in the last years forthis problem, thus proving its importance, most of themheuristic algorithms (cf. Kolisch and Hartmann 1999, 2006).One of the reasons for this amount of research is that manyproject scheduling problems, among them practical appli-cations, are generalisations of the RCPSP. Hence, the studyand development of new techniques for the RCPSP can andshould have an important impact in these problems. Sinceheuristic algorithms are much more flexible than exact pro-cedures and can be therefore transferred easily to similarproblems, these types of algorithms have been preferredover the exact ones.

A very similar reasoning could be done with the RCPSP/max, an extension of the RCPSP with generalised prece-dence constraints. The RCPSP/max is also the basis formany other academic problems. Moreover, it allows us tomodel many characteristics commonly found in practicalscheduling problems. On top of that, the maximal time lagsappearing in these applications demand special techniquesthat do not appear in the RCPSP. However, not so manypublications exist for the RCPSP/max, and the lack is moreimportant in (pure) heuristic algorithms. Among the inves-tigation within the OR community, we can cite the exactbranch-and-bound algorithms by Bartusch et al. (1988), DeReyck and Herroelen (1998), Schwindt (1998), Fest et al.(1998) and Dorndorf et al. (2000). Different heuristics havebeen proposed by Franck et al. (2001), Cesta et al. (2002),Cirirelo and Smith (2004) and Smith (2004).

In this paper, we present an evolutionary algorithm(EVA) for this problem. Its new features include a new

Page 2: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

392 J Sched (2011) 14:391–406

codification (distance-order-preserving activity lists), a newcrossover operator adapted to the specific characteristics ofproblem (conglomerate-based crossover operator) and twoimprovement methods (DJmax and DJU).

The problem RCPSP/max, as an extension of the RCPSP,is NP-hard, and even the question whether a problem in-stance has a feasible solution is NP-hard (Bartusch et al.1988). This is an essential difference with the classicalRCPSP that conditions the designed procedures.

The rest of the paper is organised as follows. In Sect. 2,we first define the RCPSP/max problem. We next summarisesome concepts and procedures introduced by other authors.The material of this part has been drawn from Neumannet al. (2002). Section 3 is devoted to the description ofthe main elements of EVA. Computational results are in-cluded in Sect. 4. Finally, some concluding remarks appearin Sect. 5.

2 The problem

The problem RCPSP/max may be stated as follows. Aproject consists of a set activities V = {0,1, . . . , n, n + 1}where each activity has to be processed without interruption.The dummy activities 0 and n + 1 represent the beginningand end of the project, respectively. The processing time ofan activity i is denoted by pi where p0 = pn+1 = 0. Thereare K renewable resource types. The availability of each re-source type k in each time period is Rk units, k = 1, . . . ,K .Each activity i requires rik units of resource k during eachperiod of its duration, where r0k = rn+1,k = 0, k = 1, . . . ,K .All above parameters are assumed to be nonnegative inte-ger valued. A solution for the RCPSP/max is a list of starttimes or schedule S = (s0, s1, . . . , sn, sn+1), where s0 = 0,and sn+1 is the makespan or project length. These start timesshould also fulfil generalised precedence relations, temporalconstraints or time lags between the activities. These timelags define the arcs in the activity-on-node project networkN with node set V that can represent the project. A mini-mum time lag dmin

ij ∈ Z between the start times of two dif-ferent activities i and j means that activity j cannot beginearlier than dmin

ij time units after the start of activity i, i.e.

sj − si ≥ dminij . It is modelled as an arc 〈i, j 〉 in N with

weight δij = dminij . Such minimum time lags arise, for ex-

ample, from assembly relationships between main productsat lower and upper levels of the product structure. A maxi-mum time lag dmax

ij ∈ Z between the start of activities i andj means that activity j cannot begin later than dmax

ij time

units after the start of activity i, i.e. sj − si ≤ dmaxij , and is

modelled as an arc 〈j, i〉 in N with weight δij = −dmaxij .

Maximum time lags may, for example, be used to model up-per bounds on the total flow times of products, which canserve to limit the work-in-progress inventory (see Neumann

and Schwindt 1995 for further examples of minimum andmaximum time lags arising in production scheduling). LetE be the set of all generalised precedence constraints. Notethat the generalised precedence relations can also be initiallydefined between the start time of i and the finish time of j ,between the finish time of i and the start time of j and alsobetween the finish times of i and j . Nevertheless, all thesetime lags can be transformed into relations between the starttimes of the activities (Neumann et al. 2002).

Network N generally contains cycles. Any strong com-ponent in N with at least two nodes is called a cycle struc-ture. Strong components can be calculated, e.g. by the algo-rithm of Tarjan (1972). We consider the temporal schedulingnetwork N+ that results from project network N by addingthe backward arc 〈n+1,0〉 with weight δij = −d∗, where d∗is a maximum project duration. By dij we denote the longestpath length from node i to node j in N+, where dij = 0 fori = j . The distance order in project network N with nodeset V is defined as follows: for i, j ∈ V, i �= j, i is before j

exactly if either (a) dij > 0 or (b) dij = 0 and dji < 0. Wecan introduce a graph called the precedence graph (PG) in-duced by this order, where there is a directed arc betweenactivities i and j if conditions (a) or (b) hold. We can buildPG by eliminating redundant arcs (cf. Neumann et al. 2002).

The RCPSP/max can now be formulated as follows:

minimise T (S) = sn+1 (1)

subject to sj − si ≥ δij (〈i, j 〉 ∈ E) (2)∑

i∈V :si≤t<si+pi

rik ≤ Rk,

k = 1, . . . ,K,0 ≤ t ≤ d∗, (3)

si ≥ 0 (i ∈ V ), (4)

s0 = 0. (5)

The objective is to minimise the makespan (line (1)), sub-ject to temporal constraints (restrictions (2)) and resource re-strictions (given by (3)). All start times are nonnegative, andthe start of the project occurs at 0 (restrictions (4) and (5)).

3 The evolutionary algorithm

Two essential components of an evolutionary algorithm arethe codification—with the decoder—and the crossover op-erator. These elements are also present in a genetic algo-rithm, but evolutionary algorithms also allow other ele-ments, for example, improvement procedures. The decoder(Sect. 3.1) has been taken from the literature. The otherthree ingredients are new in EVA and are specifically de-signed or adapted for the RCPSP/max, trying to exploitproblem knowledge. The schedule representation is called

Page 3: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

J Sched (2011) 14:391–406 393

distance-order-preserving activity list (Sect. 3.2), the com-bination operator—in our case a trinary operator—is theconglomerate-based crossover operator CONG (Sect. 3.4)and the improvement procedures are DJmax and DJU(Sect. 3.5).

The outline of EVA is as follows:

Algorithm 1 EVA1. Apply preprocessing procedure2. Generate initial population POP = {L1,L2, . . . ,

LPOPsize}3. POPnew = POP. While no stopping rule is fulfilled:4. For i = 1 to POPsize:

4.1. Randomly select L′ and L′′ from POP4.2. L = CONG(Li;L′,L′′)4.3. S = SGS − U(L)

4.3.1. If S feasible then L∗ = DJU(S)

4.3.2. If S infeasible then L∗ = DJmax(S)

4.4. POPnew = POPnew ∪ {L∗}5. POP = {POPsize best activity lists in POPnew}. Go to 3.6. Return the best solution found

As many other algorithms for the problem, EVA uses apreprocessing phase before actually starting the algorithm.This phase tightens the relationships between activities andcreates new ones which help finding positive cycles andeliminating some resource conflicts. EVA employs the pre-processing algorithm introduced in Neumann et al. (2002),based on the following result: if for a two-element forbid-den set {i, j} with dij > −pj , we have dij > −pj , then itholds that sj ≥ si + pi for each feasible schedule S withsn+1 ≤ d∗. A two-element forbidden set is formed by twoactivities that cannot be scheduled together due to the re-source constraints. The preprocessing consists in finding thetwo-element forbidden sets {i, j} which fulfil those con-straints, and then introducing a time lag between i and j

with lag equal to pi .After applying the preprocessing procedure, the initial

population is generated (Sect. 3.3). At the end of this step,we keep the best POPsize individuals. While the stoppingrules are not fulfilled, we apply the same steps POPsizetimes. First, we randomly select two elements from thepopulation. Then, we apply the crossover operator to thesetwo individuals and to the ith activity list of the popula-tion. After scheduling the outcome of the crossover, weapply one of the improvement procedures, depending onwhether the schedule is infeasible or not. We tried to in-corporate mutation operators between the crossover andthe improvement procedures. For example, one is used inseveral algorithms for project scheduling which switcheswith a certain probability two adjacent activities if theyare not a predecessor and a successor (cf. Hartmann 1998;

Valls et al. 2008). However, they did not add anything to thealgorithm. After obtaining with this loop POPsize new so-lutions, the next population is formed with the best individ-uals calculated so far. Throughout the whole algorithm, inthe construction of the initial population and in step 4.3, theimprovement procedures are applied to every new schedule.At the end of the algorithm, the best solution is returned. Inthe next sections, we introduce different elements that defineEVA, putting emphasis on the three new ingredients.

3.1 Scheduling method: S-SGSU

Given a priority for each activity, the serial generationscheme with unscheduling step (S-SGSU) can be used togenerate a schedule for the RCPSP/max (Neumann et al.2002). S-SGSU proceeds similarly to the Serial SGS forthe RCPSP except when at an iteration an activity can-not be feasibly scheduled due to time lags. In this case,an unscheduling step is invoked. Concretely, at each itera-tion, S-SGSU selects the unscheduled activity j with high-est priority. Then, it calculates the feasible time window[ESj ,LSj ], where ESj and LSj are the earliest and lateststart times for activity j taking into account minimum andmaximum time lags between j and the scheduled activi-ties. Afterwards the earliest start time taking into accountresource constrains t∗ ≥ ESj is calculated. If t∗ ≤ LSj , j

is scheduled in [t∗, t∗ + pj ), and the algorithm continuesto the next iteration. Otherwise, it is impossible to feasiblyschedule activity j in the current partial schedule, and it isnecessary to unschedule some activities. In general, not be-ing able to schedule j occurs because of a maximum timelag, which defines a small LSj . A possible way to obtaina feasible partial schedule consists in finding the set U ofscheduled activities that have led to that particular LSj andincrementing their start time in t∗ − LSj . Furthermore, allscheduled activities with the start time greater than or equalto the minimum start time of activities in U are unsched-uled. At the next iteration, the procedure schedules again theunscheduled activity j with the highest priority. Note thatthe shift of activities of U to the right might leave a spacewhere the unscheduled activities can be scheduled. Usually,a maximum number of unscheduling steps is prescribed. Ifthis maximum number is attained without having obtained afeasible schedule, then S-SGSU outputs an infeasible (com-plete) schedule. Resource constraints are always observed.

3.2 Schedule representation

A distance-order-preserving activity list is a list of all activ-ities L = (i0, i1, . . . , in, in+1) with i0 = 0 and in+1 = n + 1and where the order of the activities in L satisfies the dis-tance order. A given schedule is represented by the distance-order-preserving activity list obtained by ordering the activ-

Page 4: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

394 J Sched (2011) 14:391–406

Fig. 1 Project example

Fig. 2 Two feasible schedules for the project

ities in increasing order of their start time in the schedule.Notice that this representation differs from the precedence-feasible representation used by Franck et al. (2001) becausethey require activities in the same cycle structure to be or-dered one after the other. In our codification, activities fromdifferent cycle structures and activities not belonging to anycycle structure can alternate with each other. This greaterflexibility ensures that for any feasible instance there is al-ways a distance-order-preserving activity list that representsan optimal schedule. In the project depicted in Fig. 1, whichhas only 1 renewable resource, activities 1, 2 and 3 forma structure cycle. The first schedule in Fig. 2 is a feasi-ble solution of the problem. Schedules will be representedthroughout the paper with Gantt diagrams, where the x-axiscorresponds to the time, and the y-axis to the units of theunique resource used. This first schedule in Fig. 2 is theoptimum solution if we keep the structure cycles togetherin an activity list. However, with our codification, activ-ity list (0 1 2 4 3 5) is admitted, and the second scheduleof this figure can be built. The representation also differsfrom the widely used activity list of the RCPSP, a permuta-tion of the activities that fulfils the relations of the originalgraph.

A distance-order-preserving activity list gives a priorityfor the activities, e.g. by the inverse of the position of thelist. Thus, we can apply the S-SGSU described above to suchan activity list and obtain a schedule for RCPSP/max. As inthe RCPSP, the codification is not unique: several codifica-tions lead to the same schedule. Besides, in our case, thesame codifications lead to unfeasible schedules. The feasi-bility of a schedule depends on the concrete list, project net-work and resource constraints. As a result, EVA should beable to work at the same time with feasible and (time) unfea-sible schedules. We define the fitness of an activity list withcorresponding schedule S in the same manner as in Franck

et al. (2001):

f̃ (L) :=⎧⎨

max[T (S), f̃ (L∗)] + ∑i∈V (si − LSi )

+,

if S is unfeasible,T (S), otherwise,

where f̃ (L∗) denotes the fitness of the best feasible individ-ual L∗ found so far, and d∗ if none has been found.

3.3 Initial population

We use the regret-based biased random sampling (Drexl1991) with priority rules LST (latest start time), RSM (re-source scheduling method), LPF (longest path followingfirst) and minimum float—the float calculated taking into ac-count the temporal and resource constraints. Each time theS-SGSU should schedule an activity, the regret-based biasedrandom sampling chooses among the eligible activities withroulette-wheel selection, the slot size of an activity i beingproportional to prior(i) − min{prior(j ), j eligible}, whereprior(j ) is the priority of activity j , and we prefer the activ-ity with highest priority. Each time we create a schedule, wesort the activities in nondecreasing order of their start times.With this process, we obtain a distance-order-preserving ac-tivity list. In the schedules of Fig. 2, the corresponding listswould be (0 1 1 2 3 4 5) and (0 1 2 4 3 5), respectively. Werepeat this process each time we create a schedule, also afterthe crossover or an improvement procedure.

3.4 The conglomerate-based crossover operator

It is the existence of cycle structures which makes it difficultto feasibly solve the problem RCPSP/max. Their importanceis clearly stated by the fact that there is a feasible solutionfor a given instance if and only if feasible (sub)schedules canbe found for all cycle structures (Neumann 1975, Sect. 6.4;Bartusch et al. 1988). Hence, a schedule is feasible if these

Page 5: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

J Sched (2011) 14:391–406 395

activities are well scheduled. Translating this to the codifi-cation space it means that the relative positions of activitiesin a cycle structure are appropriate—at least one of the pos-sible alternatives. One of the aims of the crossover opera-tor we propose is that the children inherit good orderingsof the activities in cycle structures that for the parents ledto good schedules. On the other hand, in a good schedule,the activities in a given cycle structure might be intercalatedamong activities that do not belong to any cycle structureand/or among activities in other cycle structures. All of themform what could be called a conglomerate of cycle struc-tures along with single activities, both in the schedule andin the activity list. Activities that do not belong to any cyclestructure can move more freely inside a schedule if we tryto shift it forwards or backwards, something our improve-ment methods do. However, activities from cycle structuresare more constrained in their movements because minimumand maximum time lags force them. Therefore, it is moredifficult to find good conglomerates, good planning of cy-cle structures in combination with other activities or othercycle structures. Once we have achieved them, it is worth-while trying to combine them and transmit them to the chil-dren. The idea of our crossover is therefore to combine goodcombinations of activities scheduled together from differentsolutions, trying to obtain a better schedule.

Given three activity lists L1, L2 and L3, the conglomer-ate-based crossover operator first obtains and partitionswhat we call conglomerates in L2 and L3, then selects a sub-set of the so-obtained elements and inserts them in L1. Theoutput of the operator is denoted by CONG(L1;L2,L3).The whole procedure is designed so that the output is al-ways a distance-order-preserving activity list. The next sub-sections introduce some concepts and prove some neededresults (Sect. 3.4.1), among them a method to select the el-ements we want to insert so that no contradictions appear(Sect. 3.4.2) and an algorithm to insert those elements in anactivity list (Sect. 3.4.3). With them, we will be able to de-fine the crossover more formally. Section 3.4.4 provides anexample for the whole procedure.

3.4.1 Definition and properties of a conglomerate. Sublists

Definition Given a list L, a conglomerate CG = (a . . . b)

is a sublist of L that fulfils:

(a) If CG contains an activity from a cycle structure, all theactivities from that cycle structure belong to CG.

(b) CG contains at least one activity from a cycle structure.(c) There are no cycle structure CS and no activities i and j

that belong to CS so that i ≺L a ≺L b ≺L j , where ≺L

is the order in L.(d) There is no sublist L′ strictly contained in CG fulfilling

(a), (b) and (c).

Proposition

(1) A conglomerate CG = (a . . . b) begins and ends inactivities belonging to some (possibly different) cyclestructure.

(2) If the project contains a cycle structure, there is at leastone conglomerate.

(3) Two different conglomerates are disjoint.

Proof

(1) Let us suppose that CG = (a a2 . . . b2 b) begins (ends)in an activity not belonging to some cycle structure. Weconsider CG′ = (a2 . . . b2 b) (CG = (a a2 . . . b2)).We have that CG strictly contains the sublist CG′ =(i . . . j ). It is easy to see that CG′ fulfils conditions(a)–(c) from the definition of conglomerate. However,this means that CG does not fulfil condition (4), whichis a contradiction.

(2) If the project contains a cycle structure, the (whole) listL fulfils conditions (a)–(c) from the definition of a con-glomerate. If L does not fulfil condition (d), we canerase activities from the beginning or/and the end of thelist until we find a sublist L′ that fulfils condition (d).L′ is then a conglomerate.

(3) Let us suppose that CG1 and CG2 are different butCG1 ∩ CG2 �= ∅. CG2 cannot be a subset of CG1 be-cause of the conglomerate condition (d) of CG1. There-fore, CG2\CG1 �= ∅. Let us see that CG2\CG1 fulfilsconglomerate conditions (b)–(d). Without loss of gen-erality, we can write CG1 = (a1 . . . b1) and CG2 =(a2 . . . b2) with a2 ∈ CG1, b2 �∈ CG1 and a2 �= a1. Ac-tivity b2 ∈ CG2\CG1 because b2 ∈ CG2 and b2 �∈ CG1.Besides, since CG2 is a conglomerate and thanks to part(1) of the proposition, b2 must belong to a cycle struc-ture. So, CG2\CG1 fulfils conglomerate condition (b).We can write CG2\CG1 = (a′

2 . . . b2). The nonfulfil-ment of the conglomerate condition (c) would lead tothe existence of a cycle structure k and activities i andj such that i ≺L a′

2 ≺L b2 ≺L j . So, j �∈ CG2. Butthis, in addition to the conglomerate condition (a) ap-plied to CG2, means that i �∈ CG2. As a result, i ≺L

a2 ≺L b2 ≺L j , but this contradicts the conglomeratecondition (c) applied to CG2. Thus, CG2\CG1 fulfilsthe conglomerate condition (c). Finally, CG2\CG1 ful-fils the conglomerate condition (d) because CG2 accom-plishes it. Summing up, CG2\CG1 is not a conglomeratewhich meets conglomerate conditions (b)–(d). We canconclude that the conglomerate condition (a) fails andthat there exist a cycle structure k and activities i and j

belonging to this cycle structure so that j ∈ CG2\CG1

and i �∈ CG2\CG1. Since CG2 is a conglomerate andj ∈ CG2, we have that i ∈ CG2, but this means thati ∈ CG1. However, j �∈ CG1, and we end up with ac-tivities i and j belonging to the same cycle structure so

Page 6: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

396 J Sched (2011) 14:391–406

Fig. 3 A graph with two cycle structures

that i ∈ CG1 and j �∈ CG1. This contradicts the fact thatCG1 is a conglomerate.

Example There are two cycle structures in the graph de-picted in Fig. 3, {1, 5, 9} and {3, 4}. The following activitylists show different possibilities regarding conglomerates.

• L1 = (0 2 6 7 8 1 3 4 5 9 10); the only conglomerate isCG1 = (1 3 4 5 9) which contains the two cycle structures.There are activities which do not belong to the conglom-erate.

• L2 = (0 1 2 5 7 9 6 3 4 8 10); there are two conglomerates,CG1 = (1 2 5 7 9) and CG2 = (3 4).

• L3 = (0 1 2 6 8 7 3 4 5 9 10); the whole list is a conglom-erate.

Once we have defined the conglomerates, we should beable to find them easily; otherwise the crossover would betoo costly. Fortunately, we can produce an algorithm to cal-culate them. This procedure has complexity O(n) becausewe only visit each activity once. Its speed contributes to thesmall average time of EVA (see Sect. 4). The outline of thealgorithm is as shown in Algorithm 2.

nCS is the number of cycle structures CS1, CS2, . . . ,

CSnCS. VCS is the set of the activities belonging to some cy-cle structure. The algorithm goes through the activity list,beginning with position i = 0. At the end of the algorithm,it will have found the initial and final position of every con-glomerate in the list. While the procedure does not find anactivity from a conglomerate, it simply advances through thelist (step 2.1.1). When the first one, L(i), is found, the proce-dure calculates the conglomerate which begins in L(i). Todo that, it makes a note of the following data (step 2.1.4):

Algorithm 2 Calculation of conglomerates1. i = 0, insideCON = 0, CSinCON = ∅, nCON = 0. L(i),the activity in position i.2. While (i < n) do

2.1. If (insideCON = 0) then2.1.1. While ((L(i) �∈ VCS) and (i < n)) do i = i + 1.

Endwhile2.1.2. If i = n then return.2.1.3. Let j be the number of cycle structure to which

L(i) belongs.2.1.4. insideCON = 1, CSinCON = {j}, nCON =

nCON + 1,begCON(nCON) = {i}.Endif

2.2. If (insideCON = 1) then2.2.1. While (L(i) �∈ VCS) do i = i +1. Endwhile2.2.2. Let j be the number of cycle structure to which

L(i) belongs, CSj = CSj\{L(i)}.2.2.3. If (j �∈ CSinCON) then CSinCON = CSinCON∪

{j}. Endif2.2.4. If (CSj = ∅) then CSinCON = CSinCON\{j}.

Endif2.2.5. If (CSinCON = ∅) then endCON(nCON) = {i},

insideCON = 0. Endif2.2.6. i = i + 1.Endif

Endwhile

insideCON = 1 to indicate that it is inside a conglomer-ate; CSinCON = {j} to know that the cycle structure j con-tains at least one activity, but not all; nCON = nCON + 1to indicate that the number of conglomerates is increased;begCON(nCON) = {i} to mark the beginning of the con-glomerate. There is a second part of instructions of the al-gorithm that begins when insideCON = 1 (loop 2.2). ThereL(i) ∈ VCS, and the algorithm temporarily eliminates the ac-tivity from the cycle structure and includes that cycle struc-ture into the set of cycle structures belonging to the cur-rent conglomerate and in construction. When CSj = ∅, allthe activities from that cycle structure already belong tothe conglomerate in construction, and we can eliminate thecycle structure j from the cycle structures in construction(CSinCON = CSinCON\{j}). CSinCON = ∅ indicates thatall the activities from the involved cycle structures are al-ready in the conglomerate, and we can finish the conglom-erate.

With this algorithm, we can calculate the conglomeratesfrom any activity list that can be afterwards inserted into an-other activity list. However, in the first preliminary tests, itwas soon detected that the crossover based only on conglom-erates had two drawbacks. The first one is that sometimesthe conglomerates are too lengthy. These conglomerates aretransmitted from a list to a list, leading to rapid stagnationof the population. The second disadvantage comes from sub-

Page 7: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

J Sched (2011) 14:391–406 397

lists in the activity list with no conglomerates. These partsdo not contribute, in general, to the feasibility of the solu-tion, but they might play an important role in its makespan.If only the conglomerates can be inherited by the children,the procedure cannot take advantage of the good combina-tions of the other activities that appear thanks to randomnessor the good work of improvement procedures. Our solutionto these problems has been to divide the conglomerates andto allow these divisions to be inherited. Besides, we allowactivities not belonging to conglomerates to be transmitted.To do that, we introduce the concept of a partition based onconglomerates.

Definition Let L be an activity list. A partition of L intosublists is based on conglomerates if:

• The union of sublists forms L

• The sublists are disjoint, and

each sublist fulfils one of the following conditions:

• The sublist does not contain activities from cycle struc-tures

• The sublist is completely contained in a conglomerate

Example We consider the cycle structure {4, 2} and activitylists A = (0 1 7 5 4 3 2 6 8) and B = (0 1 3 4 5 7 2 6 8).The unique conglomerates in A and B are (4 3 2) and (4 57 2), respectively. One partition of A is (0 1 7 5), (4 3), (2)and (6 8), with four sublists. Another partition is (0 1 7 5),(4 3 2) and (6 8), with three sublists. One partition of B is(0 1 3), (4 5), (7 2) and (6 8), with four sublists. Anotherpartition is (0 1 3), (4 5 7 2) and (6 8), with four sublists.

Although the sublists transmitted from parents to chil-dren are not necessarily conglomerates, the crossover is stillbased on this concept, and therefore we will continue withthe name of conglomerate-based crossover operator.

In EVA, the partition of an activity list is done every timethe crossover is applied, by dividing the list randomly buttaking into account the conditions of the definition and alsothat the length of the sublist lies between 3 and 30. Thesenumbers have been chosen so that small conglomerates willbe most of the times inside a sublist. Besides, sublists with1 or 2 activities do not make much sense, and bigger con-glomerates lead to too similar children.

3.4.2 Selection of sublists to insert

Once the calculations of the different sublists of the two par-ents have been made, there is a set of sublists from whichwe want to select a subset that can be introduced into a list.This subset should fulfil several restrictions to assure thatthe final outcome is a distance-order-preserving activity list.Therefore, the selection is not straightforward. For instance,

the elements of the subset should be disjoint. Otherwise, wewould end up with a list of activities with twice the same ac-tivity. Or we would have to erase the common activity fromone or several sublists, and this would distort them becausea sublist is a set of activities scheduled together. To selecta suitable subset, we need the following definitions and re-marks. They are taken from Ballestín (2002).

Definition 1

• A (mountain) range is a set of disjoint sublists.• A list L contains a range if all the activities of every sub-

list SLi belonging to the range occupy consecutive posi-tions in L and in the same order as in SLi .

• The graph associated to a range C,G(C), is a directedgraph obtained from the precedence graph PG by con-densing the nodes corresponding to each sublist in a nodecalled supernode.

The name of a (mountain) range comes from the originof the definition. In the RCPSP, a sublist of activities with ahigh level of resource consumption when scheduled togethercan be detected as a peak in the resource profile. Hence, theywere called peaks in Ballestín (2002), and sets with suchsublists were called (mountain) ranges. Although now theconcept is different, we still work with sublists and sets ofsublists, and we will therefore keep the name.

The graph associated to a range C, G(C), is usuallyformed by simple nodes, activities that do not belong to anysublist of C, and by supernodes. If we consider two nodesof G(C), the notation i → j in G(C) indicates that i is animmediate predecessor of j . The directed arcs in G(C) aredefined in a natural way from the existing relations in PG:(a) if i and j are simple nodes, i → j in G(C) if this alsohappens in the precedence graph; (b) if i = I is a supernodeand j a simple node, then I → j in G(C) if ∃h ∈ I such thath → j in PG; (c) if i is a simple node and j = J a super-node, then i → J in G(C) if ∃h ∈ J such that i → h in PG;(d) if i = I and j = J are supernodes, then I → J in G(C)

if ∃r ∈ I , s ∈ J such that r → s in PG.

Example In Figs. 4 and 5, two graphs are depicted. Therange in the two cases is formed by two activities sets, C1

and C2. In the first case, we can see the three types of rela-tionships of the graph associated to a range. Since activity 1is a predecessor of activity 2 which belongs to C1, there is arelationship between 1 and the supernode C1 in G(C). Thereis another relationship between the supernode C2 and activ-ities 8 and 11 in G(C) because they are successors of activ-ities 7 and 10, respectively, both belonging to C2. Betweenactivities from C1 and C2 there is only one arc from activity4 to 7. Therefore, in G(C), C1 is a predecessor of C2. Inthe second graph, there are two arcs between activities from

Page 8: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

398 J Sched (2011) 14:391–406

Fig. 4 Graph and G(C) withC = {C1,C2}

Fig. 5 Graph and G(C) withC = {C1,C2}

both sets of activities, activity 1 ∈ C1 is a predecessor of ac-tivity 3 ∈ C2 and activity 2 ∈ C2 is a predecessor of activity4 ∈ C1. This leads, respectively, to a relationship from C1 toC2 and another from C2 to C1 in G(C). If we have to fulfilthe relationships, it is easy to come up with activity lists forG(C) in the first example. However, it is impossible to do itin the second case because there is a cycle.

So, it seems clear that if two or more sublists (supern-odes) are in a cycle in G(C), there cannot exist an activitylist L that contains C. Otherwise, temporal relations wouldnot hold. Since at the end we want to build distance-order-preserving activity lists, we will have to look for ranges C

that generate G(C) without cycles. They will be called suit-able ranges.

Definition A range C is called suitable if G(C) is acyclic.

Our goal is to introduce a graph with the sublists asnodes, where an arc between two nodes indicates that wecan choose the successor if we have already selected the pre-decessor. This graph will be called the graph of sublists.

Definition

1. Let SL = {SL1, SL2, . . . ,SLp} be a set of sublists.1.1 If SLa and SLb are two sublists from SL, we will say

that SLa is a predecessor of SLb if ∃i ∈ SLa , j ∈ SLb

such that i → j in PG.1.2 SLa and SLb are independent if SLa is not a prede-

cessor of SLb and vice versa.

2. The graph of sublists G(SL) is a directed graph associ-ated to SL where there is a node for each sublist of SL andsuch that there is a directed arc from sublist SLa ∈ SL tosublist SLb ∈ SL if and only if SLa ∩ SLb = ∅ and SLb isnot a predecessor of SLa .

Given two sublists SLa and SLb of SL, three different pos-sibilities can occur:

(a) If SLa ∩ SLb �= ∅ or if SLa is a predecessor of SLb andSLb is a predecessor of SLa , then there is no arc betweenthem in G(SL).

(b) If SLa ∩ SLb = ∅, SLa is a predecessor of SLb , but SLb

is not a predecessor of SLa , then there is a directed arcfrom SLa to SLb in G(SL).

(c) If SLa ∩ SLb = ∅ and SLa and SLb are independent, thenthere are both a directed arc from SLa to SLb and a di-rected arc from SLb to SLa in G(SL).

Example In Fig. 6, a graph with four sets of activities andthe corresponding graph of sublists are depicted. C2 and C4

have activity 4 in common. Therefore, they are not disjointand do not have an arc between them in G(SL). C1 has ac-tivity 1, which is a predecessor of activity 5, which belongsto C3. Since these sets of activities do not have activities incommon and there are no more relationships between them,if we select C1, we can afterwards select C3. However, if wehave selected C3, we cannot schedule C1 afterwards. There-fore, we only introduce a relationship between C1 and C3 inthe graph of sublists. The same occurs between C1 and C4,although the predecessor is not a direct one—activity 1 is apredecessor of 4 but not a direct one. C1 and C2 do not have

Page 9: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

J Sched (2011) 14:391–406 399

Fig. 6 A project and the graphof sublists G(SL)

activities in common. Furthermore, neither one is a prede-cessor of the other. Thus, we can select one when we havealready selected the other. Finally, C2 is a predecessor of C3.Hence, we add relationships from C1 to C2 and from C2 toC1. A completely different example would come up if wewere to use the graph and sets of activities of Fig. 5. SinceC1 is both a predecessor and a successor of C2, we couldnot select it before or after selecting C2. Therefore, we can-not introduce arcs between them, and we obtain a graph ofsublists with two nodes and no arcs.

Once this graph has been defined, we are in the posi-tion to select a suitable range C with the next algorithmwhich uses the notation �+(SLa) = {SLb ∈ SL/SLa → SLb

in G(SL)}.

Algorithm 3 Selection of suitable rangeLet SL = {SL1, SL2, . . . ,SLp} a set of sublists.C := ∅,D = SL.While D �= ∅, do

Select a sublist SLa ∈ D and do C = C ∪ {SLa}.D = D ∩ �+(SLa).

EndwhileReturn C.

Result (Ballestín 2002) Every time when the first step ofthe while in the algorithm is performed, the outcome set C isa suitable range. In particular, the returned set C is a suitablerange. Furthermore, this algorithm is capable of finding eachmaximal suitable range (not included in a bigger suitablerange).

The returned ranges depend on the selection rule. In thiswork, we have opted for choosing the next sublist randomly.

Example In the graph of sublists of Fig. 6, if we first selectC1, all the other sublists are eligible, since C1 has relation-ships with all of them. If we then select C2, sublist C4 isno longer available for the next step, since there are no re-lationships between them. However, we still can select C3.Once we have selected this sublist, we have, thanks to Re-sult, a suitable range. Moreover, C = {C1,C2,C3} is a max-imal suitable range. Note that if we first select C4, the other

sublists are deleted, since there are no relationships from C4

to any of them. C = {C4} is obviously not maximal, but thisfeature only adds diversity to the outcomes of the crossover.Since we are going to apply it many times, this characteristicis essential.

The last aspect to consider is the time needed to selectthe sublists to insert. The number of operations of this sub-procedure—Algorithm 2+3—heavily depends on the num-ber of sublists. As the length of the sublist lies between 3 and30, there are few sublists per activity lists. Since we onlyconsider sublists from two lists, the number of sublist wework with is not very big. Furthermore, we do not need tocalculate the relationships between all pairs of sublists. Weonly have to calculate the relationship between the chosenSLa at each selection iteration of Algorithm 3 and sublistsfrom D, each time a smaller set.

3.4.3 Insertion of suitable range in an activity list

We recall that, if we have a suitable range, we can build fromit one or several distance-order-preserving activity lists. Inthe last step of the operator, we need a procedure to dothat. The next algorithm inserts a feasible set of conglomer-ates/sublists into a given distance-order-preserving activitylist L. The output is another distance-order-preserving ac-tivity list L′. The following notation is needed. L′ is the re-sulting activity list when the set of sublists has been insertedinto L; SL1, SL2, . . . ,SLq are the ordered sublists in the suit-able range; p(SLi ) is the position of the sublist according toL, i.e. the minimum of the positions that activities of SLi oc-cupy in L; Pred(SLi ) is the list of activities predecessors ofactivities in SLi , ordered according to L; Pred(SLi; j) is theactivity that occupies the j th position in the list Pred(SLi ).

The algorithm inserts each sublist SLi as close as possibleto each position in L, p(SLi ). To fill the places until thosepositions, activities from L that do not belong to any sublistare placed one after another in the order of L. The last pointto take care of is to insert predecessors of a sublist beforethe sublist, but only those predecessors that have not beenalready inserted.

Concerning the order of the algorithm, we just introduceeach activity in the list once. We also have to consider every

Page 10: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

400 J Sched (2011) 14:391–406

Algorithm 4 Insertion of suitable range in an activity list

L′(0) = 0.

Do h = 1.

For i = 1 until q , doFor j = h until n, j < p(SLi ), do L′(h) = L(j) and h =

h + 1.

EndforFor j = 1 until |Pred(SLi )|, do

If Pred(SLi; j) has not been inserted, then L′(h) =Pred(SLi; j) and h = h + 1.

EndforFor j = 1 until |SLi |, do L′(h) = SLi (j) and h = h + 1.

EndforEndforFor j = 1 until n, do

If L(j) has not been inserted, then L′(h) = L(j) and h =h + 1.EndforL′(n + 1) = n + 1.

predecessor of activities of each sublist, and this is boundedby m, the number of arcs. Hence, the algorithm is of com-plexity O(n + m). This linear order contributes to the smallaverage time of EVA (see Sect. 4).

A final remark about the crossover operator must bemade. In general, from a given set of individuals, notall distance-order-preserving activity lists can be achieved

through this combination method. However, the improve-ment procedures explained in the following section changea schedule, shifting single activities in and out from con-glomerates, widening or shortening the distance inside aconglomerate or changing the scheduling order of its ele-ments, etc. Since every time we create a schedule we createa codification that inherits its features, we come up withnew codifications, new conglomerates, and at the end newoutcomes when the operator is applied.

3.4.4 Example for the whole procedure

Schedules (a), (b) and (c) in Fig. 7 are feasible for theproject depicted in Fig. 3. Their corresponding distance-order-preserving activity lists are L1 = (0 1 2 3 4 5 6 9 78 10), L2 = (0 1 2 6 3 4 5 8 7 9 10) and L = (0 2 6 17 8 3 4 5 9 10), respectively. We are going to revise thedifferent steps of the procedure described in the previoussections by applying the conglomerate-based crossover op-erator to L1, L2 and L. First of all, as we have commentedabove, the cycle structures of the project are {1,5,9} and{3,4}. Hence, the conglomerates of L1 are C1 = (1 2 3),C2 = (4 5 6 9) and C3 = (7 8), and the conglomerates ofL2 are C4 = (1 2 6 3) and C5 = (4 5 8 7 9). The set ofsublists from which we have to select a suitable range is{C1,C2,C3,C4,C5}. In the next step of the combinationmethod, we create the graph of sublists, depicted in Fig. 8(a).

Fig. 7 Schedules for exampleof Sect. 3.4.4

Page 11: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

J Sched (2011) 14:391–406 401

Fig. 8 Graph of sublists andG(C) in example of Sect. 3.4.4

Fig. 9 Example of DJmax

To select a suitable range, we just have to follow Algo-rithm 3 described in Sect. 3.4.2: if we first select C1, theeligible sublists are C2, C3 and C5. If we then select C5, noother sublist is eligible, and we obtain a maximal suitablerange C = {SL1 = (1 2 3), SL2 = (4 5 8 7 9)}. In the finalstep of the crossover, we apply Algorithm 4 of Sect. 3.4.3 to-gether with L. In our case, p(SL1) = 1 because the positionof activity 2 is 1 in L (the position of 0 is taken as 0), andp(SL2) = 4 because of the position of 7 in L. Pred(SL1) = ∅(excluding 0), but Pred(SL2) = 6, since 6 is a predecessorof 8 ∈ SL2. Since p(SL1) = 1, the first part of the new listL′ is SL1, L′ = (0 1 2 3 ?). The next position to fill is thefourth position, and we would have to insert SL2, given thatp(SL2) = 4. However, not all predecessors from activitiesfrom SL2 have been inserted because activity 6 ∈ Pred(SL2)

is not included in L, yet. So, we must include it in L′, andthen we can insert SL2, obtaining L = (0 1 2 3 6 4 5 8 7 9 ?).There are no real activities left, and the final outcome of thecrossover is a distance-order-preserving activity list, L′ = (01 2 3 6 4 5 8 7 9 10). If we look at G(C) in Fig. 8(b), L′ wasthe only activity list we could create from C, no matter L. Ifwe apply our decoder S-SGSU to L′, we obtain the optimalschedule of Fig. 7(d).

3.5 Improvement procedures: DJmax and DJU

In a recent study, Valls et al. (2005) showed that the dou-ble justification (DJ) is a simple technique that can be easily

incorporated into many diverse RCPSP algorithms, increas-ing significantly the quality of the obtained schedules with-out spending more computing time. We have adapted DJ tothe RCPSPmax, creating DJmax. Given a resource feasibleschedule S and an activity j , we can calculate the feasibletime window [ESj ,LSj ], where ESj and LSj are the earliestand latest start time for activity j taking into account mini-mum and maximum time lags between j and the other activ-ities. If sj > LSj (ESj > sj ), then S is infeasible, and, in thatcase, the justification to the right (left) of j does not move j .Otherwise, to justify an activity j �= n(1) to the right (left)requires obtaining a schedule S′ such that s′

i = si , i �= j , ands′j is as large (small) as possible. The following inequali-

ties then hold: ESj ≤ sj ≤ s′j ≤ LSj (ESj ≤ s′

j ≤ sj ≤ LSj ).The resource restrictions are (also) taken into account whenj is shifted to the right (left). The double justification of aschedule S, DJmax(S), is the schedule obtained after firstjustifying to the right the activities of S in decreasing orderof their finish times and then, justifying to the left the activ-ities of the resulting schedule S′ in decreasing order of theirstart times in S′. DJmax(S) depends on the tie-breaking ruleused. In this paper, we assume that the tie-break rule is tochoose the activity with the smallest activity label. If S isfeasible, then DJmax(S) is feasible. Otherwise, the level ofinfeasibility of the schedule might decrease. At any rate, theresulting schedule is no longer than S. Let us see an exam-ple.

Page 12: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

402 J Sched (2011) 14:391–406

Fig. 10 Project and initial schedule in the first example of DJU

Fig. 11 Intermediate schedules in the first example of DJU

The first schedule S in Fig. 9 is feasible for the projectdepicted. Activities 6 and 4 cannot be shifted because of aminimum time lag with activity 7 and 6, respectively. Thefeasible time window for activity 3 is [6,13]. However, thereare not enough resources available to shift the activity evena time unit. Activity 2 cannot be shifted to the right becauseof the maximum time lag with activity 1, which at the sametime cannot be moved because of its minimum time lag withactivity 2. The only activity which can be moved is activ-ity 5, whose time window is [2,12]. We justify it to [12,16],obtaining the second schedule of Fig. 9. When justifying tothe left, activity 4 can be shifted to [2, 5], which leaves a holethat is afterwards occupied by activities 5 and 6. At the end,DJmax(S) is the final schedule shown in the figure, 3 unitsshorter than S. The corresponding distance-order-preservingactivity list is (1 4 2 3 5 6).

One drawback of DJmax can be seen in this example.DJmax is completely unable to shift activities that belongto cycles of zero length, and, in general, it has difficultiesto move jobs in cycles of short length (because of resourceconstraints). To overcome this, we propose the double justi-fication with unscheduling (DJU). DJU differs from DJmaxin the following. When in each iteration DJU justifies an ac-tivity, it is required that the resource constraints are satisfiedand that the temporal constraints are satisfied, but only withrespect to the already justified activities. So the schedule ob-tained after the justification of an activity can be infeasible.However, the justification of the rest of the activities mightlead to a feasible schedule. If it is impossible to justify anactivity in such a way that the temporal constraints are sat-isfied with respect to all already justified activities, then anunscheduling step quite similar to the one invoked in SGSUis applied. Let us see a couple of examples.

Fig. 12 Final schedule in the first example of DJU

Figure 10 shows a project and a feasible solution S for it.Activities 5 and 7 form a cycle structure. If we apply DJmaxto S, activity 7 cannot be shifted to the right because of themaximum time lag between 5 and 7. However, in DJU thisrelation is not taken into account because activity 5 has notbeen scheduled when activity 7 is considered. So, activity 7is moved to [13,16], obtaining unfeasible schedule S′, thefirst in Fig. 11. However, we can afterwards justify activity5 to [9,13], leading to a feasible solution, the second solu-tion in Fig. 11. When we justify to the left, we can obtain animprovement thanks to the movement of activity 4 and pos-terior movements of 5, 6 and 7. The final solution (Fig. 12)is 3 times shorter than S. The corresponding distance-order-preserving activity list is (1 2 3 4 5 6).

We consider the solution S in Fig. 13, feasible for theproject depicted. Activities 1 and 5 form a cycle structure.When DJU justifies activity 5 to the right, it can be shiftedtill [8,10] because the maximum time lag with activity 1 isnot taken into account—Djmax would not be able to move it.When the turn of activity 1 comes, it can only be advancedto [2,4], obtaining the unfeasible schedule S′ of Fig. 14. So,in this case, the posterior justification of activities has notsolved the arisen unfeasibility, and an unscheduling step isneeded. In this case, the t∗ where we have scheduled activity1 is 2, and ES1 = 4 (ES1 = s5 −4). Hence, we must diminish

Page 13: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

J Sched (2011) 14:391–406 403

Fig. 13 Project and initial schedule in the second example of DJU

Fig. 14 Intermediate and final schedule in the second example of DJU

the start time of 5 in 4 − 2 = 2 units, scheduling it in [6,8].This time, when we schedule activity 1, we can still scheduleit in [2,4], obtaining the second solution of Fig. 14, feasibleand two time units shorter than the original one.

Improvement procedures are usually some of the mostcomputationally demanding procedures of an algorithm. Inthis case though, applying DJmax and DJU cost the sameas S-SGSU because they are based in scheduling activitiesas soon (or as late) as possible, taking into account resourcerestrictions and time lags. Perhaps the only important differ-ence between DJ and the decoder is that DJ needs to orderthe activities according to their start or finish times. How-ever, this ordering can be done in O(n), as shown in page136 of Ballestín (2002). Therefore, DJ does not add com-plexity to EVA. In fact, as it will be proved in the next sec-tion, the algorithm without DJ spends the same average timeas with it.

4 Experimental performance analysis

In this section, we present the results of the computationalstudy concerning the algorithm EVA and compare it to thestate-of-the-art heuristic algorithms. The experiments havebeen performed on a Samsung X15 Plus portable computerwith Pentium M processor with 1400 MHz clock speed and512 MB RAM, equipped with Windows XP. The algorithmhas been coded in C. We have set the value POPsize = 50.EVA terminates if at least one of the following stoppingrules is met: all individuals have the same fitness, 5000

Table 1 Effect of double justification on EVA (UBO set)

pfeas devLB tcpu

EVA without DJ 100.00% 5.60% (5.57%) 0.37 s

EVA with only DJmax 100.00% 5.00% (4.96%) 0.39 s

EVA 100.00% 4.82% (4.79%) 0.38 s

schedules have been evaluated, or the best feasible sched-ule has not been improved within 10 generations. All ourresults will be based on five runs of the correspondent algo-rithm version. The results are based on two benchmark testsets. The first one, UBO100, consists of the 360 instances ofsize n = 10, 20, 50 and 100 used in Franck et al. (2001).The second test set, CD, consists of 1080 instances with100 activities used in, e.g. Schwindt (1996), Dorndorf et al.(2000) and Cesta et al. (2002). The following notation willbe used in the tables: pfeas is the percentage of feasible in-stances where an algorithm has found a feasible solution;devLB denotes the average deviation with respect to somelower bound; tcpu stands for the average CPU time; Nopt

marks the number of instances where it can be assured thatthe optimum solution has been found by the algorithm. Theaverage time of algorithms of other papers linearly scaled bythe speed of the microprocessor will be denoted by “scaledtcpu”. We provide the average quality of the five runs of ourversions and, in parentheses, the best average deviation. Re-garding the CPU, the figure denotes the average over the fiveruns.

Page 14: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

404 J Sched (2011) 14:391–406

Table 2 Effect of population size

pfeas devLB tcpu

EVA POPsize = 24 100.00% 5.03% (4.97%) 0.18 s

EVA POPsize = 100 100.00% 4.86% (4.79%) 0.56 s

EVA POPsize = 200 100.00% 5.05% (5.01%) 0.79 s

EVA 100.00% 4.82% (4.79%) 0.38 s

In Table 1, we analyse the effect of the improvement pro-cedures. All different versions obtain all feasible solutionsand need approximately the same average time. Regardingthe solution quality, the inclusion of DJmax leads to an av-erage improvement of 0.6%, whereas the use of DJU dimin-ishes the deviation by almost 0.2%. Hence, both types ofjustification help finding better solutions.

Table 2 studies the variation in the size of the popula-tion. Both the quality and especially the average time worsenwhen the population size is increased. It is worth notingthat EVA with a population of 24 individuals is a goodalternative to the standard version. The reason for the in-crement in time lies in the stopping criteria we have in-cluded; our good choice of them contributes to the speedof EVA. The larger the population, the more diverse it is.Hence, the stagnation of the algorithm occurs later or doesnot happen at all, and the procedure finishes when the limitin the number of schedules is reached. For example, the per-centage of instances where the evolutionary algorithm findsa population with all individuals with the same fitness isnearly 60% when POPsize = 24 and slightly more than 50%when POPsize = 50. However, this figure reduces to 33% ifPOPsize = 100 and to 15% if POPsize = 200. Accordingto our results, an early convergence is preferred if we limitthe number of solutions, but to a certain extension. Anotherlimit would ask for another population size, as it happens inother similar population-based algorithms (e.g. Valls et al.2008), and an increase in the limit of solutions and popula-tion lead to a better quality average. In our case, if we omitthe rest of stopping criteria, changing to 10,000 schedulesand a population of 100 schedules means an improvementof almost 0.4% in the set of instances with 100 activities.

Table 3 shows the comparison in the UBO set with differ-ent heuristic algorithms. They were run on a personal com-puter with Windows NT 4.0 and 333 MHz, except in the caseof the Ant Colony Optimization ACO algorithm (Luo et al.2003). If we suppose a linear relationship between CPU andspeed of the algorithms, EVA is only slower than the di-rect method, a procedure which only calculates 5 priorityrules, but it is faster than the more elaborate heuristics (ex-cept the ACO algorithm). We do not have information aboutthe speed of the ACO algorithm, although it also calculates amaximum of 5000 schedules, like EVA. Furthermore, EVAclearly outperforms all algorithms in the average deviation.

Table 4 contains the information of several algorithmsin the CD set. It has been taken from Cicirello (2003),Cesta et al. (2002) and Smith (2004). B&BdRH is a Branchand Bound procedure by De Reyck and Herroelen (1998),B&BF98 is a B&B based on dynamic release dates (Festet al. 1998); B&BS98 is another B&B by Schwindt (1998).B&BD98 is a time-oriented B&B by Dorndorf et al. (2000)that exploits resource constraint propagation rules. All theseexact algorithms are used as heuristic algorithms by limitingthe available time. Regarding “pure” heuristic algorithms,PRFNS5 calculates five priority rules and takes the best so-lution of the 5 (Franck et al. 2001). The results shown werecalculated in Cicirello (2003). PRFN10 is similar to PRFNS5,but it calculates 10 solutions (Franck and Neumann 1998);the results were shown later in Dorndorf et al. (2000). ISESstands for iterative sampling earliest solutions (Cesta et al.2002), KDE[N ] is an iterative priority-rule method whichuses kernel density estimates (Cicirello and Smith 2004).SWO is an algorithm based on the squeaky wheel optimiza-tion (Smith 2004). Finally, C-Best calculates the informa-tion using the best solution for all algorithms except SWOin every instance.

EVA outperforms all the other algorithms in terms of de-viation with respect of the lower bound. It is worth not-ing that EVA obtains approximately the same deviation asC-Best. So, the rest of the algorithms together, excludingSWO, cannot beat EVA. The number of optimal solutionsfound by the algorithms is not comparable because, in thecase of heuristic algorithms, a solution can be assured tobe optimal if it coincides with the published lower bounds.

Table 3 Comparison withheuristics in Neumann et al.(2002) and ACO (UBO set)

pfeas devLB tcpu Scaled tcpu

Filt. beam search 99.66% 6.82% 12.40 s 2.95

Direct meth. 100.00% 10.74% 0.03 s <0.01

Genetic algorithm 100.00% 6.92% 3.16 s 0.75

Tabu search 100.00% 8.45% 30.0 s 7.14

ACO 100.00% 5.99% – –

EVA 100.00% 4.82% (4.79%) 0.38 s 0.38

Page 15: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

J Sched (2011) 14:391–406 405

Table 4 Comparison withseveral exact and heuristicalgorithms (CD set)

CD set devLB Nopt pfeas

ISES 7.95 (7.34) 669.8 (683) 99.9 (100)

B&BdRH – 606 1009/1059

B&BF98 7.0 768 100

PRFN10 7.7 601 1053/1059

PRFNS5 6.5 603 991/1059

B&BS98 6.9 684 100

B&BD98 4.6 774 100

KDE[1000] 4.7 (4.5) 670.3 (683) 1054.7/1059 (1057/1059)

KDE[2000] 4.6 (4.4) 675.7 (689) 1057/1059 (100)

Tabu search 5.8 593 100

Genetic algorithm 5.3 634 100

Simulated annealing 5.7 630 100

C-Best 3.3 789 100

SWO 6.8 680 100

EVA 3.24 (3.16) ≥712 100

Table 5 Average speed orlimitation of the differentalgorithms

Algorithm Limit tcpu Scaled tcpu Computer

ISES 100 s 41 s 7.79 Sun UltraSparc 30 266 MHz

B&BS98, B&BF98, B&BD98 100 s – – Pentium 200 MHz

KDE[1000] – 5.8 1.24 Sun Ultra 10 (300 MHz)

KDE[2000] – 11.2 2.40 Sun Ultra 10 (300 MHz)

SWO 1.85 2.25 Pentium 4 (1700 MHz)

TS, GA and SA 5000 schedules – – Pentium 333 MHz

EVA 5000 schedules 0.62 0.62 PentiumM processor 1400 MHz

Table 6 Comparison with thetruncated B&B of Dorndorfet al. (2000) (CD set)

tmax tcpu pfeas Nopt devLB

Time 3 1.3 99.7 715 5.2

Oriented 30 9.4 100.00 760 4.8

B&BD98 100 29.7 100.00 774 4.6

EVA – 0.62 100.00 ≥712 3.25

However, the exact algorithms are capable of proving thatmany other solutions they have found are optimal. At anyrate, EVA finds more optimal solutions than the rest of“pure” heuristic algorithms and than a couple of B&B’s. TheCPU time of some of the algorithms of Table 4 can be seen inTable 5. According to these values, EVA seems to be fasterthan the rest of the algorithms. One of the reasons is that thelimit of several algorithms is 100 s.

The best state-of-the-art algorithm until now (with KDE)was B&BD, a special comparison with which is includedin Table 6. The value tmax stands for the maximum CPUtime allowed. We can see how the quality of that algorithmincreases with time. The computer used is a PC PentiumPro/200. The version with a deviation of 1.3 seems slightly

faster than EVA if we continue with the linear relation. Nev-ertheless, the other two versions of B&BD98 appear to beslower and are of worse quality than EVA on average. Allversions are able to check that they have found more opti-mal solutions than EVA, but again this is because they areexact methods.

5 Concluding remarks

The RCPSP/max is a generalisation of the classic RCPSPthat can be applied to many more practical situations. Themaximum time lags lead to cycles in the project network,something that leads to a greater difficulty. EVA is an evo-

Page 16: An evolutionary algorithm for the resource-constrained project scheduling problem with minimum and maximum time lags

406 J Sched (2011) 14:391–406

lutionary algorithm specially designed to this problem. Theanalysis of the results indicates that EVA yields the lowestaverage deviation from the lower bound. Besides, EVA ob-tains feasible schedules in all feasible instances. The rea-son for the quality of the procedure lays on the use of sev-eral new techniques that try to exploit problem-based knowl-edge: (a) a suitable codification that does not exclude the op-timum solution; (b) a crossover operator that transmits setsof activities scheduled together to the children. This type ofcrossover has proven its efficiency in the RCPSP (cf. Vallset al., 2005 and 2008 for such crossovers), and in this caseour conglomerate-based crossover operator transmits thoseparts that are a key aspect of the problem, the cycle struc-tures and (c) improvement techniques that mean a decreasein the average deviation of 0.8%.

On the other hand, EVA seems to be one of the fastestheuristic algorithms for problem RCPSP/max. The motivesare that the crossover operator is a fast combination methodand especially that the improvement method has the sameorder as the decoding method. Also the correct choice of thestopping criteria diminishes the average time while preserv-ing the final quality.

As the RCPSP, the RCPSP/max is a referent for manygeneralisations, like the multi-mode RCPSP/max. An im-portant future line of research is to try to adapt these tech-niques to such other problems with presence of maximumand minimum time lags.

Acknowledgements This research has been partially supported bythe Ministerio de Ciencia y Tecnología, DPI2007-63100, and by theProgramme Alβan, European Union Programme of High Level Schol-arships for Latin America, E03D08289CO.

References

Ballestín, F. (2002). Nuevos métodos de resolución del problema desecuenciación de proyectos con recursos limitados. UnpublishedPhD Dissertation, Universidad de Valencia.

Bartusch, M., Möhring, R. H., & Radermacher, F. J. (1988). Schedul-ing project networks with resource constraints and time win-dows. Annals of Operations Research, 16, 201–240. doi:10.1007/sBF02283745.

Cesta, A., Oddi, A., & Smith, S. (2002). A constraint based methodfor project scheduling with time windows. Journal of Heuristics,8(1), 109–136. doi:10.1023/A:1013617802515.

Cicirello, V. A. (2003). Boosting stochastic problem solvers throughonline self-analysis of performance. PhD thesis, The Robotics In-stitute, School of Computer Science, Carnegie Mellon University,Pittsburgh. Also available as a technical report CMU-RI-TR-03-27.

Cicirello, V. A., & Smith, S. (2004). Heuristic selection for stochasticsearch optimization. In Lecture notes in computer science. Mod-eling solution quality by extreme value (Vol. 23, pp. 197–211).Berlin: Springer.

De Reyck, B., & Herroelen, W. (1998). A branch-and-bound procedurefor the resource-constrained project scheduling problem with gen-eralized precedence constraints. European Operational Research,111, 152–174. doi:10.1016/S0377-2217(97)00305-6.

Dorndorf, U., Pesch, E., & Phan-Huy, T. (2000). A time-orientedbranch-and-bound algorithm for resource-constrained projectscheduling with generalised precedence constraints. ManagementScience, 46, 1365–1384. doi:10.1287/mnsc.46.10.1365.12272.

Drexl, A. (1991). Scheduling of project networks by job assignment.Management Science, 37, 1590–1602. doi:10.1287/mnsc.37.12.1590.

Fest, A., Möhring, R. H., Stork, F., & Uetz, M. (1998). Resource-constrained project scheduling with time windows: a branchingscheme based on dynamic release dates. Technical report 596, TUBerlin, Germany.

Franck, B., & Neumann, K. (1998). Resource constrained projectscheduling problems with time windows—structural questionsand priority-rule methods. Technical report WIOR 492, Univer-sität Karlsruhe.

Franck, B., Neumann, K., & Schwindt, Ch. (2001). Truncated branchand bound, schedule construction, and schedule improvementprocedures for resource constrained project scheduling. In ORSpecktrum (Vol. 23, pp. 297–324). Berlin: Springer.

Hartmann, S. (1998). A competitive genetic algorithm for resource-constrained project scheduling. Naval Research Logistics, 45,733–750. doi:10.1002/(SICI)1520-6750(199810)45:7<733::AID-NAV5>3.0.CO;2-C.

Kolisch, R., & Hartmann, S. (1999). Heuristic algorithms for solv-ing the resource-constrained project scheduling problem: classi-fication and computational analysis. In J. Weglarz (Ed.), Projectscheduling, recent models, algorithms and applications (pp. 147–178). Boston: Kluwer Academic.

Kolisch, R., & Hartmann, S. (2006). Experimental investigation ofheuristics for resource-constrained project scheduling: an up-date. European Journal of Operational Research, 174, 23–37.doi:10.1016/j.ejor.2005.01.065.

Luo, S., Wang, C., & Wang, J. (2003). Ant colony optimization forresource-constrained project scheduling with generalized prece-dence relations. In Proceedings of the 15th IEEE internationalconference on tools with artificial intelligence (ICTAI’03).

Neumann, K. (1975). Operations research verfahren, Band III.München: Carl Hanser.

Neumann, K., & Schwindt, C. (1995). Projects with minimal and max-imal time lags: construction of activity on-node networks and ap-plications. Report WIOR-447, University of Karlsruhe.

Neumann, K., Schwindt, Ch., & Zimmermann, J. (2002). ProjectScheduling with Time Windows and Scarce Resources. Berlin:Springer.

Smith, T. (2004). Windows-based project scheduling algorithms. PhDthesis, University of Oregon.

Schwindt, C. (1996). Generation of resource constrained projectscheduling problems with minimal and maximal time lags. Re-port WIOR 489, Institute for Economic Theory and OperationsResearch, University of Karlsruhe.

Schwindt, C. (1998). A branch-and-bound algorithm for the resource-constrained project duration problem subject to temporal con-straints. Technical report, WIOR-544, University Karlsruhe, Ger-many.

Tarjan, R. (1972). Depth-first search and linear graph algorithms. SIAMJournal of Computing, 1, 146–160. doi:10.1137/0201010.

Valls, V., Ballestín, F., & Quintanilla, S. (2005). Justification andRCPSP: a technique that pays. European Journal of OperationalResearch, 165, 375–386. doi:10.1016/j.ejor.2004.04.008.

Valls, V., Ballestín, F., & Quintanilla, S. (2008). A hybrid geneticalgorithm for the resource-constrained project scheduling prob-lem. European Journal of Operational Research, 185, 495–508.doi:10.1016/j.ejor.2006.12.033.