Solving the resource availability cost problem in project scheduling by path relinking and genetic algorithm

Solving the resource availability cost problem in project scheduling by path relinking and genetic algorithm

Available online at www.sciencedirect.com Applied Mathematics and Computation 196 (2008) 879–888 www.elsevier.com/locate/amc Solving the resource av...

539KB Sizes 106 Downloads 120 Views

Available online at www.sciencedirect.com

Applied Mathematics and Computation 196 (2008) 879–888 www.elsevier.com/locate/amc

Solving the resource availability cost problem in project scheduling by path relinking and genetic algorithm Mohammad Ranjbar *, Fereydoon Kianfar, Shahram Shadrokh Department of Industrial Engineering, Sharif University of Technology, P.O. Box 11365-9414, Tehran, Iran

Abstract This paper considers a project scheduling problem with the objective of minimizing resource availability costs required to execute the activities in a project by a given project deadline. The project contains activities interrelated by finish-starttype precedence relations with a time lag of zero, which require a set of renewable resources. Two metaheuristics, path relinking and genetic algorithm, are developed to tackle this problem in which a schedule is created with a precedence feasible priority list given to the schedule generation scheme. In these procedures, each new generation of solutions are created using the combination of current solutions. Comparative computational results reveal that path relinking is a very effective metaheuristic and dominates genetic algorithm.  2007 Elsevier Inc. All rights reserved. Keywords: Project scheduling; Resource availability cost problem; Heuristics; Path relinking; Genetic algorithm

1. Introduction We study the resource availability cost problem (RACP) in project scheduling denoted as m, 1 | cpm, dn | rac using the classification of Herroelen et al. [1]. This problem consists of scheduling the activities in a project such that the total cost of acquiring the necessary resources is minimized, assuming that a resource (whether it is used or not) is assigned to the project for the total project duration. The RACP was introduced by Mo¨hring [2] as a NP-hard combinatorial optimization problem. The literature on solution methods for the RACP is relatively scarce. Mo¨hring [2] proposes an exact algorithm procedure based on graph algorithms. Demeulemeester [3] develops another exact algorithm based on the cutting plane procedure and also the branch-and-bound algorithm developed for the multi-mode resource constrained project scheduling problem by Demeulemeester and Herroelen [4]. Drexl and Kimms [5] propose lower and upper bounds for the RACP using Lagrangian relaxation and column generation methods. Yamashita et al. [6] developed a scatter search procedure for the RACP. They work on determining the resource *

Corresponding author. E-mail addresses: [email protected] (M. Ranjbar), [email protected] (F. Kianfar), [email protected] (S. Shadrokh).

0096-3003/$ - see front matter  2007 Elsevier Inc. All rights reserved. doi:10.1016/j.amc.2007.07.022

880

M. Ranjbar et al. / Applied Mathematics and Computation 196 (2008) 879–888

availabilities and transform the problem to the resource constrained project scheduling problem (RCPSP), which is solved by the heuristic procedure of Tormos and Lova [7]. Also, Shadrokh and Kianfar [8] develop a genetic algorithm for the RACP in which the tardiness is permitted with penalty. They represent a chromosome by a priority list and an availably list of resources. They use both the serial and parallel scheduling schemes to construct schedules. In this paper, we present two metaheuristics for the RACP based on the path relinking and genetic algorithms, as the two population-based approaches. Contrary to the two above-mentioned metaheuristics for the RACP, we do not transform the problem to the RCPSP, but we represent the problem only via a priority list and we convert it to a real schedule using an available schedule generation scheme. In the path relinking, we generate new schedules from the elite old ones by changing the permutation of their priority lists using the relinking method developed in this paper. In the genetic algorithm, we generate new solutions by mating available solutions using crossover and mutation operators. The remainder of the paper is organized as follows. The RACP is described in Section 2. The schedule representation and schedule generation scheme are discussed in Section 3. Section 4 describes the path relinking procedure and its components for the RACP. The genetic algorithm is presented in Section 5. Section 6 contains the computational results on the benchmark dataset. The conclusions of this study are given in Section 7. 2. The resource availability cost problem The RACP can be stated as follows. A single project consisting of a set of activities N, including n real activities and two dummy activities as the start and finish of the project, numbered from 0 to n + 1, has to be scheduled on a set R of unconstrained renewable resource types subject to A, the set of finish-start-type precedence relations with time lag of zero, and the project deadline D. We assume graph G(N, A) is acyclic. While being processed, activity i requires rik 2 N unites of resource type k 2 R in every time unit of its deterministic and non-preemptive duration di 2 N. Let At represent the set of activities in progress during the time period t or interval P(t  1,t]  and ak represents the availability of renewable resource type k 2 R where r ak ¼ maxt i2At ik . The objective of the RACP is to find a precedence feasible schedule S, defined by a start P time vector s = (s1, . . . , sn), such that the discrete non-decreasing cost function f ¼ k2R C k ðak Þ is minimized. The RACP can be conceptually modeled as follows: X C k ðak Þ Minimize f ¼ k2R

