Sunteți pe pagina 1din 6

A Genetic Algorithm to Time- Cost Trade off in Project Scheduling

B. Hooshyar
1
. A. Rahmani
2
. and M. Shenasa
3

Abstract One of the key important issues in project
management is trade off between cost and time in such a way
that the project is completed in the shortest time and minimum
cost. Genetic Algorithm is a practical approach for such
optimization problems. In this paper, an algorithm is presented
to solve the Time-Cost Tradeoff Problem (TCTP) using genetic
algorithm. In this algorithm in order to search the problem
space two control variables are used. Also an intelligent
mutation operator is presented to approximate to the projects
optimal point. Comparing this algorithm with Siemens classical
algorithm shows the higher speed of proposed algorithm
because in this algorithm many computations of paths in
projects network graph are not needed.
1. INTRODUCTION
In general. we consider the proiects deIined as 'Set oI
activities to achieve a certain obiect.
Proiects include activities that must be perIormed on certain
dates with speciIied cost and have to meet pre-deIined
quality. Proiect planning looks Ior the best economical
scheduling subiected to diIIerent parameters such as time.
cost and other operation resources. Proiect scheduling
calculations are based on CPM (Critical Path Method). Each
activity has a normal duration and a Iorced duration.
Completing an activity in it`s Iorced duration needs more
direct cost and resources. On the other hand it leads to
decreasing proiect`s total duration and Indirect costs. So
each activity`s duration can be between two extremes :
Normal duration and Forced duration.
There are also two types oI costs Ior each activity : Normal
cost and Forced cost. Each activity`s cost can be between
these two extremes.
By changing duration oI some activities. several candidate
solutions might be generated. Combing these solutions with
the help oI genetic algorithm (GA) we can approximate to
the optimal solution. This is a NP hard problem.
So Iar several studies. using genetic algorithm. Ior resource
allocation and leveling have been done. These methods have
applied Petri Nets|1|. Iorward-backward bidirectional
GA|2|. and MRCPSP method Ior resource leveling|3|.
There is also a GA approach Ior multi-proiect
management|4|. In this research. we introduce a novel
evolutionary approach to solve this problem.