subject to

si þ d i 6 sj 8ði; jÞ 2 A; s1 ¼ 0; sn 6 D; X rik 6 ak 8k 2 R

and

t ¼ 1; . . . :; S nþ1

i2At

3. Schedule representation and generation scheme Our constructive heuristic algorithm relies on schedule generation scheme (SGS) and schedule representation. The schedule generation scheme determines the way in which a feasible schedule is constructed by assigning starting times to the different activities and the schedule representation is a representation of a relative priority rule determining the activity that is selected next during scheduling process. 3.1. Schedule representation Schedule representation is representation of priority-structure between the activities. For our procedure, we choose to use the activity list (AL) representations, since it is one of the most commonly used schedule representations in the development of heuristics for the RCPSP [9]. Each AL is a sequence of activities that the position of each activity in this sequence determines its relative priority versus the other activities. We

M. Ranjbar et al. / Applied Mathematics and Computation 196 (2008) 879–888

881

represent each AL with a vector I = (i0, i1, . . . , in,in+1) in which activity I(P) = ip is the number of activity placed at position p in the sequence and has higher priority than every activity iq for which q > p. We always assume that i0 = 0 and in+1 = n + 1. As defined, AL may not be precedence feasible. If an AL is precedence feasible we call it precedence feasible activity list (PFAL) in which every activity is positioned after all of its predecessors. Fig. 1 describes by pseudo-code the procedure of making precedence feasible activity list (MPFAL). In this procedure, LIST is a partial PFAL including p* activities, pos is a boolean variable and Pred(iq) indicates the set of all immediate predecessors of activity iq. This procedure takes I as a random AL and orders the activities in a precedence feasibility condition from left to right. At step p, it finds the first activity iq where q P p, for which Pred(iq)  LIST. This activity is placed in position p and each activity iw in AL, p 6 w < q, is shifted one position to the right. This procedure starts by p* = 1, stops when p = n and outputs the precedence feasible activity list IPF. 3.2. Schedule generation scheme This section describes a schedule generation scheme for the RACP. This SGS is inspired by the Burgess and Killebrew logic [10]. For a given PFAL, two SGSs, the early-start SGS (ES_SGS) and the late-start SGS (LS_SGS) are applied and the better obtained solution, based on the objective function value, is selected. Fig. 2 describes by pseudo-code the ES_SGS and LS_SGS. In theses procedures, given a schedule S, estip and lstip denote respectively the earliest and the latest start time of activity ip that are initialized by the well known critical-path method (CPM). Also, stip denotes the current start time of activity ip and bstip indicates the best start time of that activity, f(S) indicates the resource availability cost of schedule S, f ðS ip t Þ denotes the resource availability cost of schedule S if activity ip is to be started at time t, change is a boolean variable and Suc(ip) is the set of immediate successors of activity ip. In the ES_SGS (LS_SGS) procedure, all activities are first scheduled at their earliest (latest) start time, obtained by the CPM. Then, all real activities in order of their PFAL are tested locally to improve the objective function. For each activity ip, the best start time bstip is selected from the set of possible start times

Fig. 1. Procedure of the MPFAL.

882

M. Ranjbar et al. / Applied Mathematics and Computation 196 (2008) 879–888

Fig. 2. The schedule generation scheme for the RACP.