1
The Computer Engineering Department. Islamic Azad University.
Sciences and Researches branch. Tehran. Iran (Barmak.Hooshyar(
sr.iau.ac.ir)
2
The Computer Engineering Department. Islamic Azad University.
Sciences and Researches branch. Tehran. Iran (Rahmani( sr.iau.ac.ir)
3
The Computer Engineering Department. Khaie Nasir Toosi University
oI Technology. . Tehran. Iran (Shenassa(eetd.kntu.ac.ir)
In the second section the time-cost trade oII problem will be
described. In this section also proiect`s scheduling
calculation method is introduced. In the third section a
conventional algorithm which is used Ior trading oII
between cost and time. called Siemens algorithm is
introduced. In the Iorth section. the proposed GA algorithm
will be described. Finally. in the last section the solutions
obtained by Siemens algorithm and the proposed algorithm
will be illustrated and compared.
2. TIME-COST TRADE OFF PROBLEM
Several techniques are used to change the completion
time oI a proiect. Obviously. these changes can aIIect the
cost oI proiect. In the most oI cases. reduction Irom the
normal completion duration oI activities causes the direct
cost oI activities to be increased. In contrast. decreasing the
duration oI activities entails to the reduction oI proiect`s
total duration and consequently reduces indirect costs oI the
proiect.
2. 1. Scheduling Computation
To start the calculation. an arbitrary date should be set Ior
the start event in the proiect`s network diagram. Usually this
value is set to zero. Scheduling computation consists oI two
tracking through the network. Iorward tracking and
backward tracking.
The earliest possible date to start each activity is determined
by Iorward tacking. and the latest possible date to Iinish the
ones is obtained by backward tracking.
The earliest possible date to start an activity (ES) is the
earliest date that all oI its predecessor activities have been
Iinished.
The latest possible date to Iinish an activity (LF) is the
latest date that none oI its successor activities would be
started. II an activity Iinishes aIter this date. it will have
eIIect on the start dates oI its successor activities.
Two small boxes can be used next to each event on the
network diagram within which. values oI ES and LF are
stored. It simpliIies the calculation while tracking the
network Iorward or backward.
In Fig. 1. the calculation on an AOA (Activity On Arc)
network diagram is shown. In AOA network diagrams arcs
show activities and nodes show events. Also there is another
type oI network diagrams called AON (Activity On Node).
but AOA network diagrams are more common.
3081
978-1-4244-1823-7/08/$25.00 c 2008 IEEE


Fig. 1. A sample proiect network diagram
2. 2. Network Paths
A series oI activities beginning Irom the start activity. and
ending with the Iinal activity is called a path. The longest
path in the network diagram is called 'critical path. In some
proiects there might be more than one critical path. The
activities which are in a critical path are called 'critical
activities. For example in Fig. 1.. '02346 is a
critical path.
2. 3. Direct Costs and Indirect Costs
In many situations. the proiect is given to be Iinalized
beIore the date calculated by the network. Quickly
perIorming the activities. is a way to reduce the completion
time oI the proiect in such cases. To reduce the duration oI
an activity. one should increase available resources Ior this
activity or some technical changes should be applied to the
activity. Always such a reduction Irom normal activity
duration to a shorter duration imposes extra cost to the
proiect.
Costs oI a proiect are distinguished in two classes. direct
costs and indirect costs. Direct costs include materials.
human resources. and any kinds oI equipment employed
during perIorming activities. Indirect costs are implied by
oIIicial costs oI management operations. leaseholds. and
machinery hiring.
2. 4. Time and Cost of Activities
In regards to the time-cost trade oII problem. the time
required to complete an activity would be considered as
normal duration or Iorced duration. The time that an activity
is completed using the least direct costs is called normal
duration oI the activity. In Fig. 2. D
n
shows the normal
duration oI activities. The shortest time that an activity is
done possibly by supplying more charge is called Iorced
duration oI the activity. D
I
indicates the Iorced duration oI
activities in Fig. 2.
According to the deIinition oI normal duration and Iorced
duration. the cost oI an activity can be considered in normal
or Iorced situation. The total direct cost oI an activity when
it is being perIormed Ior its normal duration is called normal
cost. In Fig. 2 the normal cost oI an activity has been shown
by C
n
. The total direct cost oI an activity when it is quickly
completed by its Iorced duration is called Iorced cost. In
Fig.2 the Iorced cost oI an activity has been shown by C
I
.

Fig. 2. Time-Cost diagram
2. 5. Cost Slope
The additional direct cost that one has to pay to reduce
one unit oI time Irom the normal duration oI an activity is
deIined as the 'cost slope. Since the time-cost curve does
not necessarily behave as a linear curve. the cost slope value
is not kept constant over the time. The precise value oI cost
slope depends on time and is obtained by the derivation oI
time-cost curve at that time. As there is not any explicit
Iormulation Ior the time-cost curve but some approximated
Iorms. the linear approximation is conventionally used as a
simple practical model. By assuming the linear model. the
cost slope value oI an activity is obtained by the Iormula (1).
C (C
I
C
n
) / (D
n
D
I
) (1)
In this Iormula C is the cost slope. C
I
is the Iorced cost. C
n

is the normal cost. D
I
is the Iorced duration and D
n
is the
normal duration oI an activity.
2. 6. Projects Optimum Point
II activities are completed in their normal time. total time
oI the proiect reaches to its maximum and the cost reaches to
its minimum. In this case. because oI the long completion
time. the overhead cost that directly depends on the proiect`s
duration also goes up. On the other hand. iI activities are
completed in their Iorced time. the direct cost oI activities
reaches to the highest value. and consequently the total cost
oI the proiect does so. However. the total time oI the proiect
is decreased to a minimum duration that makes the overhead
cost also decreases to the least value. Between these two
extremes. there is an optimal point Ior perIorming the
proiect in which the sum oI direct and indirect costs meets
the minimum value. This time point is the economical point.
or the optimum point Ior the proiect.
3. SIEMENS ALGORITHM TO TIME-COST TRADE OFF
In this section one oI the conventional algorithms to time-
cost trade oII is introduced. This common algorithm has
been presented by Nicolai Siemens|5|. The main application
oI Siemens algorithm concerns the proiects Ior which a pre-
deIined completion time (T
p
) has been agreed in the
contract. This deadline is beIore the normal completion date
calculated by CPM method. Siemens algorithm Iinds a best
3082 2008 IEEE Congress on Evolutionary Computation (CEC 2008)

arrangement oI activities in which the proiect will be ended
up until Tp while minimizing the overhead cost.
The Iollowing terms are incorporated in Siemens
algorithm:
(2)

=
i p
D D
In this Iormula D
p
is the length oI a path where the sum is
over all activities occurred on the path. D
i
is duration oI
activity i which is on the path.
TA
i
D'
n
-D
I
(3)
TA is reducible time oI activity i. D'
n
is the current
duration oI activity and D
I
is the Iorced duration oI the
activity. Initially D'
n
D
n
.
EC
i
C
i
/ N
i
(4)
EC
i
is the eIIective cost slope Ior activity i, C
i
is the cost
slope and N
i
is the number oI the paths passing on activity i
and are not "shortened enough". The path is "shortened
enough" when the proiect can be completed at T
p
so there is
no need to reduce the time more.
TR D
p
- T
p
(5)
The necessary time reduction. TR that is equal to the
current length oI the path. D
p
minus T
p
.
Siemens algorithm deIines as Iollows:
1) Estimate activities duration on the network and perIorm
CPM calculations based on the normal duration oI
activities.
2) For each path. compute the necessary time reduction.
TR and determine which one is not shortened enough
(TR ~ 0).
3) For each activity occurred on at least one oI the paths
determined by step 2. compute the cost slope. C
i
. and
the reducible time. TA
i
.
4) Compute the eIIective cost slope Ior the activities oI
step 3.
5) Among paths with maximum necessary time reduction.
select the one oI which the eIIective cost slope is the
least. II there are more than one activity admitting such
a condition. then decide upon the Iollowing criteria.
respectively.
a) Choose the activity which occurs on more number
oI 'not shortened enough paths.
b) Choose the activity with the largest necessary
reduction time.
c) Randomly choose one oI the activities.
6) Reduce the time oI the activity obtained in step 5 to the
least possible value which is the minimum oI the
Iollowing values:
a) The reducible time oI the activity. TA
i
.
b) The minimum necessary time reduction oI the 'not
shortened enough paths passing the activity.
7) Increase the duration oI the activities which are reduced
more than necessary time until no new 'not shortened
enough paths would be generated. These activities
occur on the paths that ED'
n
-T
p
0.
8) II all paths have been shortened enough then stop.
otherwise update the eIIective cost slopes oI the
activities occurring on the paths that are not short
enough. then go to step 5.
Here is an example to show how Siemens algorithm
works. Suppose a proiect consists oI activities A to H where
predecessors and Iorced conditions are given by table 1.
Table 1. Properties oI activities.