festip ; estip þ 1; . . . ; lstip g. It should be clear from the pseudo-code of the ES_SGS (LS_SGS) that whenever the smallest value of the objective function for a certain activity is obtained at several possible start times, the smallest (biggest) of these start times is chosen. In this way, as much float as possible is given to the activities that appear later (earlier) in the given PFAL which can be used later. This procedure is terminated whenever no more improvement is obtained. 4. Path relinking Path relinking (PR) is an evolutionary method proposed by Glover and Laguna [11] to integrate intensification and diversification strategies in the context of tabu search. In this approach, new solutions are generated by searching trajectories that connect two elite solutions, by starting from one of these solutions, calls the initial solution, and generating a path in the neighborhood space that leads toward the other solution, called guiding solution. In this path, the moves are selected that introduce attributes contained in the guiding solution. In order to apply the PR approach to the RACP, we represent each solution by a PFAL which can be transformed to a real schedule by the SGS. The selection of the initial and guiding solutions in the RACP is based on the value of objective function (the resource availability costs) such that this value for the guiding solution is never more than the initial one. Fig. 3 shows the main structure of our algorithm. In the first step, the initial population P1 with size of PSize1 is generated. Each element of P1 is a PFAL, created using the diversification generation method, which will be described in the Section 4.1, and the MPFAL procedure.

M. Ranjbar et al. / Applied Mathematics and Computation 196 (2008) 879–888

883

Fig. 3. The path relinking method for the RACP.

Until the termination criterion is not satisfied, the algorithm is continued as follows. In step 2, a set of elite solutions are chosen as the reference set, denoted as RefSet, using the RefSet building method, which will be described in the Section 4.2. The P will be reset again to an empty set at step 3. In step 4, each pair of RefSet members are combined using the relinking method, which will be described in the Section 4.3. Relinking of every pair of solutions results in a set of new solutions that two of them, as the children, will be selected and added to the new population. In step 5, RefSet is updated on the basis of the newly generated population. 4.1. Diversification generation method In order to achieve the diversification in the generated solutions, we use a biased random sampling method based on the frequency memory. Each PFAL of the initial population is obtained from a randomly generated AL that is a sequence of numbers 1 to n. Each cell (i, j) of matrix Pn*n, P(i, j), indicates how many times number j is assigned to activity i. In order to generate a new random AL, we make use of the biased random sampling in which the probability of assigning number j to activity i is inversely proportional to P(i, j). 4.2. RefSet building and updating method RefSet, the set of reference solutions, includes solutions based on both quality and diversity. The construction of elite solutions starts with the selection of the solution in P1 with the lowest objective function. This solution is added to RefSet as x1 and deleted from P1. The next best solution x in P1 is chosen and added to RefSet only if dmin(x) P t, where dmin(x) is the minimum of the distances of solution x to the solutions currently in RefSet and t is a minimum threshold value. The distance between two solutions is computed as the sum of the absolute values of the component-wise differences divided by the number of activities [12]. To avoid the creation of a homogenous population of solutions, when no qualified solution can be found in the population, we complete the RefSet by the solutions that are generated based on the method used for building the initial population. In order to update RefSet, we opt for a static update, in which the reference set is updated only after the new population is completely generated. 4.3. Relinking method The relinking method is described by pseudo-code in Fig. 4. Assume that two elements of RefSet are given to the relinking method as the inputs. As the first step, we determine the initial and guiding solutions IPFand I0PF , respectively. Also, we consider I, initialized as I = IPF, as an AL denoting the current solution in the relinking method. From left to right, we check the activities of IPF based on the similar ones in the I0PF . If for position l where 1 6 l 6 n, we have IðlÞ 6¼ I0PF ðlÞ, it means that I(l) should be changed. To have the same activity in position l of I and I0PF , we find activity iq for which IðqÞ ¼ I0PF ðlÞ. This activity is placed at position l of the I and each activity iw 2 I where l 6 w < q is shifted one position to the right. At this stage, I may not be precedence feasible but for all positions p 6 l, the precedence feasibility is not violated. To have precedence

884

M. Ranjbar et al. / Applied Mathematics and Computation 196 (2008) 879–888

Fig. 4. The relinking method.