The purpose is to Iind the best reduction on duration oI
activities so that the total proiect duration is reduced Irom 25
weeks to 22 weeks while the cost oI the reduction is the
least. The network diagram oI this proiect is shown in Fig. 3.
(step 1).

Fig. 3. Proiect`s network diagram.
The completion time Ior the proiect has been set to 22
weeks; T
p
22. So the paths that are not shortened enough
should be Iound. These paths are shown in Table 2.
Table 2. The necessary time reduction on network paths.

Based on the rules oI step 5. activity G has the smallest
eIIective cost slope in the Iirst iteration oI the algorithm so it
is selected Ior time reduction. The amount oI this reduction
based on the Iormula in step 6 is set to 2 weeks. In the
second and third iterations respectively. activities A and B
are reduced one week. In the Iorth iteration. according to
step 7. the duration oI activity G that was reduced 2 weeks
at an earlier iteration. is increased again one week. It leads to
one unit reduction in cost. The total reduced cost aIter the
Iorth iteration reaches to 9 units. Since all necessary time
reductions have zero value at this iteration. it stops Iurther
computations and the Iinal result is reported. The Iinal result
represents that the duration oI activities A. B. and G should
2008 IEEE Congress on Evolutionary Computation (CEC 2008) 3083

be reduced one week.
4. THE PROPOSED ALGORITHM
In this section. a new method based on genetic algorithm
is introduced. The main problem in a GA approach is to
choose a sensible deIinition Ior chromosomes. and in
general. the modeling oI the problem by GA terms. The
modeling has a signiIicant role in Iinding the solution
eIIiciently. Our idea to deIine a chromosome consists oI a
string which its length is equal to the number oI activities in
the proiect. Activities are sorted in the string with respect to
their earliest start date. The current duration oI each activity
is placed in its corresponding position in the string. The
duration oI each activity can vary between a lower bound.
that is equal to the Iorced duration oI the activity. D
I
and an
upper bound. that is equal to the normal duration oI the
activity. D
n
. For example. the Iollowing chromosomes
represent two diIIerent Ieasible solutions Ior the problem in
section 3.

Fig. 4. Two candidate solutions Ior problem 3.
These two chromosomes could be translated as in Fig. 5.(a)
and Fig. 5.(b).

Fig. 5.a Time-chart representation oI chromosome C1.

Fig 5.b Time-chart representation oI chromosome C2.
4. 1. Fitness Function
Depending on the purpose oI resolving the problem.
diIIerent Iitness Iunctions could be applied. For example iI
the purpose is to reduce the duration oI the proiect Irom T1
to T2. duration oI the proiect can be used as Iitness value. II
the obiective is to reduce the cost oI the proiect. the sum oI
direct and indirect costs oI the proiect could be considered
as the Iitness value. But in the case that the obiective is to
reach the optimum point oI the proiect. the point that both
the sum oI direct and indirect costs and the proiect time get
the ioint minimum. a mixed Iorm should be used as Iitness
value. as in Iormula (6):
Fitness(c) ATotal Duration |ADirect Cost - AIndirect Cost| (6)
Where ATotal Duration is the reduced duration oI the
proiect in regard to normal duration. and AIndirect Cost and
Adirect Cost are respectively the reduction in indirect cost
and the addition oI direct cost. For example the value oI the
proposed Iitness oI the two above chromosomes assuming
parameters oI table 1. and a 5 unit indirect cost per time unit
is obtained as Iollows:
F(C1) 2 (10 4) 8 F(C2) 4 (20 17) 7
4. 2. Mutation Operator
Mutation operator is used to manipulate old chromosomes
and to produce new chromosomes. To do so. each gene
independently increases one with probability P1. or
decreases one with probability P2. Obviously. it is possible
that a gene does not change at all.
The probability oI increasing or decreasing the duration
oI activities depends on the problem parameters; more
precisely to the cost slope oI the activities. II the cost slope
oI an activity is smaller than the other. it should be
considered with more chance to reduce its duration and vice
versa. ThereIore. the Iormula (7) is suggested Ior P1;
P
1
o (1-
Min Max
Min i
C C
C C

) (7)
Where C
Min
and C
Max
are respectively the smallest and the
largest cost slope among all activities. is an arbitrary Iactor
and is given by the user. It can control the rate oI reduction
in the model. The deIault value Ior this parameter is 1.
In a diIIerent way. the Iormula (8) is suggested Ior P2;
P
2
| (
Min Max
Avr Min i
C C
C C C

+
0.5) (8)
Where C
Avr
is the average oI cost slopes. These two
Iormulas. (7) and (8). are obtained via our soItware
simulations.
The probability oI increasing or decreasing oI the duration
oI an activity has inverse relations. The value in the
parentheses relates the P2 to the average cost slope. II the
optimal point o
I normal distribution cost Iunction lies in the point greater
than 0.5. the probability oI increasing the duration oI
activities is increased and vice versa. | is a multiplier which
is deIined by the user and makes it possible to control the
amount oI increasing duration oI activities. The deIault
value is set to 1.
Mutation operator produces a random number Ior every
gene in each chromosome. II the random number is smaller
than P1. the value oI gene will be decreased one unit. then
mutation operator produces another random number and
compares it with P2. II this value is smaller than P2. one unit
will be added to the corresponding gene. In this case there
are three conditions:
3084 2008 IEEE Congress on Evolutionary Computation (CEC 2008)

1) P
Dec
. Probability oI decreasing oI a gene:
P
Dec
P
1
(1 P
2
) (9)
2) P
Inc
. Probability oI increasing oI a gene:
P
Inc
P
2
(1 P
1
) (10)
3) P
NC
.Probability oI no change in a gene :
P
NC
(P
2
* P
1
) |(1 P
1
) (1 P
2
)| (11)
P
NC
.Probability oI no change in a gene.
:4. 3. Cross Over Operator
Another operator which is applied on chromosomes is
called cross over operator. Here we use two points cross
over. First. cross over operator selects two chromosomes
using Roulette Wheel operator. Then. two random points are
selected as the cross over points. Next. genes oI each
chromosome will be exchanged with each other according to
the cross over points. E.g. consider that two chromosomes
C1 and C2 with points 2 and 4 are selected by cross over
operator. the result is shown in the Fig. 6.
4. 4. The Proposed Genetic Algorithm
In this section we present our proposed algorithm based
on two operators. First oI all. a population oI size N is
produced randomly. Then. until reaching the Iinal
conditions. two copies oI population are produced. Next.
mutation operator is applied on one copy and cross over
operator is applied on the other one. Then. these two
populations are merged and the chromosomes with the best
Iitness value are selected to use in next generation.
The stop condition depends on the purpose oI the
problem. E.g. the stop condition can be set to the Iact that
one oI the chromosomes reaches to a speciIied Iitness level
or the improvement Irom one generation to another
generation is very small. Also. a predeIined number may be
used as the number oI iterations Ior the algorithm.
The pseudo code is presented in the Iollowing section:
1) SpeciIy the initial population size (N) and speciIy o and
|
2) Compute P1 and P2 Ior each activity.
3) Produce a random population.
4) PerIorm the Iollowing steps until reaching to the Iinal
criterion:
a) Produce two copies oI population.
b) Apply mutation operator on the Iirst copied
population.
c) Apply cross over operator on the second copied
population.
d) Sort chromosomes according to their Iitness value.
e) Merge two populations.
I) Produce a new population using the top N
chromosomes oI merged population.
5) II the stop condition is reached. stop the algorithm and
return the chromosomes with the best Iitness value as the
result. otherwise. go to step 4 and repeat the steps.
5. EVALUATION OF THE NEW ALGORITHM
In this section eIIiciency oI the proposed algorithm is
compared to Siemens algorithm. ThereIore. some proiects
including 10.20 and 30 activities are used. We have coded
them in C# .net version 2005 under Windows XP on a
SONY computer with Pentium IV. 1.68 MHz processor and
1 gigabyte RAM. All Ieatures oI these activities are stored in
a MicrosoIt Access database. These Ieatures are earliest start
date. latest Iinish date. normal duration. Iorced duration.
normal cost. Iorced cost. cost slope and predecessor
activity(s) list Ior each activity. MicrosoIt Proiect 2003 is
used in order to calculate the earliest start and latest Iinish
date oI activities. This soItware also is used to draw Gantt
chart oI each proiect and to analyze the candidate solutions
produced by the proposed algorithm.
Siemens algorithm is executed iust one time Ior each
proiect. but because oI random behavior oI genetic
algorithm. it is executed 11 times and the averaged
execution time is used to compare with Siemens algorithm.
Supposing linear behavior Ior indirect costs curve. the slope
oI this line is K. For each proiect three values oI K have
considered. K3.4 and 5. With a higher value oI K. the
proiect`s optimum point is placed in the leIt side oI the
Time-Cost curve and vice versa. For example. a proiect
including 30 activities and K5 is shown in Fig. 7. In this
diagram. cost axis represents sum oI direct costs minus
reduced amount oI indirect costs.