feasibility of the newly obtained AL, we apply the MPFAL procure to the I in which we let p* = l + 1. The newly obtained PFAL is added to the end of a set called C and its corresponding objective function is obtained using the SGS. When the condition I ¼ I0PF is hold, the procedure of generation of new solutions is terminated. Then, two of these solutions should be selected. In order to have better and more different solutions, the set C is divided into two subsets C1 and C2 where C1 contains the first dC/2e of elements of set C andC2 = C  C1. The best element of each subset is selected and added to the population. 4.4. Termination criterion We have considered the termination criterion (TC) as the maximum number of evaluated solutions. Each iteration of the while-loop in the ES_SGS or LS_SGS is considered as a solution. We have tested our results for three values TC = 1000, 5000 and 10,000. 5. Genetic algorithm Holland [13] developed the Genetic Algorithm (GA) based on the biological evolution idea for solving complex optimization problems. Our GA starts with generation of an initial population P2 with size of psize2. Each element of the P2 is a PFAL generated by diversification generation method, described in Section 4.1, and incorporated with MPFAL. Each element of P2 is transformed to a real schedule using SGS described in Section 3.2. In order to construct a new generation of solutions, each element p = 1, . . . , psize2 of the P2, considered as the father activity list (ALf), is mated randomly with element q (q 5 p and 1 6 q 6 psize2) of the P2, considered as the mother activity list (ALm), to constitute a couple. Each couple generates two children, considered as the son activity list (ALs) and the daughter activity list (ALd). The children generation process is performed using two operators, i.e. crossover and mutation. The children are transformed to their corresponding real schedules and the schedule with the better makespan is chosen as the child schedule (ALc) of the parents and is added to the end of P2. Then, the P2 consisting of the 2*psize2 elements is updated by deleting half of its elements in such a way that the best individuals will appear in the population more than those with a worse makespan value. To that purpose, we delete population elements using a biased random sampling method in which the deletion probability of each element is directly proportional to its makespan. In order to prevent the losing of the best-found schedule so far, we will never delete it from P2. This procedure will be continued until the termination criterion, described in Section 4.4, is met. The pseudo-code of our GA procedure is given in Fig. 5.

M. Ranjbar et al. / Applied Mathematics and Computation 196 (2008) 879–888

885

Fig. 5. The genetic algorithm.

5.1. Crossover After the selection of parents, a crossover operator combines the ALf and ALm to generate ALs and ALd. We use the two-point crossover developed by Shadrokh and Kianfar [8]. This operator works as follows: let cp1 and cp2 are two crossing points from interval [1, n] where cp1 < cp2. Assume father and mother activity lists are given as follows: ALf ¼ ðif0 ; . . . ; ifnþ1 Þ

and

ALm ¼ ðim0 ; . . . ; imnþ1 Þ:

ALs and ALd are defined as follows: ALs ¼ ðis0 ; . . . ; iscp1 ; iscp1 þ1 ; . . . ; iscp2 ; iscp2 þ1 ; . . . ; isnþ1 Þ and

ALd ¼ ðid0 ; . . . ; idcp1 ; idcp1 þ1 ; . . . ; idcp2 ; idcp2 þ1 ; . . . ; idnþ1 Þ:

For ALs, isa , a = 1, . . . , cp1, is imb where m is the lowest index such that imb 2 fif0 ; . . . ; ifcp1 g and imb 62 fis0 ; . . . ; isa1 g. Also ðiscp1 þ1 ; . . . ; iscp2 Þ ¼ ðifcp1 þ1 ; . . . ; ifcp2 Þ, and isa , a = cp2 + 1, . . . , n + 1, is imb where b is the lowest index such that imb 62 fis0 ; . . . ; isa1 g. The definition of ðid0 ; . . . ; idcp1 ; idcp1 þ1 ; . . . ; idcp2 ; idcp2 þ1 ; . . . ; idnþ1 Þ is similar to ðis0 ; . . . ; iscp1 ; iscp1 þ1 ; . . . ; iscp2 ; iscp2 þ1 ; . . . ; isnþ1 Þ. For example, if n = 6, cp1 = 2 and cp2 = 4, ðif0 ; . . . ; if7 Þ ¼ ð0; 1; 2; 3; 4; 5; 6; 7Þ and ðim0 ; . . . ; im7 Þ ¼ ð0; 6; 4; 3; 5; 2; 1; 7Þ, then ðis0 ; . . . ; is7 Þ ¼ ð0; 2; 1; 3; 4; 5; 6; 7Þ and ðid0 ; . . . ; id7 Þ ¼ ð0; 4; 6; 3; 5; 1; 2; 7Þ. It has been shown in [8] that for every pair of precedence feasible parents, this crossover operator creates precedence feasible activity lists. 5.2. Mutation Mutation mechanism, which is applied with the probability Pmut over each generated ALc, alters the activity list. We use the mutation operator developed by [8] that works as follows: An integer random number, b, is generated from the interval [1, n]. Let activity ib be the last predecessor of activity ia and activity ic the first successor of ia in the ALc. Another integer random number, d, is generated from the interval ½b þ 1; c  1 . Ifd < a, the activity list is replaced by ði0 ; . . . ; id  1; ia ; id ; . . . ; ia  1; ia þ 1; . . . ; in þ 1Þ, and if d > a, it is replaced by ði0 ; . . . ; ia  1; ia þ 1; . . . ; id  1; ia ; id þ 1; . . . ; in þ 1Þ. For example, if n ¼ 9; a ¼ 4; ði0 ; . . . ; i7 Þ ¼ ð0; 2; 1; 4; 3; 6; 7; 5; 8; 9Þ; b ¼ 0; c ¼ 7 and d = 1 then the mutated activity list is (0, 3, 2, 1, 4, 6, 7, 5, 8, 9). If the mutation operator is applied to any ALc, it may not be precedence feasible. In this case, in order to make it precedence feasible, we apply MPFAL to it.

886

M. Ranjbar et al. / Applied Mathematics and Computation 196 (2008) 879–888

6. Computational results 6.1. Benchmark problem set In this section we test the performance of the PR and GA methods. We have coded the procedure in Visual C++ 6.0 and performed all computational experiments on a PC Pentium IV 3 GHz processor with 1024 MB of internal memory. We have validated the procedure on the test set instances developed by [6]. This test set was generated using the following parameters, where each combination of them gave one instance, resulting in a total 3 * 4 * 1 * 4 * 3 = 144 instances. • Network complexity (NC): reflects the average number of immediate successors of an activity and takes the values 1.5, 1.8 and 2.1. • Resource factor (RF): reflects the density of the different resource types needed by an activity and takes the values 0.25, 0.5, 0.75 and 1.0. • Deadline factor (DF): reflects the deadline of the project such that D = DF Æ maxi2N{efti}, where efti denotes the earliest finishing time of activity P i. We fixed DF at 1.20. • Objective function: is considered as f ¼ k2R ck :ak where ck’s are drawn from a uniform distribution U[1,10] for each instance. • Number of real activities (n): takes the values 30, 60, 90 and 120. • Number of resources (m): takes the values 4, 6 and 8. 6.2. Setting of parameters In the path relinking, the diversity thresholds t is set to 2 and the size of initial population is set to PSize1 = 2b(b  1) where b denotes the size of RefSet and is determined based on the settings in Table 1. In the genetic algorithm, we have set Pmut = 0.02 by fine tuning and the size of initial population P2 (PSize2) are fine tuned on the basis of values given in Table 2. 6.3. Comparative computational results In this section, we compare the computational results obtained from implementation of the PR and GA. As the CPU, the internal memory and the SGS presented in this paper are different from the corresponding cases in [6], we can not compare our results fairly with [6]. For each pair of values of the number of real activities, n, and the number of resources, m, there are 12 instances. The average percent deviation for the solutions of these Table 1 Tuned values of parameter b TC

1000 5000 10,000

n 30

60

90

120

10 14 18

10 13 17

9 12 17

9 12 16

Table 2 Tuned values of PSize2 TC

n 30

60

90

120

1000 5000 10,000

112 137 154

117 148 171

123 156 182

130 169 197

M. Ranjbar et al. / Applied Mathematics and Computation 196 (2008) 879–888

887

Table 3 Performance of the PR m

4 6 8 Global

n 30

60

90

120

Global

0.15 0.14 0.17 0.15

0.19 0.16 0.18 0.18

0.21 0.24 0.27 0.24