Fig. 7. Time-Cost curve Ior one oI proiects with the size oI 30 activities and
k5.
In this algorithm. the population size is deIined as 2.5 *
number oI activities. Cross over rate is set to 0.7 . Mutation
rate depends on the calculated P1 and P2 values Ior each
gene and also relates to o and | variables that have been
given by user. ThereIore. mutation operator acts intelligently
based on each individual proiect`s properties. The results oI
comparing Siemens algorithm with the proposed algorithm
are shown in Table 3.
Reducing the complexity oI any problem is the main
advantage oI the suggested algorithm. It means the number
oI paths in the proiect`s network graph. does not have aIIect
on computation time because there is no need oI some CPM
computations that are required in Siemens algorithm.
2008 IEEE Congress on Evolutionary Computation (CEC 2008) 3085


Figure 6. Two points cross over

Table 3. The results oI comparing Siemens algorithm with the proposed algorithm

Table 3. shows that increasing oI proiect size has less
aIIect on computation time oI the proposed algorithm than
Siemens algorithm. Since behavior oI the new algorithm
depends on the values oI o and we studied three diIIerent
cases: o~|. o| and o|. In Iact. we can control searching
the problem space and we can Iocus on a special part oI it by
using these two variables. E.g.. Ior the proiect is shown in
Fig. 7. we can Iocus on the leIt halI oI time-cost curve by
deIining o~| because in this situation probability oI
increasing activities duration goes up. In contrast. Siemens
algorithm always starts searching the problem space Irom
the right oI Time-Cost curve. ThereIore. when the optimum
point is placed on the leIt side oI the curve. it takes more
time to reach the optimum point. As the results show. our
algorithm has better eIIiciency in the case oI K5 and o ~ |.
The weakness oI the suggested algorithm is that it does
not Iind sometimes the best solution because to get rid oI the
most oI CPM calculations. each activity starts at its earliest
possible date but sometimes it is necessary to delay start date
oI some activities to reach the optimum point.
6. CONCLUSION
In this paper we presented a new genetic algorithm to
solve Time-Cost Trade oII Problem (TCTP). In this
algorithm an intelligent mutation operator is introduced that
works based on properties oI each proiect. Also. to control
the searching oI problem space we used two control
variables. To show the eIIiciency oI the proposed algorithm.
we compared it with a Iamous algorithm called Siemens
algorithm. The results showed that although Siemens
algorithm is able to optimally solve small-sized instances.
we will have to rely on heuristic methods such as genetic
algorithms Ior solving larger and more complex problem
instances. Furthermore. these evolutionary algorithms will
also be able to handle large-scale real-liIe problems. The
subiect oI our Iuture research will be to add local search
ability to our algorithm and study other types oI
evolutionary algorithms such as Memetic Algorithms.
REFERENCES
|1| J. Prashant Reddy. S. Kumanan and O. V. Krishnaiah Chetty.
'Application oI Petri Nets and a Genetic Algorithm to Multi-Mode
Multi-Resource Constrained Proiect Scheduling . Springer-Verlag
London Limited .2001.
|2| J. Alcaraz and C. Maroto . 'A Robust Genetic Algorithm Ior Resource
Allocation in Proiect Scheduling . Department oI Statistics and
Operations Research. Universidad Politecnica de Valencia. Camino de
Vera s/n.. 46022 Valencia. Spain . 2001.
|3| Sonke Hartmman . 'Proiect Scheduling with Multiple Modes using a
Genetic Algorithm. Annals oI Operations Research 102. 111135.
2001.
|4| S. Kumanan . G. Jegan Jose . K. Raia . 'Multi-proiect scheduling
using an heuristic and a genetic algorithm . Springer-Verlag London
Limited 2006.
|5| Nicolai Siemens . 'A Simple CPM Time-Cost TradeoII Algorithm .
Management Science. Vol. 17. No. 6. Application Series Feb.. 1971.
|6| Don R. Robinson . 'A Dynamic Programming Solution to Cost-Time
TradeoII Ior CPM. Management Science. Vol. 22. No. 2. Oct.. 1975.
|7| Mitchell Melanie. 'An Introduction to Genetic Algorithms. A
BradIord Book The MIT Press Cambridge. Massachusetts London.
England FiIth printing. 1999.
|8| Mario Vanhoucke. Erik Demeulemeester and Willy Herroelen.
'Discrete Time/Cost Trade-oIIs in Proiect Scheduling with Time-
Switch Constraints. Feb. 2002.





3086 2008 IEEE Congress on Evolutionary Computation (CEC 2008)

S-ar putea să vă placă și