0.30 0.33 0.37 0.33

0.21 0.22 0.25 0.23

Table 4 Performance of the GA m

4 6 8 Global

n 30

60

90

120

Global

0.18 0.16 0.18 0.17

0.23 0.19 0.24 0.22

0.27 0.30 0.34 0.30

0.38 0.42 0.49 0.43

0.26 0.27 0.31 0.28

Table 5 Average CPU-time (seconds) of the PR TC

1000 5000 10,000

n 30

60

90

120

0.68 3.47 7.10

2.23 11.19 20.42

4.25 23.19 44.12

7.06 35.35 73.28

Table 6 Average CPU-time (seconds) of the GA TC

n 30

60

90

120

1000 5000 10,000

0.71 3.52 7.23

2.28 11.31 20.58

4.21 23.12 44.08

6.73 34.24 72.89

12 instances, which are obtained by the PR and the GA, from the corresponding best-found solutions, which are obtained by the procedures developed in [6], are presented in Tables 3 and 4, respectively. The comparative results indicate that the PR outperforms the GA, showing the merit and efficiency of this procedure. In addition, he PR was able to improve 7 out of 144 best-found solutions in [6]. Furthermore, Tables 5 and 6 show the average CPU-time spent by the PR and GA respectively. 7. Conclusions In this paper, we have presented two metaheuristics based on the path relinking and genetic algorithm for solving the resource availability cost problem. The performance of the procedures was tested on an available test set, which show that PR is more efficient than GA. In general, the path relinking implementation seems robust, in the sense that its performance is not very sensitive to changes in the characteristics of the problem being solved. For further research, we recommend the testing of the path relinking procedure on the resource leveling problem and using this idea for solving other project scheduling problems.

888

M. Ranjbar et al. / Applied Mathematics and Computation 196 (2008) 879–888

References [1] W. Herroelen, E. Demeulemeester, B. De Reyck, A classification scheme for project scheduling problems, in: J. Weglarz (Ed.), Project Scheduling – Recent Models Algorithms and Applications, International Series in Operations Research and Management Science, vol. 14, Kluwer Academic Publishers, 1998, pp. 1–26, Chapter 1. [2] R.H. Mo¨hring, Minimizing costs of resource requirements in project networks subject to a fix completion time, Operations Research 32 (1984) 89–120. [3] E. Demeulemeester, Minimizing resource availability costs in time limited project networks, Management Science 41 (1995) 1590– 1598. [4] E. Demeulemeester, W. Herroelen, A branch-and-bound procedure for the multiple resource-constrained project scheduling problem, Management Science 38 (1992) 1803–1818. [5] A. Drexl, A. Kimms, Optimization guided lower & upper bounds for the resource investment problem, Journal of Operational Research Society 52 (2001) 340–351. [6] D.S. Yamashita, V.A. Armentano, M. Laguna, Scatter search for project scheduling with resource availability cost, European Journal of Operational Research 169 (2006) 623–637. [7] P. Tormos, A. Lova, An efficient multi-pass heuristic for project scheduling with constrained resources, International Journal of Production Research 41 (2003) 1071–1086. [8] S. Shadrokh, F. Kianfar, A genetic algorithm for resource investment project scheduling problem, tardiness permitted with penalty, European Journal of Operational Research 181 (2007) 86–101. [9] R. Kolisch, S. Hartmann, Heuristic algorithms for solving the resource-constrained project scheduling problem: classification and computational analysis, in: J. Weglarz (Ed.), Project Scheduling – Recent Models, Algorithms and Applications, Kluwer Academic Publishers, Boston, 1999, pp. 147–178. [10] A.R. Burgess, J.B. Killebrew, ;Variation in activity level on a cyclic arrow diagram, Industrial Engineering (1962) 76–83, March– April. [11] F. Glover, M. Laguna, Tabu Search, Kluwer Academic Publishers, Boston, 1997. [12] D. Debels, B. De Reyck, R. Leus, M. Vanhoucke, A hybrid scatter search/electromagnetism meta-heuristic for project scheduling, European Journal of Operational Research 169 (2006) 638–653. [13] H.J. Holland, Adaptation in Natural and Artificial Systems, The University of Michigan Press, Ann Arbor, 1975.