Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
University of Central Florida University of Central Florida
STARS STARS
Electronic Theses and Dissertations, 2004-2019
2011
Electimize A New Evolutionary Algorithm For Optimization With Electimize A New Evolutionary Algorithm For Optimization With
Applications In Construction Engineering Applications In Construction Engineering
Raheem, Mohamed Abdel University of Central Florida
Part of the Engineering Commons
Find similar works at: https://stars.library.ucf.edu/etd
University of Central Florida Libraries http://library.ucf.edu
This Doctoral Dissertation (Open Access) is brought to you for free and open access by STARS. It has been accepted
for inclusion in Electronic Theses and Dissertations, 2004-2019 by an authorized administrator of STARS. For more
information, please contact [email protected].
STARS Citation STARS Citation Abdel, Raheem, Mohamed, "Electimize A New Evolutionary Algorithm For Optimization With Applications In Construction Engineering" (2011). Electronic Theses and Dissertations, 2004-2019. 1996. https://stars.library.ucf.edu/etd/1996
ELECTIMIZE: A NEW EVOLUTIONARY ALGORITHM FOR OPTIMIZATION
WITH APPLICATIONS IN CONSTRUCTION ENGINEERING
by
MOHAMED ABDEL-RAHEEM
M.S. Industrial Engineering, University of Central Florida, USA (2010) M.S. Civil Engineering, Cairo University, Egypt (2006).
B.S. Construction Engineering, American University in Cairo, Egypt (1997). Green Belt, Lean Six Sigma, Harrington Institute & Strategy Associates, (2010)
A dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy
in the Department of Civil, Environmental and Construction Engineering in the College of Engineering and Computer Science
at the University of Central Florida Orlando, Florida
Summer Term 2011
Major Professor: Ahmed Khalafallah
ii
© 2011 Mohamed Abdel-Raheem
iii
ABSTRACT
Optimization is considered an essential step in reinforcing the efficiency of
performance and economic feasibility of construction projects. In the past few
decades, evolutionary algorithms (EAs) have been widely utilized to solve
various types of construction-related optimization problems due to their efficiency
in finding good solutions in relatively short time periods. However, in many cases,
these existing evolutionary algorithms failed to identify the optimal solution to
several optimization problems. As such, it is deemed necessary to develop new
approaches in order to help identify better-quality solutions.
This doctoral research presents the development of a new evolutionary
algorithm, named “Electimize,” that is based on the simulation of the flow of
electric current in the branches of an electric circuit. The main motive in this
research is to provide the construction industry with a robust optimization tool
that overcomes some of the shortcomings of existing EAs. In solving optimization
problems using Electimize, a number of wires (solution strings) composed of a
number of segments are fabricated randomly. Each segment corresponds to a
decision variable in the objective function. The wires are virtually connected in
parallel to a source of an electricity to represent an electric circuit. The electric
current passing through each wire is calculated by substituting the values of the
segments in the objective function. The quality of the wire is based on its global
resistance, which is calculated using Ohm’s law.
iv
he main objectives of this research are to 1) develop an optimization
methodology that is capable of evaluating the quality of decision variable values
in the solution string independently; 2) devise internal optimization mechanisms
that would enable the algorithm to extensively search the solution space and
avoid its convergence toward local optima; and 3) provide the construction
industry with a reliable optimization tool that is capable of solving different
classes of NP-hard optimization problems.
First, internal processes are designed, modeled, and tested to enable the
individual assessment of the quality of each decision variable value available in
the solution space. The main principle in assessing the quality of each decision
variable value individually is to use the segment resistance (local resistance) as
an indicator of the quality. This is accomplished by conducting a sensitivity
analysis to record the change in the resistance of a control wire, when a certain
decision variable value is substituted into the corresponding segment of the
control wire. The calculated local resistances of all segments of a wire are then
normalized to ensure that their summation is equal to the global wire resistance
and no violation is made of Kirchhoff’s rule. A benchmark NP-hard cash flow
management problem from the literature is attempted to test and validate the
performance of the developed approach. Not only was Electimize able to identify
the optimal solution for the problem, but also it identified ten alternative optimal
solutions, outperforming the existing algorithms.
Second, the internal processes for the sensitivity analysis are designed to
allow for extensive search of the solution space through the generation of new
v
wires. Every time a decision variable value is substituted in the control wire to
assess its quality, a new wire that might have a better quality is generated. To
further test the capabilities of Electimize in searching the solution space,
Electimize was applied to a multimodal 9-city travelling salesman problem (TSP)
that had been previously designed and solved mathematically. The problem has
27 alternative optimal solutions. Electimize succeeded to identify 21 of the 27
alternative optimal solutions in a limited time period. Moreover, Electimize was
applied to a 16-city benchmark TSP (Ulysses16) and was able to identify the
optimal tour and its alternative.
Further, additional parameters are incorporated to 1) allow for the
extensive search of the solution space, 2) prevent the convergence towards local
optima, and 3) increase the rate of convergence towards the global optima.
These parameters are classified into two categories: 1) resistance related
parameters, and 2) solution exploration parameters. The resistance related
parameters are: a) the conductor resistivity, b) its cross-sectional area, and c) the
length of each segment. The main role of this set of parameters is to provide the
algorithm with additional gauging parameters to help guide it towards the global
optima. The solution exploration parameters included a) the heat factor, and b)
the criterion of selecting the control wire. The main role of this set of parameters
is to allow for an extensive search of the solution space in order to facilitate the
identification all the available alternative optimal solutions; prevent the premature
convergence towards local optima; and increase the rate of convergence towards
the global optima. Two TSP instances (Bayg29 and ATT48) are attempted and
vi
the results obtained illustrate that Electimize outperforms other EAs with respect
to the quality of solutions obtained.
Third, to test the capabilities of Electimize as a reliable optimization tool in
construction optimization problems, three benchmark NP-hard construction
optimization problems are attempted. The first problem is the cash flow
management problem, as mentioned earlier. The second problem is the time cost
tradeoff problem (TCTP) and is used as an example of static optimization. The
third problem is a site layout planning problem (SLPP), and represents dynamic
optimization. When Electimize was applied to the TCTP, it succeeded to identify
the optimal solution of the problem in a single iteration using thirty solution
strings, compared to hundreds of iterations and solution strings that were used
by EAs to solve the same problem. Electimize was also successful in solving the
SLPP and outperformed the existing algorithm used to solve the problem by
identifying a better optimal solution.
The main contributions of this research are 1) developing a new approach
and algorithm for optimization based on the simulation of the phenomenon of
electrical conduction, 2) devising processes that enable assessing the quality of
decision variable values independently, 3) formulating methodologies that allow
for the extensive search of the solution space and identification of alternative
optimal solutions, and 4) providing a robust optimization tool for decision makers
and construction planners.
vii
To Allah
viii
ACKNOWLEDGMENTS
My sincere thanks and gratitude go to my advisor, Dr. Ahmed Khalafallah, for his
guidance, valuable advice, insightful feedback, continuous support throughout
the coursework of this PhD research.
I would like to acknowledge Dr. Amr Oloufa, Dr. Amir Behzadan, and Dr. Paul
Wiegand, who have served on my PhD Dissertation Committee for their
constructive feedback, and availability for guidance and consultation.
I would like to thank the Department of Civil, Environmental, and Construction
Engineering at UCF for their continuous financial support throughout the course
of my studies. Also, I would like to thank UCF for all the given support and
opportunities. In my life, I heard many slogans that never made sense to me.
Perhaps, the slogan I believe in the most is that “UCF Stands for Opportunity”.
I really cannot find the right words that would express my thanks and gratitude to
my parents for everything they have done for me. I really owe it all to them.
ix
TABLE OF CONTENTS
LIST OF TABLES…….………………………………………………………………xiv
LIST OF FIGURES………………………………………….……………………….xvii
CHAPTER 1: INTRODUCTION .........................................................................1
1.1 General Overview....................................................................................1
1.2 Problem Statement..................................................................................7
1.3 Philosophy.............................................................................................10
1.4 Research Objectives .............................................................................11
1.5 Methodology..........................................................................................14
1.6 Dissertation Organization ......................................................................17
CHAPTER 2: LITERATURE REVIEW .............................................................19
2.1 Introduction............................................................................................19
2.2 Evolutionary-Based Optimization: General Overview............................20
2.3 Optimization Problems in Construction Engineering..............................24
2.3.1 Time-Cost Tradeoff Problem (TCTP): .........................................25
2.3.2 Cash Flow Management .............................................................29
2.3.3 Travelling Salesman Problem (TSP)...........................................34
2.4 Evolutionary Algorithms Used in Solving Construction Optimization
Problems ...............................................................................................36
2.4.1 Genetic Algorithms: Overview.....................................................37
2.4.2 GAs: Algorithms..........................................................................39
2.4.3 Ant Colony Optimization .............................................................42
x
2.4.4 Foraging Behavior of Ants ..........................................................43
2.4.5 Ant Colony: Metaheuristic ...........................................................46
2.4.6 Ant Colony: Algorithm .................................................................50
2.5 Summary and Conclusion .....................................................................53
CHAPTER 3: DEVELOPMENT OF ELECTIMIZE ...........................................55
3.1 Introduction............................................................................................55
3.2 Description of the Algorithm ..................................................................55
3.3 Metaheuristic .........................................................................................59
3.4 Steps of the Algorithm ...........................................................................64
3.5 Illustrative Example ...............................................................................69
3.6 Summary and Conclusion: ....................................................................75
CHAPTER 4: ENABLING THE INDIVIDUAL ASSESSMENT OF THE
DECISION VARIABLE VALUES QUALITY ............................77
4.1 Introduction............................................................................................77
4.2 Methodology..........................................................................................78
4.3 Construction Cash Flow Management (CCFM): Overview ....................79
4.4 CCFM: Problem Modeling .....................................................................82
4.5 CCFM: Computer Coding ......................................................................84
4.6 CCFM: Application Example..................................................................86
4.7 CCFM Application Example: Results and Comparisons........................90
4.8 Summary and Conclusion .....................................................................93
xi
CHAPTER 5: DEVELOPING AND TESTING INTERNAL PROCESSES TO
EXPLORE THE SOLUTION SPACE EXTENSIVELY .............94
5.1 Introduction............................................................................................94
5.2 Methodology..........................................................................................95
5.3 Problem Modeling..................................................................................97
5.3.1 Modeling Schemes .....................................................................97
5.3.2 Using Electimize to Explore the Solution Space of the TSP ......99
5.4 Computer Coding ................................................................................111
5.5 Experimentation and Results...............................................................112
5.5.1 Results of the 9-City TSP Using Electimize ..............................113
5.5.2 Results of the 16-City TSP (Ulysses16) Using Electimize ........114
5.6 Summary and Conclusion ...................................................................117
CHAPTER 6: ENHANCING THE OPTIMIZATION MECHANISM OF
ELECTIMIZE..........................................................................119
6.1 Introduction..........................................................................................119
6.2 Methodology........................................................................................119
6.3 Objectives............................................................................................122
6.4 New Optimization Parameters.............................................................122
6.4.1 Resistance Parameters:............................................................123
6.4.2 Solution Exploration Parameters: .............................................126
6.5 Using the Modified Algorithm to Solve the TSP...................................130
6.6 Experimentation and Results for the Bayg29 TSP:..............................134
6.6.1 Comparison with Previous Results for Bayg29 TSP .................135
xii
6.7 Experimentation and Results for the Att48 TSP: .................................137
6.7.1 Comparison with Previous Results for Att48 TSP.....................138
6.8 Computer Coding: ...............................................................................141
6.9 Verification of the Previous Tested Capabilities: .................................141
6.10 Summary and Conclusion: ..................................................................142
CHAPTER 7: TESTING THE CAPABILITIES OF ELECTIMIZE IN SOLVING
CONSTRUCTION ENGINEERING OPTIMIZATION
PROBLEMS...........................................................................144
7.1 Introduction..........................................................................................144
7.2 Methodology........................................................................................145
7.3 Time-Cost Tradeoff Problem (TCTP): Overview..................................146
7.4 TCTP: Modeling...................................................................................147
7.5 TCTP: Computer Coding .....................................................................149
7.6 TCTP: Application Example and Results.............................................150
7.6.1 TCTP: Comparison with Previous Attempts..............................153
7.6.2 TCTP: Values Cross-Sectional Area (aij) ..................................154
7.7 Site Layout Planning Problem (SLPP): Overview................................160
7.8 SLPP: Modeling...................................................................................162
7.9 SLPP: Computer Coding .....................................................................170
7.10 SLPP: Application Example and Results .............................................171
7.10.1 SLPP: Comparison with Previous Attempts..............................175
7.11 Summary and Conclusion ...................................................................176
xiii
CHAPTER 8: SUMMARY, CONCLUSIONS, CONTRIBUTIONS AND FUTURE
RESEARCH...........................................................................178
8.1 Introduction..........................................................................................178
8.2 Summary .............................................................................................178
8.3 Conclusion...........................................................................................182
8.4 Research Contributions .......................................................................183
8.5 Future Research..................................................................................184
APPENDIX A: VBA CODES OF ELECTIMIZE AND MODELS DEVELOPED
FOR DIFFERENT PROBLEMS ATTEMPTED ......................186
APPENDIX B: PROBLEM DATA AND SOME RESULTS ..............................249
APPENDIX C: MANUAL CALCULATIONS .....................................................256
LIST OF REFERENCES...................................................................................263
xiv
LIST OF TABLES
Chapter 1
Table 1.1: Merit Evaluation of the Generated Chromosomes ..............................4
Chapter 3
Table 3.1: Intensity and Resistance of Generated Wires Based on the Given
Objective Function.........................................................................72
Table 3.2: Initial Calculation of Segment Resistances (rnm) for Different Values
(lnm) of (W6)....................................................................................73
Table 3.3: Selection Probabilities at Different Iterations Based on Value
Resistance (rlm)..............................................................................75
Chapter 4
Table 4.1: Different Possible Start Dates for Project Activities............................90
Table 4.2: Alternative Optimal Solutions Identified by Electimize for the Cash
Flow Problem ................................................................................91
Chapter 5
Table 5.1: Travel Distance Matrix of the 9-City TSP .........................................101
Table 5.2: Intensities and Resistances of the Wires Generated in Figure 5.3...102
Table 5.3: Probability Matrixes for Different Modeling Schemes of a 9-city TSP
with an Undefined Start City ........................................................109
Table 5.4: Probability Matrixes for Different Modeling Schemes of a 9-city TSP
with a Defined Start City ..............................................................109
xv
Table 5.5: Normalized Probabilities Used for the Selection of the First City at the
Beginning of any Iteration for the TSP with No Defined Start City
....................................................................................................110
Table 5.6: Alternative Optimal Solutions for the 9-City TSP..............................114
Table 5.7: Local Minima Identified by Electimize for the 9-City TSP.................114
Table 5.8: Best Tours Identified by Electimize for Ulysses16 (GEO) ................116
Table 5.9: Best Tours Identified by Electimize for Ulysses16 (ECU).................117
Chapter 6
Table 6.1: Best Tours Identified by Electimize for Bayg29................................136
Table 6.2: Best Tour Values Identified by Different Algorithm for the Bayg29 TSP
....................................................................................................136
Table 6.3: Best Tour Values Identified by Different Algorithm for the Att48 TSP
....................................................................................................140
Chapter 7
Table 7.1: Benchmark TCTP: Data of Activities Relationships, Times, and Costs
(Elebeltagi et al. 2005).................................................................151
Table 7.2: Optimal Solution for the Benchmark 18-Activity TCTP.....................152
Table 7.3: Comparison of Results and Parameters Settings of Different EAs
Used to Solve the TCTP..............................................................154
Table 7.4: Various Types of Data Used to Represent Cross-Sectional Area in the
TCTP...........................................................................................155
xvi
Table 7.5: Initial Availability Matrix of the Site Layout Example in Figure 7.11 (a)
....................................................................................................167
Table 7.6: Availability Matrix of the Site Layout Example in Figure 7.11 (a) after
the Allocation of Facilities A and B ..............................................168
Table 7.7: Fixed and Temporary Facility Attributes used in the Application
Example (Hegazy and Elbetagi 1999) .........................................172
Table 7.8: Proximity Matrix of Relationships between Facilities in the Application
Example (Hegazy and Elbetagi 1999) .........................................173
Table 7.9: Best Site Layout Settings for the Application Example ....................174
Table 7.10: Summary of Different Attempts Made to Solve SLPP Application
Example ......................................................................................176
xvii
LIST OF FIGURES
Chapter 1
Figure 1.1: Random Generation of a Population of Chromosomes ......................4
Figure 1.2: Selection Probabilities of Chromosomes ............................................4
Figure 1.3: Crossover Process between Chromosomes.......................................5
Figure 1.4: Mutation Process within the Same Chromosome ...............................5
Chapter 2
Figure 2.1: Different Time-Cost Relationships in Construction Projects (Ahuja
1983) .............................................................................................26
Figure 2.2: Time-Cost Tradeoff in Construction Projects (Abdel-Raheem 2007) 27
Figure 2.3: Cash Flow Profile..............................................................................31
Figure 2.4: Cumulative Net Cash Flow ...............................................................32
Figure 2.5: Binary Formulation of Chromosomes in GAs....................................38
Figure 2.6: Crossover Process between Two Parent Chromosomes..................41
Figure 2.7: Mutation Process of a Chromosome.................................................41
Figure 2.8: Pseudocode of Genetic Algorithm (Elbeltagi et al. 2005)..................42
Figure 2.9: Different Cases of the Double Bridge Experiments. (a) Branches of
Equal Lengths, (b) Branches of Different lengths (Dorigo and
Stützle 2004). ................................................................................45
Figure 2.10: Foraging behavior of ants and communication via pheromone trails
(Christodoulou 2005). ....................................................................45
Figure 2.11: Graphical Representation of TSP (Maier et al.2003) ......................47
xviii
Figure 2.12: ACO Metaheuristic Pseudocode (Dorigo and Stützle 2004). .........50
Figure 2.13: Construction of Solutions (Elbeltagi et al. 2005) .............................51
Figure 2.14: Pseudocode of ACO for the TCT Problem (Elbeltagi et al., 2005) ..53
Chapter 3
Figure 3.1: Variable Representation in the Developed Algorithm .......................57
Figure 3.2: Solution Population Represented as an Electric Circuit ....................58
Figure 3.3: Pseudocode of Electimize Metaheuristic ..........................................63
Figure 3.4: Pseudocode for Electimize ...............................................................71
Figure 3.5: Substitution of Trial Values in the Objective Function to Determine
Intensity (In) ...................................................................................72
Figure 3.6: Calculating the Modified Resistance (r*nm) for Different Segments of
(W2) ...............................................................................................74
Chapter 4
Figure 4.1: Basic steps of Electimize ..................................................................78
Figure 4.2: Utilizing the Non-critical Activity Float to Minimize the Cash Overdraft
......................................................................................................81
Figure 4.3: Wire Representation of the Project Activities Possible Start Dates
Scenarios ......................................................................................82
Figure 4.4: Individual Assessment of the Quality of Different Start Dates...........84
Figure 4.5: Using Microsoft Project to Schedule the Project and Store project
Data...............................................................................................85
Figure 4.6: Cash Flow Distribution for Various Activities Start Dates Scenarios.86
xix
Figure 4.7: Activity Network of the Cash Flow Management Application Example
......................................................................................................87
Figure 4.8: Original Cash Flow Profile of the Application Example .....................87
Figure 4.9: Gantt Chart and Overdraft Profile of the Application Example ..........88
Figure 4.10: Cash Flow Distribution of the Optimal Solution...............................92
Chapter 5
Figure 5.1: Multiple Global Minima for a Hypothetical Multimodal Minimization
Problem .........................................................................................96
Figure 5.2: Different Modeling Schemes of the TSP Using Electimize................99
Figure 5.3: Wire Representation of a 9-City TSP Tour......................................100
Figure 5.4: Different Cases of the TSP Sensitivity Analysis using the First
Modeling Scheme (Segment Values to Be Evaluated are in Blue)
....................................................................................................104
Figure 5.5: Different Cases for Evaluating Different Wire Segments Using the
Comparison Wire in the Second Modeling Scheme ....................105
Figure 5.6: Calculating the Modified Local Resistances of Segments in the First
Modeling Scheme........................................................................106
Figure 5.7: Calculating the Modified Local Resistances of Segments in the
Second Modeling Scheme...........................................................106
Figure 5.8: The Four Relationship Changes Occurring in the Comparison Wire
during the Sensitivity Analysis .....................................................107
Figure 5.9: Changes Accommodated in the Probability Matrix after Selection of
Values from the Solution Space for the Two Modeling Schemes 111
xx
Figure 5.10: Screenshot of the User Interface Developed for the TSP .............112
Figure 5.11: Convergence toward Optimal Solution for Ulysses16 (GEO) Using
Electimize ....................................................................................116
Figure 5.12: Convergence toward Optimal Solution for Ulysses16 (ECU) Using
Electimize ....................................................................................117
Chapter 6
Figure 6.1: Different Values of Segment 2 (equal ρm, different aml and bml)...125
Figure 6.2: Individual Evaluation of Values in the Sensitivity Analysis Step......129
Figure 6.3: Areas Corresponding to Decision Variable Values for the First Wire
Segment in the 9-City TSP ..........................................................131
Figure 6.4: Convergence toward Optimal Solution for the Bayg29 TSP Using the
Modified Version of Electimize ....................................................135
Figure 6.5: Optimal Tour of the Capitols of the 48 States of USA.....................138
Figure 6.6: Convergence toward Optimal Solution for the Att48 TSP Using the
Modified Version of Electimize ....................................................139
Figure 6.7: Convergence toward Optimal Solution for the Ulysses16 TSP Using
the Modified Version of Electimize...............................................142
Chapter 7
Figure 7.1: Wire Representation of a Project Activities-Execution Scenario .....148
Figure 7.2: Individual Evaluation of Segment Values (Construction Method) ...149
Figure 7.3: User Interface to Collect Additional Project Data ............................150
xxi
Figure 7.4: Convergence towards CM with the Least Time for Cross-sectional
Area represented as (ΣTij/ tij). ......................................................156
Figure 7.5: Convergence towards CM with the Least Cost for Cross-sectional
Area represented as (ΣCij/ cij). .....................................................157
Figure 7.6: Convergence of Selection Probabilities for Cross-sectional Area
represented as (cij/ tij) ..................................................................158
Figure 7.7: Convergence of Selection Probabilities for Cross-sectional Area
represented as (tij/ cij) ..................................................................158
Figure 7.8: Selection Probabilities of Different CMs for Cross-Sectional Area
Represented as the Unity (aij =1).................................................160
Figure 7.9: Placement of Facilities on a Grid of Equal Areas as in Evosite (Hegazi
and Elbeltagi 1999)......................................................................164
Figure 7.10: A Randomly Generated Chromosome & Facilities Allocation on Site
according to Evosite (Hegazi and Elbeltagi 1999) .......................165
Figure 7.11: Modeling Temporary Facilities using Wires in Electimize .............166
Figure 7.12: Sensitivity Analysis Step for SLPP Modeling Using Electimize.....169
Figure 7.13: Screenshots of the Site Layout Software ......................................171
Figure 7.14: Construction Site of the Application Example (Hegazy and Elbetagi
1999) ...........................................................................................172
Figure 7.15: Electimize Convergence towards the Optimal Solution.................174
Figure 7.16: Final Site Layout Plan of the Application Example for Different
Attempts ......................................................................................176
1
CHAPTER 1: INTRODUCTION
1.1 General Overview
In the construction industry, optimization1 is considered a major and
necessary approach to ensure the financial feasibility and guarantee the
profitability of projects. It plays an important role in enhancing the efficiency of
various systems processes within a single project. The parameters constituting
such systems are incorporated in computational models developed to solve
various construction-related optimization problems. Optimization problems in
construction engineering have different objectives that- for example- target time,
cost, quality, safety, risk, cash flow, routing, resource, and facility layout
managements. Therefore, there is a compelling need for the development and
enhancement of optimization problem-solving techniques.
In the past few decades, simple mathematical techniques were sufficient
to find optimal/near-optimal solutions for limited problems within reasonable time.
However, with the introduction of new construction techniques, new regulations,
the application of new sophisticated construction systems, and the ever
increasing global rivalry in such difficult economic times, several new parameters
are introduced to such problems that render the optimization models complex
and hard to solve in a polynomial timeframe, i.e. NP-hard. For example, the
1 Optimization is a mathematical term refers to finding the maximum or minimum value of a given function- referred to as the objective function- that is composed of a number of variables. Each variable has a definite range of values known beforehand. Optimization problems aim at finding the best combination of these values that achieve the least or largest possible value if substituted in the given function.
2
introduction of construction safety and security objectives in addition to the
traditional objective of minimizing the resource travel distance and time on site,
made site layout planning problems very complex to solve (Khalafallah 2006).
In the past decade, the application of evolutionary algorithms (EAs) in
construction served as a quite acceptable alternative technique for solving many
optimization problems. For most problems, few EAs were able to reach
optimality; however, the majority of EAs reported solutions that are believed to be
close to the optimal ones in a relatively short time (Elbeltagi et al., 2005). In other
words, there is no single EA that guarantees reaching optimality in all types of
optimization problems.
In EAs, a pool of random possible solutions (population) is generated,
where each individual in the population is modeled as an array (matrix) carrying
different values of the parameters of the objective function. Each array is then
substituted in the objective function and its relative merit (fitness) is computed
and compared to other arrays. The major problem with some EAs is that each
solution string is evaluated altogether without considering the performance of
each value in the string independently. Consequently, the convergence rate and
chances of reaching the optimal solution decrease dramatically.
To demonstrate the complexity of construction optimization problems, and
the shortcomings of existing EAs, a simple hypothetical example is provided.
Two temporary facilities (O and P) are to be allocated space on a construction
site. The construction site plan is a square and is divided into 9 grid units, as
3
shown in Figure 1.1. A permanent facility (Q) already exits in the far southeast
corner of the construction site. In order to minimize resource travel times and
maximize construction safety, the main objective of this problem is to allocate the
given temporarily facilities (O and P) so that: (1) Facility O is located as close as
possible to Facility P; (2) facility O is located as close as possible to fixed facility
Q; and (3) facility P is located as far as possible from facility Q (Hegazy, 2000).
To demonstrate the application of EAs in solving construction optimization
problem, Genetic Algorithms (GAs) was used to find the optimal solution for this
hypothetical example as one of the most popular EA used in solving construction
optimization problem. The objective function of this problem is given in Equation
(1.1).
nij ij
i 1 Minimize : (S W ) (1.1)
=×∑
Where: Sij: Distance between facilities (i) and (j); n: total number of facilities, and
Wij: Weight reflecting the desired closeness between facilities (i) and (j), as
follows: WOQ=100, WOP=100, and WPQ=-100.
The first step is to create a population of solution strings (chromosomes)
by randomly selecting values from the solution space, as shown in Figure (1.1).
Each chromosome is evaluated by substituting its values in the problem objective
function, as shown in Equation (1.1). The chromosomes are then assigned a
certain merit that represents the quality of the solution, as shown in Table 1.1.
4
(b) (c) (d) (a)
1 2 3
2
1
3
i
j
P
O
Q
1 2 3
2
1
3
i
j
Q
O
P
1 2 3
2
1
3
i
j
Q O
P
1 2 3
2
1
3
i
j
QP
O
Chromosome (a) Oi Oj Pi Pj
3 1 1 2Oi Oj Pi Pj
1 3 3 1Oi Oj Pi Pj
1 1 2 3Oi Oj Pi Pj
1 1 3 2
Chromosome (b) Chromosome (c) Chromosome (d)
Figure 1.1: Random Generation of a Population of Chromosomes
Table 1.1: Merit Evaluation of the Generated Chromosomes
Chrom. Score Merit Relative Merit %a Score (a) = 4*100+2*100-2*100 = 400 (400+200+600+600)/400 = 4.5 4.5*100/19.5 = 23.08b Score (b) = 3*100+2*100-3*100 = 200 (400+200+600+600)/200 = 9 9*100/19.5 = 46.15c Score (c) = 3*100+4*100-1*100 = 600 (400+200+600+600)/600 = 3 3*100/19.5 = 15.38d Score (d) = 3*100+4*100-1*100 = 600 (400+200+600+600)/600 = 3 3*100/19.5 = 15.38
19.5 100%Total
Based on the merit of solutions, new values are selected for the processes
of crossover and mutation. Random numbers are generated to select parent
chromosomes to perform crossover and mutation. For example, any number in
the range of ]23.08, 69.23] will result in selecting chromosome (b), as shown in
Figure 1.2.
0 23.08 69.23 84.61 100
a b c d
Figure 1.2: Selection Probabilities of Chromosomes
The process of crossover aims at enhancing the solution by exchanging
information among the selected chromosomes (usually the best chromosomes,
5
according to the probability of selection) in the population, as illustrated in Figure
1.3. On the other hand, the process of mutation entails the exchange of
information within the same chromosome itself, as shown in Figure 1.4. Suppose
that 90% of the population will be subject to crossover and 10% will undergo
mutation. For crossover, the random numbers generated are 19.67 and 72.34;
this means that chromosomes (a) and (b) will be selected. For mutation, the
random number generated is 67.17, which means that chromosome (b) is
selected. The aforementioned steps represent one iteration in the procedure of
using GAs to solve this optimization problem. These steps are repeated over a
number of iterations until the optimal/near-optimal solution is generated. Further
details are given about GAs in Chapter 2.
1 3 3 1 1 1 2 1
1 1 2 3 1 3 3 3
1 2 3
2
1
3
i
jQ
OP(a)
(c) Invalid Offspring
Figure 1.3: Crossover Process between Chromosomes
3 1 1 2 3 2 1 1(b)
1 2 3
2
1
3
i
jQ O
P
Figure 1.4: Mutation Process within the Same Chromosome
For this simple example, there are 112 potential solutions. If the given site
layout grid is increased to (10 x10) and the number of facilities are increased by
6
one, the number of solutions available for the problem jumps to 2,823,282
solutions.
From the previous example, two main points can be noted. First, this
problem (similar to other construction optimization problems) is not an easy
problem to solve using enumeration of all possible solutions. A robust
optimization method is required to generate the optimal solution in polynomial
time. Second, as the number of variables (solution space) increases linearly, the
computation times increases exponentially. Third, the method of evaluating the
quality (merit) of candidate solutions is deficient as it does not reflect the actual
merit of each value in the solution string individually (Abdel-Raheem and
Khalafallah 2009).
Further, the obvious fact is that each solution string is created randomly
with good and bad values. However, most evolutionary algorithms evaluate and
generate solution strings without explicitly giving due consideration to the
individual quality of each value in the string, as shown in the previous example
using GAs. This in turn limits the capability of these algorithms to reach the
optimal solution. The notion of assigning equal merit to all the values of the same
solution string is common in current EAs such as Genetic Algorithms, Memetic
Algorithm, Ant Colony Optimization, Particle Swarm optimization, Shuffled Frog
Leaping, and many others, as discussed in chapter 2 in more detail.
This doctoral research presents the development and application of a new
evolutionary algorithm, named Electimize, which accounts for the aforementioned
7
shortcomings and limitations of some current EAs. The main objective of this
research is to present a robust algorithm that improves the effectiveness of
optimization processes and, as such, assist decision makers in developing and
generating better solutions for a variety of optimization problems.
1.2 Problem Statement
The advancement in construction engineering is always subject to the
innovation in other disciplines. This stems from the fact that construction
engineering is an applied science. In construction engineering, there are multiple
optimization problems that require reliable tools to guarantee finding optimal
solutions within acceptable computational time frame. Most of the current
optimization techniques proved to have limitations with respect to solving the
sophisticated optimization problems encountered in the field of construction
engineering.
Optimization is a branch of mathematics that deals with problems that
have a number of possible solutions, with one or few of these solutions having
best fit and termed optimal solution(s). In general, it is a complex and impractical
process to go through all the available solutions in order to identify the optimal
one.
In the past, solving optimization problems revolved mainly around using
mathematical techniques. However, the variability in the nature of optimization
problems made it hard - if not impossible - to mathematically design one model
that is capable of solving all types of optimization instances. Consequently, a
8
number of mathematical models emerged, each of which is concerned with a
specific type of optimization. Examples of these techniques are: linear
programming, non-linear programming, and integer programming. The
advancements made in Computational Science and Information Technology in
general brought more flexibility to the optimization field rendering mathematical
techniques limited and cumbersome to use.
In the seventies, evolutionary algorithms emerged as a substitute for the
traditional mathematical models, in attempt to make up for the shortcomings and
limitations of mathematical techniques. However, some of these EAs are
considered limited in their capabilities of reaching optimal solutions, especially in
two main aspects. First, EAs deal with candidate solutions indifferently and do
not consider the potential of each individual decision variable in affecting the
solution. For instance, GA simulates the behavior of human beings through its
search for the best genes in a population of chromosomes representing a group
of individuals. In this case, the genes that constitute a chromosome receive the
same appreciation, when the fact is there could be good and bad genes within
the same chromosome. Although the processes of crossover and mutation
usually help in promoting some of the promising individuals and/or genes, the
explicit lack of mechanisms to evaluate the potential of each decision variable
and its various values certainly affects the convergence rate and the chances of
reaching the optimal chromosome. This limitation is also apparent in Ant Colony
Optimization (ACO), where each ant represents a feasible solution whose values
receive the same pheromone reward regardless of their individual potentials on
9
affecting the solution. As such, there is a need for an algorithm that is capable of
evaluating the potential of each variable of a solution string in order to improve
the efficiency of optimization.
Second, current EAs strive to simulate common behaviors of certain
species, without paying much attention to the change in the surrounding
environment. Most species adapt to the changes in the ecological system
surrounding them by changing their behavior- and that is the main reason of their
survival-, while most EAs adopt a common behavior that is not necessarily
guaranteed to be the best. This greatly affects the efficiency of the algorithm,
especially in solving problems that are dynamic in nature. For example, Dorigo’s
ACO is based on simulating the foraging behavior of ants and their ability to
select the shortest paths between nests and sources of food. Deneubourg and
colleagues in 1989 and 1990 investigated the foraging behavior of ants through
an experiment in which they utilized a double bridge to connect a source of food
with a nest of ants of the Argentine type. They ran three experiments; in each
one, they changed the lengths of the bridges. In one of the three experiments,
the ants did not choose the shortest path (Dorigo, and Stützle, 2004). Therefore,
it is deemed necessary to develop a new algorithm that accounts for these
shortcomings in hopes of generating better solutions in polynomial computation
time.
10
1.3 Philosophy
To overcome the shortcomings of other EAs, two points should be taken
into consideration. First, the adaptation of species to the conditions of the
environment through transformation and evolution is too complex to capture
computationally, and therefore the quest is for a natural phenomenon in which
the individuals tend to respond consistently to the changes in their environment
with the same behavior. Second, it is essential to find a way to evaluate the
performance of each entity in the system independently.
The natural phenomenon of electric current flow in conductors seemed to
be suitable for this purpose. The electric current is induced by the flow of
electrons in a designated medium. The intensity of the current induced is based
on the resistance of the medium to the flow of electrons through it. Therefore,
changing the medium’s resistance will result in a consistent change in the
intensity of the current.
It is worth mentioning that the only method that guarantees solving all
types of optimization problems is the exhaustive search. In exhaustive search, all
values in the solution space are enumerated through combinations and
permutations to determine the optimal solution(s). This method is clearly
impractical and computationally inefficient, as some problems would require very
long time to solve using high-tech computers. On the other hand, EAs are
considered relatively computationally efficient as they would not require the
enumeration of all possible solutions in order to generate the optimal/near
11
optimal solutions. However, none of the existing EAs can guarantee reaching
optimality for all types of problems. In general, the competition among EAs lies in
the quality of generated solutions and the computation time.
1.4 Research Objectives
The main motive in this research is to cross the boundaries of science
application and take a step forward toward theory innovation. The need for a new
reliable optimization tool has become an urgent necessity due to the
aforementioned factors. Therefore, the main goal of this research is to develop
an algorithm that is: 1) capable of reaching better optimal solutions for
optimization problem compared to existing techniques in reasonably acceptable
computational time, and 2) applicable to a wide variety of construction discrete
optimization problems.
In order to achieve this main research goal, it deemed essential to define
a number of objectives to serve as milestones and help guide the research
towards achieving the main research goal. These objectives are:
1. Developing an Optimization Methodology to Assess the Quality of
Each Value in the Solution String Independently:
The first objective in this research is to design a new method that permits
the evaluation of each decision variable value in the solution string
independently rather than evaluating the values collectively. In order to
12
achieve this objective, a number of research questions need to be
addressed.
Research Questions:
a) What is the impact of individual quality assessment of values on
reaching optimality? b) How can the quality of each decision variable
value be assessed and quantified? c) How can the individual quality of
decision variable values be related to the overall quality of the solution
string?
Hypothesis:
It is assumed that the individual assessment of the solution strings value
would help direct the search faster toward the optimal solution. A new
evolutionary algorithm can be developed and equipped with a method for
assessing and quantifying the quality of each value in the solution string
independently. The quality of each value in the solution string can then be
proportioned to the overall quality of the solution string.
2. Formulating Mechanisms to Enable the Efficient Exploration of the
Solution Space:
The second research objective is to formulate new methodologies that
enable the extensive search of the solution space for discrete optimization
problem in order to generate all the alternative optimal solutions. In order
to achieve this objective, the following research questions need to be
addressed.
13
Research Questions:
a) What are the anticipated benefits of the extensive search of the solution
space compared to the cost of achieving it? b) Is the computational time a
main concern in this research? And if yes, c) What is the impact of this
process on the computational time? d) How can the algorithm be designed
to enable the extensive search of the solution space?
Hypothesis
The extensive search of the solution space is expected to guide the
search toward generating the optimal solution and identifying all possible
optimal solutions for the problem. This in turn will prevent the search from
being trapped in any local optima. The computational time to achieve this
capability will not be a main concern in this study. However, it is expected
that this process will slightly increase the computational time. The
extensive search of the solution space can be accomplished by devising
an internal mechanism that would allow the consideration of all possible
values available in the solution space.
3. Providing a Reliable Optimization Tool to the Construction Industry:
The proposed algorithm is intended to serve as a reliable tool for solving
different discrete optimization problems in the construction industry. For
this reason, the application problems selected to demonstrate the
capabilities of the algorithm should be related to the construction industry.
14
Research Questions:
a) How will the anticipated benefit of this optimization tool to the
construction industry be demonstrated? b) How will the effectiveness of
the new technique in solving construction optimization problem be
assessed? c) What will make the construction engineering community
prefer this new technique over the current existing optimization
techniques?
Hypothesis
The anticipated benefit of the optimization technique can be demonstrated
by solving a wide range of difficult construction-related optimization
problems. The effectiveness of the optimization technique can be
assessed through its application to a number of benchmark construction
problems of different optimization classes, and comparison of its
performance to previous results. The quality of the solution obtained can
be used as a strong argument for claiming an advantage over the existing
optimization techniques.
1.5 Methodology
The proposed methodology for conducting this research is comprised of
the following:-
15
1. Literature Review:
Extensive review of previous work will be conducted. The review is
intended to cover: 1) the basic theories in evolutionary computation and its
different algorithms with a primary focus on their advantages and
limitations, and 2) the most common optimization problems in construction
engineering that have been attempted and the best solutions that have
been reported.
2. Devising a New Optimization Algorithm:
This step entails the hypothetical design of the algorithm and should
accommodate two substantial points: 1) the ability to assess the quality of
each value of the solution string individually, 2) the capability of
extensively searching the solution space in order to identify all possible
optimal solutions. Manual simulation will be used to solve small-size
optimization problems in order to help trace the performance of the
algorithm and help edit/modify its main steps. Flow charts and
pseudocode will be the outcome of this stage. This stage helps will help in
the preparation for the actual computer coding as will be discussed in the
following step.
3. Implementing and Testing the Capability of Assessing the Quality of
Decision Variable Values:
The algorithm will be applied to NP-hard benchmark optimization
problems. The innovated method that will be used for the individual
16
quantification of the quality of values will be deployed to monitor and trace
the criterion of selecting values from the solution space. In other words, it
is expected that values comprising the optimal solution would have the
highest qualities.
4. Developing and Verifying the Capability of Exploring the Solution
Space:
The algorithm will be applied to multimodal, NP-hard benchmark problem.
A multimodal optimization problem is a problem that has multiple
alternative optimal solutions. The capability of the algorithm of searching
the solution space will be assessed based on the number of alternative
solutions it will identify.
5. Evaluating the Reliability of the Algorithm in Solving Construction
Discrete Optimization Problems:
The algorithm will be applied to different types of NP-hard construction
optimization problems. The reliability of the algorithm as an optimization
tool will be assessed based on the quality of results obtained in
comparison to previous attempts made using other EAs.
6. Comparing the Performance of the Proposed Algorithm with other
EAs:
The results obtained by the proposed algorithm in solving different
benchmark optimization problems will be compared to the results reported
by other EAs in solving same problems. The comparison focuses mainly
17
on the quality of solution(s) obtained rather than the computational time.
This is due to the fact that assessing the performance of the algorithm
based upon computational time would entail conducting a separate robust
study.
1.6 Dissertation Organization
The dissertation is organized into seven main chapters in addition to this
one. Chapter 2 primarily focuses on: 1) Some of the major optimization problems
in construction engineering and the previous models developed to solve them,
and 2) Two evolutionary algorithms that have been extensively used in solving
construction optimization problems, namely Genetic Algorthms and Ant Colony
Optimization. Chapter 3 provides the detailed steps of the development of the
algorithm and specific internal processes with main emphasis on the design and
verification of the algorithm through its application to simple problems. Chapter 4
addresses the first objective of this research through testing the internal
processes developed to enable the proposed algorithm to individually assess the
decision variable values and their impact on achieving optimality. Chapter 5
discusses the second objective of this research through the methodology used in
assessing the capability of the proposed algorithm of searching the solution
space extensively, and its expected advantages and applications. Chapter 6
highlights further modifications that were introduced to the proposed algorithm
during the coursework of the research and deemed essential to enhance its
performance. Chapter 7 addresses the third objective of this research through
18
the different applications of the proposed algorithm in solving construction
engineering discrete optimization problems. Chapter 8 presents a comprehensive
summary for the dissertation, the main contributions of the research, and
recommendations for future studies.
19
CHAPTER 2: LITERATURE REVIEW
2.1 Introduction
The construction industry is characterized by the sophistication of various
engineering systems integrated to provide the target functionality of a given
construction project. Such systems often require optimization to guarantee the
financial feasibility of the project in whole. Over years, many attempts have been
made to solve a wide variety of construction optimization problems. The
techniques used in solving these problems varied in nature between
mathematical and heuristics. In the past few decades, the shift in emphasis was
toward the application of evolutionary algorithms (EAs) in optimizing construction
problems. Different EAs have been utilized and comparative analyses were
conducted in attempts of finding better quality solutions.
This chapter presents an extensive review of the previous work conducted
in the area of construction optimization problems, and the alternative optimization
techniques used to solve them. The reviewed work provides the main bases for
developing the models needed to accomplish the objectives of this doctoral
research. The methodology adopted in this chapter classified the reviewed work
into three main categories: 1) General discussion about optimization, which
includes the most common terminologies, types of optimization problems and
theories; 2) The most popular optimization problems in construction, which
includes a detailed description of these problems, and a discussion about
previous models and techniques used to solve them; 3) The most common
20
evolutionary algorithms used to solve these problems, which includes a detailed
description of these algorithms along with their basic steps of optimization. The
majority of the literature discussed in this chapter was covered previously in
Abdel-Raheem (2007).
2.2 Evolutionary-Based Optimization: General Overview
The application of mathematical techniques in solving construction
optimization problem has been very limited. This is due to their inadequacy to
solve a wide variety of construction optimization problems, complexity in
application, and limitation to small-to-mid size problems. On the other hand,
evolutionary algorithms (EAs) have been utilized as a quite acceptable
alternative for solving construction optimization problem due to their time
efficiency demonstrated by ability to find good solutions in a relatively short time.
This section presents the most common terminologies, classifications of
problems, and theories in evolutionary-based optimization.
1. “Heuristic: It is a term used to refer to algorithms used in solving
combinatorial problems. These are usually approximate methods that yield
near-optimal solutions (Abdel-Raheem 2007).”
2. Metaheuristic: It is a main general strategy for deploying and directing a
set of heuristics to search the solution space for better solutions in an
attempt of reaching optimality (Dorigo and Stützle 2004).
21
3. NP-Hard: It is a classification of optimization problem that cannot be
solved in deterministic polynomial time. In general, there is no known
algorithm that can solve an NP-hard problem in a polynomial time frame.
An NP-complete is the hardest problem in the NP-hard class. This means
that if a polynomial-time algorithm could solve an NP-complete problem,
then other NP-hard problems in this class can be solved in a polynomial
time. A very well known example of the an NP-complete problem is the
travelling salesman problem (Blondel and Tsitsiklis 2004).
4. Combinatorial Optimization Problem: It is an optimization problem that
aims at finding the optimal values for different discrete decision variables
of the objective function. Some combinatorial optimization problems are
classified as NP-hard due to the incapability of solving them in a
polynomially bounded computation time. A combinatorial optimization
problem can be represented by ψ, which is denoted by (K, Λ, Φ). K:
represents the set of all solutions available in the solutions space, Λ: is the
objective function that has a solution κ K. Φ: is the set of the problem
constraints. A feasible solution for ψ is a value Λ (κ) that satisfies the set
of constraint Φ. The travelling salesman problem is an example of a
combinatorial optimization problem (Maier et al. 2003).
5. Computational Complexity: It aims at measuring the difficulty of the
optimization problem. This can be achieved using the concept of worst-
case complexity, which assesses the difficulty of an optimization problem
based on the maximum time needed by an algorithm to find its optimum
22
values. A very important theory that assesses the difficulty of optimization
problems is the NP-completeness, which classifies optimization problems
in two main categories: 1) Tractable, which represents problems that can
be solved in a deterministic polynomial time; and 2) Intractable, which
includes problems that cannot be solved within a polynomial time frame.
For intractable problems, the computational time grows exponentially with
the instance2 size (Dorigo and Stützle 2004).
6. Solving NP-Hard Problems: An NP-hard problem can be solved using:
1) Exact; or 2) Approximate techniques. An example of exact technique is
Exhaustive Search. Although Exhaustive Search guarantees optimality, it
requires a very long computational time that renders it impractical in most
cases. In Exhaustive Search, all possible values in the solution space are
enumerated in search of the optimum values. However, the computational
time increases exponentially when the number of the objective function
decision variable increases lineally. Although this technique is impractical
in solving large instances, it can be very efficient in solving small ones.
Examples of Exhaustive search techniques are divide and conquer,
cutting plane, and branch and bound.
An example of approximate techniques is Heuristic Search techniques.
These are search algorithms that explore the solution space, and
randomly select values in search of an optimal or near optimal solution. A
2 “Instance is a term refers to a problem with specified values for all parameters (Dorigo and Stützle 2004).”
23
heuristic technique is a set of steps that are directed toward optimal or
near optimal solution at a reasonable computational time. In most cases, it
does not guarantee optimality nor does it tell how close the solution from
optimality is. Usually, the solutions cannot be verified, and the assumption
is that heuristic are feasible, meeting all constraints, and that the solution
is near optimal. Heuristics are used, when the time dimension is much
more important than the quality of the solution. Examples of heuristics are
Genetic Algorithms, Simulated Annealing, Tabu Search and Ant Colony.
The quality of the results obtained by a heuristic algorithm depends on the
quality of the algorithm itself. There are two ways to assess the quality of a
heuristic algorithm: a) Analytical approach, which utilizes methods of
combinatory analysis, theories of inequalities and bound to assess the
performance of the heuristic; and b) The empirical approach, which relies
on computational experiments, and the performance of the heuristic with
respect to benchmark problems (Dorigo and Stützle 2004). In this doctoral
research, the empirical approach is used to assess the performance of
Electimize. The performance of any heuristic can be improved by tuning
its parameters. The way a heuristic algorithm works remains unchanged,
but what accommodates the changes are its parameters (Dorigo and
Stützle 2004).
7. Local Search: It is a metaheuristic that aims at improving the obtained
solution for hard combinatorial optimization problems. It undertakes
iterative exploration of neighborhood solutions trying to improve the
24
current one by local changes. The first step in applying local search to the
problem is defining the neighborhood structure. The local search then
starts searching for an improved solution within the neighborhood of the
current solution. Once an improved solution is found, it replaces the
current one. These steps are repeated until no better solution is found in
the neighborhood (Dorigo and Stützle 2004).
8. No Free Lunch Theorem: This theory states that all optimization
algorithms have the same performance when averaged over all available
instances. No algorithm is better than any other. If an algorithm
demonstrates a higher capability in solving a certain class of instances
compared to other algorithms, there must be another class where the
same algorithm is outperformed by others (Wolpert and Macready 1995).
2.3 Optimization Problems in Construction Engineering
In any construction project, there is a multitude of optimization problems of
various objectives. The applied solutions of such problems often dictate the level
of effectiveness in executing different activities as well as the overall profitability
of the project. In the past few decades, many attempts have been done in
solving construction optimization problems utilizing the available EAs. The work
done mostly focused on solving a number of combinatorial optimization problems
in construction engineering, and comparing the performance of more than one
EA in solving them. This section explores three of the most popular optimization
problem in construction engineering, and the previous evolutionary algorithms-
25
based models used to solve them. These three problems will be attempted using
Electimize for the purpose of verification and validation of the algorithm
performance. The three problems are: 1) Time-cost tradeoff problem; 2) Cash
flow management; and 3) Travelling salesman problem
2.3.1 Time-Cost Tradeoff Problem (TCTP):
In construction engineering, there is a relationship between the duration of
the project activity and its direct costs. Such relationship can be described as an
inverse relationship in the sense that the activity direct costs decreases as the
activity duration increases. The relationship between time and cost is derived
from the fact that there are different construction methods available for executing
a given activity. Each construction method has its own duration and cost.
There are four different representations for the relationship between time
and cost as follows: 1) Linear relationship between time and cost; 2) Multi-linear
relationship at different time intervals; 3) Discrete Function; and 4) Curvilinear
continuous relationship, as shown in Figure 2.1 (Ahuja 1983).
The Time-Cost curves suggest different completion times for every single
activity with varying corresponding direct costs. Such timings and costs represent
the various alternatives available for executing the activity. Each alternative has a
unique resource rate that changes the duration and the cost of the activity. This
results in a huge pool of alternatives for executing a single project. For every
single project, there are many scenarios for executing the same project.
26
The variety of alternatives available for executing a single project makes it
an uneasy task for the planner to decide on which alternative to utilize. The
selection goes through a variety of crew sizes, equipment, methods, and
technologies to execute the activities of the project. The criterion of selection is
based on how economic the alternative is; and the priority goes to the alternative
cheaper in cost and shorter in duration (Feng et al. 1997).
9 10 11 12 13 14 15 16
100 200 300
400 500 600
Cos
t
Time a) Linear
9 10 11 12 13 14 15 16
100200300
400500600
Cos
t
Time b) Multi-Linear
9 10 11 12 13 14 15 16
100200300
400500600
Cos
t
Time d) Curvilinear
9 10 11 12 13 14 15 16
100 200 300
400 500 600
Cos
t
Time c) Discrete
Figure 2.1: Different Time-Cost Relationships in Construction Projects (Ahuja 1983)
The tradeoff between cost and time can be better described in the sense
of the following: in general, shortening the project duration results in running
27
direct costs and saving on the indirect costs. This arises due to the utilization of
more resources to meet the activity targeted duration. On the other hand, there is
a general trend in the construction industry assumes that the project indirect cost
decreases by decreasing its duration, as shown in Figure 2.2. This has made the
TCT problem a complex optimization problem that accommodates far too many
investigations in search of the optimality.
Project Duration
Direct Cost
Indirect Cost
Total Cost
Pro
ject
Cos
t
Project Duration
Direct Cost
Indirect Cost
Total Cost
Proj
ect C
ost
Figure 2.2: Time-Cost Tradeoff in Construction Projects (Abdel-Raheem 2007)
The time-cost tradeoff problem can have different objectives. The
objective can be: 1) Finding the project optimum duration, which corresponds to
the least cost, 2) Meeting the project’s deadline with least cost, (Hegazy and
Ersahin 2001), and 3) Finding the project least cost regardless of the time it takes
to finish the project. In general, the planner can use the TCT analysis to lower the
project cost without impacting its duration by considering combination of
alternatives of different construction techniques (Feng et al. 1997).
28
Most of previous work that incorporated the application of EA in solving
construction optimization problem focused on the TCTP. Some of these previous
models are illustrated below.
Feng et al. (1997) developed a GA-based model for solving TCTP. The
model incorporated a computer program to execute the Genetic Algorithms. The
attempt done is proved to be of a valuable contribution to the industry. Their
model is one of the earlier attempts of solving TCTP using GA. Most of the
following attempts used Feng et al.’s model as a base for their work.
Hegazy and Wassef (2001) proposed a scheduling and cost optimization
model for repetitive projects. Their model is spreadsheet-based where it
integrated both critical path and line of balance methods. Also, the model
provided TCTP analysis in an attempt of finding project minimum cost. The
model utilized Genetic Algorithms for optimization through commercial software
(Evolver).
Zheng et al. (2005) developed a TCTP optimization model. Their model is
a GA-based multi-objective model that integrates adaptive weight that assigns
priorities to the objectives according to the GAs consecutive evolving
generations. Moreover, the model incorporated Pareto Ranking as the selection
criterion and Niche Formation Technique to enhance popularity diversity. The
model was integrated with Microsoft Project software to form a prototype for time-
cost optimization.
29
El-Rayes and Kandil (2005) developed a three dimensional multi-objective
model that optimizes time, cost and quality. Their model transformed the
traditional time-cost model into a three-dimensional model by taking the project
quality in consideration. The model is multi-objective in the sense that it tries to
minimize both projects cost and time, yet keeping quality up to the maximum. In
order to do so, they quantified construction quality to suit the predefined objective
function. The model utilizes GAs as an optimization technique to achieve the
preset objectives.
Elbeltagi (2005) utilized Ant Colony Optimization (ACO) in solving the
TCTP. His model incorporated Microsoft Project software for scheduling the
project. Ant Colony was coded as a Macro Program to optimize the project time.
Elbeltagi, et al. (2005) presented another interesting research comparing the
performance of five evolutionary algorithms utilized in solving TCTP. The
evolutionary algorithms in comparison were Genetic Algorithms, Memetic
Algorithm, Particle Swarm, Ant Colony, and Shuffled Frog Leaping optimization
algorithms. The presented algorithms were utilized in solving continuous and
discrete optimization problems. The criteria of comparison were the processing
time and quality of results. The TCTP was used as an example of discrete
optimization problem.
2.3.2 Cash Flow Management:
One of the most critical aspects that affects the profitability in any
construction project is the management of the project cash flow. It is important for
the contractor to forecast the cash flow profile of the project beforehand (Hwee
30
and Tiong 2002). In many cases, the owner requires an estimate of the
contractor’s S-curve throughout the duration of the project (Halpin and
Woodhead 1998). To determine whether the project is financially feasible or not,
the contractor should carry out a detailed study to estimate the cash flow of the
project. An estimate of the ingoing and outgoing cash is used to forecast the
cash flow (Ahuja 1983).
Forecasting the project cash flow profile is essential for the contractor.
With a reliable estimation of the cash flow profile of the project at the tendering
stage, the contractor can improve her/his financial position and make provisions
for the needed loans to complete the project. This in turn would avoid her/him the
risk of cash deficit throughout the duration of the project (Hwee and Tiong 2002).
The fore-project cash flow presents an estimate of all the expected costs –
both direct and indirect- through the duration of the project. Such expenses are
calculated in a cumulative manner, where the last figure represents the project
total cost. These cumulative costs are plotted against the project time-scale to
produce what is known by the standard S-curve. Parallel to the S-curve, the
contractors plots his expected due payments from the owner throughout the
project; this is referred to as the revenue profile. The negative difference between
expenditures and revenues is referred to as the contractor’s overdraft. Figure 2.3
shows an example of cash profile.
The cash flow profiles can be either an outflow curve presenting the
cumulative cost commitments or an inflow curve representing the revenue
31
throughout the project. The net of these curves gives the predicted revenue of
the project (Hwee and Tiong 2002). Jepson (1969) suggested that the net cash
flow should be derived from separate cash in and cash out profiles. A net cash
flow profile is shown in Figure 2.4. The revenue profile takes the shape of stair-
step line. The assumption is that payments are discrete amounts received at
definite times.
A good forecast presents an accurate, flexible, and comprehensive cash
flow that can easily accommodate different variations such as: time delay, cost
overrun, variation in costs…etc. The key to good cash flow forecast is building
cash out model (Park and Russell 2002).
0
200
400
600
800
1000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Thou
sand
s
Time (month)
Cas
h ($
)
Total Cost
Total Revenue
Profit
Figure 2.3: Cash Flow Profile
The main objective of project cash flow management is to secure the
needed funds that would guarantee the continuity of work throughout the duration
32
of the project. Cash flow management can be performed to ensure the
completion of the project on time regardless of the endured costs. This is usually
the case in national projects and cost plus type of contracts. Cash flow
management can also be used to perform at the possible minimum cost
regardless of the finish date of the project. As illustrated earlier, there is a time-
cost tradeoff in construction projects. The contractor can minimize his costs by
relaxing the project duration. However, in most construction project contracts,
there is usually a stipulated sum of money that has to be paid by the contractor
under the provisions of liquidated damages in case of failing to meet the project
deadline. In this case, the contractor has to manage the project cash flow in a
manner that guarantees maximizing his profit.
-200
-100
0
100
200
300
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Thou
sand
s
Time (month)
Cas
h ($
)
Profit
Figure 2.4: Cumulative Net Cash Flow
Unlike the TCTP, few studies were conducted on cash low management
using EAs. The majority of previous studies mainly focused on cash flow
33
forecasting and the development of mathematical models rather than EA. Some
of the EA-based studies are highlighted in the following sections.
Hegazy and Ersahin (2001) designed an overall schedule optimization
model using commercial Genetic Algorithms software, “Evolver”. The model is
spreadsheet-based, where it integrates, scheduling, time-cost tradeoff analysis,
resource allocation, resource level, and cash flow management. As an
optimization model, the objective function set was to minimize the project total
cost. This model is a good example of integrated cash work. It integrates five
aspects, and considers them up to a good level of details. The model ignored the
risk dimension in both project’s time and cost. In addition, the cash management
module is so traditional; it is just an illustration of previous work.
Elazouni and Metwally (2005) developed a finance-based scheduling
model that utilizes Genetic Algorithms in maximizing the project profit through
minimizing its costs. The model basically explores the effect of various credit
limits available for the contractor on the project duration. The model incorporated
scheduling software to maintain the logical relationships between activities and
assign their possible start dates. Though the model can be considered a unique
work in the area of cash flow management; many efforts could have been saved
if the optimization engine – GAs – was integrated with commercial scheduling
software instead of developing the scheduling engine from scratch.
Abdel-Raheem (2007) developed a computer based framework for
maximizing profit. His work integrated two modules. The first model solves the
34
time-cost tradeoff problem taking in consideration the risk dimension through a
sub-module that deploys Monte Carlo Simulation. The second module forecasts
and manages the cash flow of the project based on the optimum time determined
by the first module. The framework optimizes the solutions through the utilization
of Genetic Algorithms and Ant Colony Optimization as alternative optimization
techniques
2.3.3 Travelling Salesman Problem (TSP):
Perhaps, the travelling salesman problem (TSP) is the most famous and
most attempted combinatorial optimization problem. The TSP is the problem of
finding the shortest tour among a number of cities in a given set. The TSP can
have different objectives. The objective can be finding: 1) Shortest travel
distance, 2) Shortest travel time, or 3) Least travel cost between a number of
cities. TSPs vary in size (number of cities), and symmetry. A symmetric TSP is a
problem where the distance between any two cities is equal regardless the start
point. This means that the travel distance from city A to city B is equal to the
travel distance from city B to city A. On the other hand, in an asymmetric TSP the
distance varies between cities according to the direction of travel. There are
many TSP libraries (TSPlib) online devoted for various TSP instances and their
associated data sets. The data sets include distances between cities and the
best tours known until now.
Although the TSP is a generic problem with multiples of applications in
various disciplines, the TSP has direct applications in construction engineering.
Examples of these applications are: a project manager in charge of number of
35
projects at various locations trying to find the optimum tour that minimizes cost
and/or time; the allocation of equipment between different facilities within
different construction sites; finding the shortest route for concrete truck mixers;
finding the shortest tour for collecting lab samples from different construction
sites, and so many other examples. For example, in a recent project with Florida
Department of Transportation (FDOT), the objective was to assess the cost and
quality effectiveness of two different contractor quality control models that are
currently utilized by the FDOT. One of the parameters in those models is the cost
of travelling to collect samples from different construction sites (Khalafallah et al
2009).
The importance of the TSP lies in the fact that the optimum solutions have
been found for many instances. This in turn standardized them as benchmark
problems to test the capabilities of different mathematical models and EAs.
The literature for the TSP is humongous due to the generic nature of the
problem, its application in various engineering field, and its utilization as a
benchmark problem for testing mathematical models and EAs. Notable
references of the TSP appeared in Dantzig et al. (1954); Rosenkrantz et al.
(1977); Grarey and Johnson (1979); Lawler et al. (1985); Goldberg (1989);
Johnson and McGeoch (1997); Arora (1998); Walshaw (2000); Cormen et al.
(2001); Gutin et al. (2002); Gutin and Punnen (2006); and, Applegate et al.,
(2006).
36
2.4 Evolutionary Algorithms Used in Solving Construction Optimization Problems
With the technological advancement of computing systems and the need
for powerful optimization techniques, several sophisticated optimization systems
were developed to solve many complex large-scale problems that were hard to
solve in a polynomial time frame (NP-hard) (Elbeltagi et al. 2005). In 1975, John
Holland developed Genetic Algorithms (GAs) simulating the Darwinian principle
of evolution and the survival of the fittest (Goldberg 1989). Several other
algorithms followed, modifying the original approach, in attempt of enhancing the
quality of the obtained solution. Pablo Moscato (1989), developed the Memetic
Algorithm (MA) based also on the Darwinian principle of evolution, but his main
contribution relied in adopting Dawkins’ concept of a meme. Other EAs were also
developed simulating various natural phenomena of biological evolution or social
behavior of individuals. Examples of these EAs are: Particle Swarm Optimization
(Kennedy, and Eberhart 2001), Ant Colony Optimization (ACO) (Dorigo and
Stützle 2004), Shuffled Frog Leaping (SFL) (Eusuff et al. 2006), and many
others.
This section explores thoroughly the two most common EAs utilized for
solving construction combinatorial optimization problems, namely: 1) Genetic
Algorithms (GAs), and 2) Ant Colony Optimization (ACO).
37
2.4.1 Genetic Algorithms: Overview
Genetic Algorithms (GAs) is a metaheuristic that simulates Darwin’s
theory of evolution and the survival of the fittest. Evolution as a theory suggested
that living things breed and upgrades through reproduction, mutation, and
crossover of inherited genes (Forrest 1993). The metaheuristic deploys random
search to find global optimum values for combinatorial optimization problem. The
basic principle of GAs is to guide the random search process by utilizing the
improvement occuring in the first generation of solution as a basis for the next
one (Austin 1990). The Algorithm incorporates four mains steps as follows:
1. Representation of the problem as chromosomes
2. Determination of the fitness function
3. Determination of population size and number of generations (iterations)
4. Determination of genetic operators and their corresponding probabilities
The first step in solving any combinatorial optimization problem using GAs
is the formulation and the encoding of the parameters of the problem in the form
of strings referred to as “chromosomes”. The coding of the parameters depends
on the nature of the problem; in other words, no single coding approach fits all
problems. The most common coding system is binary representations of the
parameters. The chromosomes are then created in random matter, and each
chromosome presents one possible solution of the problem (Chan and Tansri
38
1994). Figure 2.5 presents possible formulation of chromosomes and binary
encoding of parameters.
A B C D E F
1 0 1 1 1 0
Chromosome
Binary Coding
Figure 2.5: Binary Formulation of Chromosomes in GAs
Each chromosome is then evaluated with respect to a predefined fitness
function, which is the main objective function of the problem. Each chromosome
presents a possible feasible solution that is determined by substituting the
chromosome values into the fitness function. The quality of the generated
chromosomes depends on the quality of solution obtained in previous solutions.
For example, good chromosomes are those that that have high values in a
maximization problem (Goldberg 1989).
The number of chromosomes generated represents the population size.
The population size usually affects both the run time and the precision of the
solution. A whole complete cycle of creation of chromosomes, their evaluation
against the fitness function, and the selection of the best individual chromosomes
is considered one generation (iteration). The number of generations also affects
both the run time and the precision of the solution. Some studies were conducted
39
to determine the appropriate size of the population, and number of generations
(Chan and Tansri 1994).
The first generation of chromosomes yield a number of offspring
generations. Only good ones are selected and the rest are discarded. The
offspring generation then undergoes reproduction, crossover, and mutation in an
attempt of enhancing the solution. A next generation of offspring is then created
and evaluated with respect to the fitness function. This process continues until a
termination condition is satisfied (Goldberg 1989).
2.4.2 GAs: Algorithm
Feng, et al. (1997) in solving the TCTP used a typical form of genetic
algorithm consisting of the following:-
1. Initiation: generation of parent population (P) composed of (N)
chromosomes (population size)
2. Ranking: each parent chromosome is evaluated with respect to a fitness
function (f)
3. Reproduction: the second generation (O) – offspring generation- is
created from (P) by selecting chromosomes with the high (f) values.
4. Crossover: pairs of chromosomes of the (O) are selected randomly
according to a predefined crossover rate (pc) to undergo crossover.
40
5. Mutation: chromosomes of the (O) are selected randomly according to a
predefined mutation rate (pm) to be mutated.
6. Evaluation: all chromosomes of the (O) are evaluated with respect to the
fitness function (f) and compared with the worst values in (P).
7. Termination: replace worst values in (P) by better values of (O) and
repeat steps 4-6 until there is no further enhancement in the results.
Reproduction is the process of selecting chromosomes with the highest
fitness values for next generations. They act as parents for the new offspring
generation, and thus contribute in the enhancement of the solution.
Chromosomes of lowest fitness are discarded to keep the number of population
constant.
Crossover is the process of random exchange of qualities between two
chromosomes. It is considered the most important operation in GAs. Crossover
mimics marriage, where two parent chromosomes are selected at random and
exchange information about the problem at hand. Chromosomes are slected for
the crossover process according to a probability (Pc) of selecting a chromosome;
fittest chromosomes are more likely to be selected. The crossover proceeds as
following: two random numbers are generated between [1 and n-1], where n is
the number of genes (length of the chromosome). The values of the
chromosomes that fall in the range of the generated random number are
exchanged with their correspondents in the other parent chromosome. Figure 2.6
illustrates the process of crossover (Goldberg, 1989).
41
3 2 1 4 1 2 4 2 1 3
3 4 2 1 1 2 2 1 4 3Offspring 1
Parent Chromosome 1 Parent Chromosome 2
Offspring 2
Figure 2.6: Crossover Process between Two Parent Chromosomes
Mutation is the resemblances of sudden evolve of a certain offspring
within a generation that turns to be a genius. The logic behind the process of
mutation is that the continuous generations of chromosomes might be lacking a
piece of information without which achieving optimality is not possible. No matter
how many reproduction and crossover processes take place, such piece of
information will still be missing. In order to account for the missing piece of
information, some chromosomes are mutated. The number of chromosomes to
be mutated is determined according to the mutation probability (Pm), which is
usually less than 5% of the total population of chromosomes. Figure 2.7
illustrates the process of mutation (Goldberg, 1989). The pseudo-code for
genetic algorithm developed by Elbetagi et al (2005) is shown in Figure 2.8.
Mutation3 4 2 1 2 3 4 1 2 2
Chromosome 1 Offspring 1
Figure 2.7: Mutation Process of a Chromosome
42
Begin; Generate random population of P solutions (chromosomes);
For each individual i ε P: calculate fitness (i); For x =1 to number of generations;
Randomly select an operation (crossover or mutation); If crossover;
Select two parents at random ia and ib; Generate on offspring ic =crossover (ia and ib);
Else If mutation; Select one chromosome i at random; Generate an offspring ic = mutate (i);
End if; Calculate the fitness of the offspring ic; If ic is better than the worst chromosome then replace the worst chromosome by ic; End if;
Next x; Check if termination =true;
End
Figure 2.8: Pseudocode of Genetic Algorithm (Elbeltagi et al. 2005)
2.4.3 Ant Colony Optimization:
Ant Colony was first introduced by Marco Dorigo in 1992 as a multi-agent
approach to different combinatorial problems and the quadratic assignment
problem (Jalali et al. 2006). ACO simulates the foraging behavior of real ants;
although ants are almost blind, they can find the shortest path between their nest
and a source of food. This is done by the help of pheromone trails that ants
deposit as a sort of indirect communication. Ants start searching for food in a
random manner. The ant using the shortest path tends to deposit more
pheromone, which consequently attracts other members in the colony. The
process continues with more ants joining the shortest path until the whole colony
converges to the optimal path (Maier et al. 2003).
43
2.4.4 Foraging Behavior of Ants:
Previous research conducted on the ants behavior showed that ants rely
on the execration of a chemical substance in communication either with other ant
individuals or with their external environment. This chemical substance is called
pheromone. Some species rely on a specific type of pheromone called Trail
Pheromone. This pheromone is used to mark paths on the ground, for example,
paths between a source of food and the nest. Foragers use these trails of
pheromone as a guide to the source of food discovered earlier by other colony
members (Dorigo and Stützle 2004)
2.4.4.1 Double Bridge Experiments:
The foraging behavior of ants was investigated by several experiments.
The most famous one is the double bridge experiments conducted by
Deneubourg and Collegues in 1989, 1990. They utilized a double bridge
connecting a source of food with a nest of ants of the Argentine type, as shown in
Figure 2.9. They ran three experiments; in each one, they changed the lengths of
the bridges.
In the first experiment, a double bridge of equal lengths was used to
connect a nest of ants with a source of food. The result was that: At start, ants
started to move freely between the nest and the source of food choosing one
path at random. Over time, ants start to converge to one branch over the other.
The analysis for this experiment was as follows. At start, there was no
pheromone deposition on any of the two bridges. Hence, the ants’ choice for any
44
of the two routes was purely random. Due to randomization, more ants would
choose one path over the other; consequently, pheromone concentration started
to increase on one bridge more than the other. The high concentration of
pheromone attracted the rest of the colony to it, until all ants converge to one
path.
In the second experiment, the length of one bridge was twice as long as
the other. In that case, most of the ants selected the shorter path after some
time. At first, the two paths appeared identical to the group of ants, so the
selection was done at random. However, after a short period, the pheromone
concentration on the shorter bridge started to increase as the time interval taken
by ants to go from the nest to the source of food through the shorter path was
almost half that taken using the longer bridge. On the ants’ second trip toward
their new found source of food, they reached the same point at which they had to
decide between the two paths. The higher concentration of pheromone biased
their decision toward the shorter path. Though the distance between the nest
and food through one bridge is shorter than the other, and the pheromone
concentration on the same bridge is higher than the other, some ants chose the
longer path. This is interpreted as a sort of exploration of different possible paths.
Figure 2.10 illustrates the foraging behavior of ants, and communication via
pheromone trails.
45
15 cm
Nest Food 1 2 Nest Food 1 2
Case (1) Case (2)
Figure 2.9: Different Cases of the Double Bridge Experiments. (a) Branches of Equal Lengths, (b) Branches of Different lengths (Dorigo and Stützle 2004).
In the third experiment, only the bridge with the longer distance was used
at first. After 30 minutes of the ant convergence on the single path, the short
branch was added. In that case, most the colony remained trapped on the longer
path, and only few of them selected the shorter path. This occurred due to the
higher concentration of pheromone trails on the longer path. An interesting
observation of this experiment is that pheromone evaporation rate is too slow to
allow ant to forget about their sub-optimal path they converged to. This does not
give a chance of further exploration of new paths (Dorigo and Stützle, 2004).
(a) (b) (c) (d)
Figure 2.10: Foraging behavior of ants and communication via pheromone trails (Christodoulou 2005).
46
2.4.5 Ant Colony: Metaheuristic
Ant colony optimization (ACO) is a metaheuristic that is capable of finding
good solution to complex discrete optimization problem. This metaheuritic
employs a group of artificial ants cooperating between them to find a good
solution. As the cooperation among ants is the key factor for a successful output,
it requires a lot of computational effort to model the interaction between these
ants through indirect communication presented by the pheromone trails as
mentioned previously.
ACO algorithms can be used to solve both static and dynamic optimization
problems. Static problems are those whose characteristics remain the same
when solving the problem. The traveling salesman problem is an example of a
static optimization problem. On the other hand, in dynamic optimization
problems, the instances change during the run time. Therefore, the algorithm
should be capable of performing in a changing environment (Dorigo and Stützle,
2004). Examples of static and the dynamic optimization problems will be
attempted in this doctoral research.
An artificial ant is a stochastic procedure that always finds feasible
solution for the problem at hand. To solve any combinatorial optimization
problem, it is necessary to represent it on a graph. Let this graph be denoted by
G (D, L, C), where D = d1, d2, d3…dn is set of points, where decision should be
taken. L = li(j) represents the available set of options (j) at every decision point
(i); C= ci(j)represents the set of costs associated with option L. A set of
constraints Ω (D, L) can be assigned over elements of D and L. An available path
47
over graph G is called a feasible solution (φ), and the shortest path is called the
optimal solution (φ*). Figure (2.11) illustrates an example of the graphical
representation of the traveling salesman problem. The graph is constituted of
four nodes representing decision points (four cities) d1 to d4. The objective is to
travel from city (d1) to city (d4) with the minimum traveling costs. At every city (d)
there are set of available routes (options L) that have different costs (C) (Maier et
al. 2003).
l1(1)
l1(2)
l1(3) l2(1)
l3(2)
l3(1)
d1
d2
d3
d4
Figure 2.11: Graphical Representation of TSP (Maier et al.2003)
Each option L is associated with a pheromone trail (τ), and a heuristic
value (η). The pheromone trail constitutes a long term memory of the ant search
trips, and is updated by the ants themselves. On the other hand, a heuristic value
presents a certain piece of information about the problem itself gained from a
source different from the ant. Both pheromone trail and heuristic values are used
by the ant to make probabilistic decision on how to move on the graph. Each
artificial ant in the colony is characterized by the following:
48
1. Each ant looks for possible paths on its own randomly.
2. Each ant has a memory (M) that is used to store information during its trip.
Such information comprises possible feasible solutions, heuristic values,
evaluations of solution, and track of all paths.
3. It has a start state, and termination condition.
4. The ant explores all available nodes on the graph as long as no
termination condition is satisfied.
5. It selects paths probabilistically using a decision rule. This probabilistic
decision rule is a function in pheromone trail, heuristic value, ant’s current
state (stored in memory) and problem constraints.
6. It can trace all selected paths (built solutions) and update the pheromone
trails (Dorigo and Stützle 2004).
The ACO algorithm can be summarized in three main steps, which are:
1) Construction of ants (solutions), 2) Updating pheromone trails, and 3) Daemon
actions.
Construction of ants step manages a colony of ants that starts exploring
possible solution in the search space. The ants move using a stochastic rule that
utilizes pheromone trails and heuristic values. The ant starts building a solution
for the optimization problem in consideration. This solution is later evaluated in
49
preparation for the next stage which is pheromone updates (Dorigo and Stützle
2004).
Updating pheromone concentration encounters both increasing and
decreasing pheromone trails by deposition or evaporation on paths that ants
used. Deposition of pheromone implies that there is a high probability that a
certain path that was selected by a single or group of ants, and which presents a
good solution for the problem, will be chosen by other ants as well. On the other
hand, pheromone evaporation decreases the probability of choosing a certain
path. Evaporation of pheromone trails resembles forgetting the collected
information about a certain path after it was proven bad or infeasible. It also
avoids the convergence of the problem to a local optima and helps the ants
explore new values in the search space (Dorigo and Stützle 2004)..
Daemon Actions is a procedure used to implement centralized action that
cannot be undertaken by a single ant. An example of daemon action is the
collection of information about the outcome solutions and deciding to increase
the pheromone concentration to bias the search process toward some solution
regarded as being more feasible than others. However, daemon action is not
always a common procedure in ACO. Figure 2.12 shows the pseudo-code of ant
colony metaheuristic (Dorigo and Stützle 2004).
50
procedure ACOMetaheuristic ScheduleActivities ConstructAntSolutions UpdatePheromone DaemonActions % optional end- ScheduleActivities end-procedure
Figure 2.12: ACO Metaheuristic Pseudocode (Dorigo and Stützle 2004).
2.4.6 Ant Colony: Algorithm
The aim of ant colony algorithm is to model the communication behavior
among ants. Artificial ants are different from real ants in term of the following:
1. Artificial ants keep record of their paths.
2. They are abandoned after each trip from their nest to the food sources,
and new group replaces them.
3. They are provided by some eyesight encoded by the heuristic value
utilized in the search process.
4. Artificial ants live in discrete environment only (Solimanpur 2004).
The ant colony algorithm incorporates six main steps as follow:
1. Construction of trial solutions: this is done by creating a colony of ants
that starts moving randomly in the search space from one decision point to
another until all points are visited. Figure 2.13 shows an example of an ant
created representing a possible solution of a problem.
51
2. Providing Heuristic Information: Heuristic information is provided to
each ant about the problem.
1 2 3 il1j l2j l3j lij …… lSj………An Ant
S variables
Figure 2.13: Construction of Solutions (Elbeltagi et al. 2005)
3. Calculating Cost of Each Trip: The cost of each ant trip is calculated
according to a predefined objective function. The generation of one ant
and its evaluation at the end of one trip compromises one cycle (k).
4. Updating Pheromone Trails: Pheromone is updated at the end of
iteration (t) which consists of (m) cycles representing the number of
solutions generated, where (m) is the number of ants. Pheromone is
updated according to the Equation (2.1):
ij ij ij (t) (t 1) (2.1) τ = ρτ − + ∆τ
Where τij (t): new pheromone concentration assigned to route (j) at
decision point (i) at iteration (t); τij (t-1): pheromone concentration
associated with route (j) at decision point (i) at previous iteration (t-1);
ρ: pheromone evaporation rate, and ∆τij: change in pheromone
concentration.
52
The change in pheromone concentration is calculated in accordance to
Equation (2.2):
mk ij
ijk 1
R / f( ) If option l is selected by ant (k) (2.2) 0 Otherwise
=
ϕ∆τ =∑
Where R: pheromone reward factor; ƒ (φ)k: value of objective function
using ant (k); and m: total number of ants.
It should be noticed that the change in pheromone concentration for each
option is a function of the value of objective function obtained. The higher
the quality of the solution obtained, the larger the pheromone added. This
reinforces the selection of good in the next iterations.
5. Updating Selection Probability: Selection probability is calculated
according to a predefined equation that incorporates both the updated
pheromone concentration and the heuristic value. Available options are
selected by the ants probablistically according to the Equation (2.3).
ij ijij
ij ij
[ (t)] [ ] P (2.3)
([ (t)] [ ] )
α β
α β
τ + η=
τ + η∑
Where Pij (k, t): probability that option (j) is selected by ant (k) for decision
variable (i) at iteration (t); τij(t): pheromone concentration associated with
option (lij) at iteration (t); ηij: heuristic value that favors options according
to a preset criteria; α & β: are exponent parameters that distribute weight
53
between pheromone concentration and the heuristic value according to
their relative importance
6. Termination Condition: Finally, a termination condition should be set.
The termination condition can be either a period of time, or a number of
iterations. In general, the number of iterations is used as the stopping
criterion. (Maier et al 2003)
The pseudo-code for the ant colony algorithm is shown in Figure 2.14 (Elbeltagi
et al. 2005).
Start; Initialize values for pheromone trails, no. of ants, no. of iterations, α, R, β, ρ;
Generate a colony of m ants;
Evaluate each ant k ε m with respect to the objective function;
For each ant k, determine its best value;
For all ants m, determine the best ant k;
Update pheromone trails for all options
Check termination condition = true;
End;
Figure 2.14: Pseudocode of ACO for the TCT Problem (Elbeltagi et al., 2005)
2.5 Summary and Conclusion
This chapter presented a comprehensive review of the major definitions
and theories in optimization, three important combinatorial optimization problems
related to the construction engineering, previous models developed to solve
them, and the limitations and advantages of each model. The chapter
54
comprehensively covered two major EAs that have been used extensively in
solving a wide range of optimization problems.
The chapter illustrated the current state of art, and provides bases of
understanding and knowledge for the subsequent work in this doctoral
dissertation. The three construction optimization problems illustrated in this
chapter will be used as benchmark problems to demonstrate the capabilities
and/or limitations of the proposed algorithm. Moreover, the comprehensive
review of the mechanism of the previously discussed EAs is expected to provide
further insights regarding the development and the design of the target
processes in the proposed algorithm.
55
CHAPTER 3: DEVELOPMENT OF ELECTIMIZE
3.1 Introduction
Due to the limitations of some current evolutionary algorithms (EAs) as
discussed in previous chapters, the main objective of this research is definite
about developing an optimization algorithm with higher capabilities than existing
algorithms. The capability of the proposed algorithm can be defined using three
main dimensions: 1) The ability of the algorithm to assess the quality of each
value in the solution space independent from other members in the solution
string; 2) The ability of the algorithm to extensively search the solution space,
and identify as many alternative optimal solutions as possible; and 3) The ability
of the algorithm to solve a wide range of discrete construction optimization
problems.
This chapter presents the processes of developing the algorithm. The
discussion includes: 1) A detailed description of Electimize; 2) The metaheuristic
of the algorithm; 3) The algorithm (main steps of optimization); and 4) An
application example. The output of this discussion is summarized in a flowchart
and a pesudocode that serve as a basis for the actual application of the algorithm
as will be illustrated in the following chapters.
3.2 Description of the Algorithm
Electimize is a new evolutionary algorithm that utilizes a multi-level
evaluation approach of trial solutions for different combinatorial optimization
56
problems. Electimize simulates the natural phenomenon of the flow of electrons
through electric conductors. This flow induces an electric current with an intensity
that varies with respect to the resistance of the conductor to the flow of electrons
through it. Any change in the conductor resistance will result in a change in the
intensity of the current; i.e. the number of electrons passing through the
conductor.
In the proposed algorithm, each candidate solution is represented by a
string of variables that defines the properties of a conductor (wire). A wire
consists of a number of segments of different materials and resistances. The
segments are connected in series, as shown in Figure 3.1, and they collectively
represent a solution for the optimization problem. For each wire, there is a global
resistance for the wire as a whole (wire resistance) and a local resistance for
each of its segments (values comprising the solution).
The wires (individuals of the population of solutions) are connected in
parallel to represent an electric circuit, as shown in Figure 3.2. The electrons flow
through the circuit due to a potential difference of an electric source. The
developed algorithm is designed to evaluate: 1) The global resistance of each
wire with respect to all the other wires, and 2) The local resistance of each
segment in a given wire with respect to other segments within the same wire.
The whole circuit is then demolished and a new one is constructed. The segment
values of each wire in the circuit are selected based on the selection probability,
which in turn is calculated based on the quality of values, i.e. local resistance, as
57
will be discussed in details in the following section. The process is iterative until
the wire with the best conductivity is created (i.e. optimal solution).
Figure 3.1: Variable Representation in the Developed Algorithm
One of the major differences between the proposed algorithm and other
optimization algorithms is the evaluation of the merit of each segment (local
resistance). Unlike some of the current EAs in which all members of the same
solution string receive equal merit, the proposed algorithm has the capability of
evaluating members of solution strings (segments) individually. Another major
difference between the developed algorithm and some existing evolutionary
algorithms lies in the evolution process itself. In some evolutionary algorithms,
the species (solutions population) evolve and are ranked with respect to an
58
objective function to tell how good they are until they reach superiority (optimal
value). However, in the proposed algorithm, the electrons (species) do not
evolve, but their surrounding environment (electric circuit) does. The electrons
are merely identical agents with consistent behavior; they always select the path
with the least resistivity. They just go through the electric circuit, and output how
good the conditions are in their environment (electric circuit).
Figure 3.2: Solution Population Represented as an Electric Circuit
The evolution of the environment, rather than individuals, and the
consistency in behavior of population, regardless of the change in the
environmental conditions, would always guarantee the applicability of Ohm’s and
Kirchhoff’s rules, as will be discussed in the following section. Adversely, there
are no mathematically valid equations that can appropriately capture the
59
behavior of the simulated species in some of the current EAs, as these species
change their behaviors according to the changes in their environment.
3.3 Metaheuristic
Electimize is a metaheuristic that is designed to solve combinatorial
optimization problem of NP-hard type. The metaheuristic basically deploys
Ohm’s law and Kirchhoff’s rule that governs the flow of a group of artificial
electrons through a set of artificial wires in search of the optimal solution.
Likewise other EAs, good knowledge in computational programming would be
required to capture the metaheuristic in a computer model.
Electimize is designed with the capability of solving discrete static and
dynamic optimization problem. Static optimization problems are characterized by
fixed parameters (variables, values, constraints...etc) throughout the optimization
process. An example of static optimization problem is the traditional travelling
salesman problem. On the other hand, dynamic optimization involves changing
the given parameters of the problem through the optimization process. For
example, new cities maybe assigned or excluded in the TSP. It is evident that
dynamic optimization problems are much harder and more cumbersome to solve
than static ones. In dynamic optimization, the main hardship for any optimization
algorithm is tracking the optimum solution through different changes in the
problem rather than just finding the optimum value (Yang and Branke 2005).
An artificial wire is a stochastic procedure that always presents a feasible
solution for a given optimization problem. Each wire has different electrical
60
conduction properties. The aim is to find the best conductor for maximization
problems, and the best insulator in case of minimization. Each wire has equal
number of segments of different resistances. The intensity of the current passing
through each wire depends on the resistance of the wire, and the source of
electricity, which is the same source for all wires. The metaheuristic
characterizing each wire can be stated as following:
1. Each wire is composed of equal number of segments representing the
variables of the objective function.
2. The wire is subject to the empirical ohm’s law and Kirchhoff’s rule that
regulate the flow of artificial electrons through its medium.
3. The quality of each wire is measured by the current intensity (I) passing
through it, i.e. number of electrons passing through it.
4. There is a global resistance (R) for the whole wire and a local resistance
(r) across the nodes of each segment.
5. All wires are connected together to a source of electricity that has voltage
(V) representing an electric circuit.
6. At the end of each iteration, the circuit is dismantled and different
segments are reused for fabricating new wires.
7. The fabrication process of a single wire utilizes historical data compiled
over iterations on different available segments local resistances.
61
8. Selection of segments values for fabricating a new wire is done
probabilistically based on their local resistance compared to other values
available to the same variable of the objective function.
9. The fabrication process continues up to a specified number of cycle
(iterations) then terminated.
This metaheuristic constitutes Electimize as an algorithm, and it can be summed
up in four main milestones: 1) Fabrication of wires, 2) Evaluation of wires
qualities, 3) Sensitivity analysis, and 4) Updating resistances and calculating the
selection probability.
Fabrication of wires is the process of creating a number of wires
representing possible feasible solutions of a designated optimization problem. A
single wire is built of a number of segments. Each segment represents a decision
variable in the objective function and is randomly assigned a value from the
solution space. The fabrication process utilizes both randomness and local
resistances of values calculated throughout different iterations.
There is a certain level of quality associated with each fabricated wire. The
quality level is indicated by the intensity of a pseudo-current passing through
wires, and quantified in terms of the global electrical resistance using Ohm’s law.
The intensity is determined by substituting the values of a particular wire
segments into the objective function. The source of electric current is an
imaginary battery that has a designed level of voltage that is high enough to help
differentiate between the qualities of wires.
62
The sensitivity analysis stage aims to differentiate between the qualities of
different segments of the same wire, which is defined as the local electrical
resistance and determined using Kirchhoff’s rule. The top wires in every iteration
are identified, and selected to perform sensitivity analysis. This is conducted by
substituting the values of segments of each selected top wire in the best wire
among them (comparison wire). The segments values are substituted one at a
time, which means that it is a one-way sensitivity analysis. The change in the
original current intensity passing through the comparison wire is recorded and
the resistance of the substituted segments is modified in accordance.
The final stage in a single iteration is updating the resistances of different
segment values. The resistances are updated based on: 1) The performance of
the segments collectively in their host wire, i.e. global resistance, and 2) Their
individual performance of segments in the comparison wire through sensitivity
analysis, i.e. local resistance. The resistances are accumulated through iterations
after being divided by the total number of iterations minus the iteration number.
This method allows the algorithm to explore the solution space extensively and
prevents the premature convergence toward local optima. The physical
interpretation of the division operation can be related to the fact that electrical
conductivity decreases as the temperature of the medium increases. The
overuse of segments in different circuits throughout iterations will results in
heating the segments, which can be translated as an increase in their
resistances. The pseudocode of the metaheuristic is given in Figure 3.3.
63
Procedure Electimize Metaheuristic;
Initiation and fabricating wires Evaluating quality of fabricated wires Sensitivity analysis Updating resistance and selection probability
End Procedure.
Figure 3.3: Pseudocode of Electimize Metaheuristic
It should be clearly indicated that the method of evaluation and
determination of the solution quality used in Electimize is totally different and
novel compared to other existing EAs methods of solutions quality evaluation. In
some EAs, a population of solution is evaluated comparably to each other. For
example, in the given example of GAs in chapter one, the merits of the solution
population are determined relative to each other in a certain iteration. Similarly, in
Ant Colony Optimization, the amount of pheromone trails associated with each
ant is determined relative to the population of ants created in a single iteration.
An interesting conclusion can be drawn from this observation which is the
appreciation received by a solution string is subject to the performance of the
whole solution population. A bad solution can achieve high merit just because the
rest of the individuals of the population have similar or less quality. Adversely, the
method of evaluation in Electimize is standard throughout the iterations and
independent of the performance of the population in whole. Because the
evaluation method is based on current intensity, which is based on an electric of
constant voltage throughout the iterations, it can be rather regarded as if each
wire is competing with wires in previous and future iterations.
64
3.4 Steps of the Algorithm
The aim of Electimize as an optimization algorithm is to simulate the
phenomenon of the electric conduction in attempt of finding the optimum solution
for different discrete optimization problem. A set of metaheuristic was identified in
the previous section upon which the actual algorithm is built. The metaheuristic
highlights the basic assumptions that characterize the artificial simulation which
deemed essential for the ease of mathematical modeling and computation. The
artificial wires are similar to real wires in terms of the following:
1. Both artificial and real wires have electrical conductivity and resistance.
2. Both types of wires can be overheated, which affects their abilities to
conduct electricity, i.e. increases their resistances.
3. Wires can be connected in parallel to an electric source forming an electric
circuit.
4. Calculations of the electric circuit parameters (current intensity, resistance,
and volt) follow Ohm’s law and Kirchhoff’s rule for both types of wires.
On the other hand, artificial wires are different from real wires in the sense of:
1. Artificial wires are composed of separate segments that are connected in
series.
2. At the end of a fabrication cycle (iteration), wires are dismantled and
segments are used for fabricating new wires.
65
3. The segments can only be connected in series.
4. The electric circuit is connected to an electric battery that has constant volt
throughout the iterations, i.e. the battery never depletes.
Electimize incorporates nine basic steps for solving optimization problems. These
steps are:-
1. Fabrication of wires (trial solutions): This step is accomplished by
fabricating a number of wires (N), each composed of (M) segments of
different material that are connected in series. Each segment represents a
decision variable in the objective function and has a value that is selected
randomly from the solution space. This value has a designated resistance
value (rnm), as shown in Figures 3.1.
2. Construction of the electric circuit: Once all wires are fabricated, they
are connected to an electric source of voltage (V), as shown in Figure 3.2.
Despite the voltage (V) could be set to any arbitrary value, it should be
carefully selected to ensure that the differences between the solutions are
significant enough to be measured. To accomplish this, random values are
selected from the solution space and substituted in the objective function.
The output solution is then raised to the power (G) to ensure that the value
of (V) is high enough to be measured. Based on experimentation, the
suitable range of values of (G) is [1.5, 1.9[.
66
3. Determining the electric current intensity (In): For each wire (Wn), the
intensity of current (In) passing through is calculated by substituting the
segment values in their corresponding decision variables of the objective
function.
4. Calculating the resistance of wires (Rn): The global resistance of each
wire is calculated using Ohm’s Law: Rn = V/In.
5. Evaluating the quality of wires: The quality of a wire (Wn) is determined
by its global resistance (Rn) and the wires are accordingly ranked with
respect to one another. The best wire (WBest) is then determined and used
as a comparison medium to evaluate the quality of the generated wire
segments as discussed in the next step.
6. Evaluating the quality of wire segments: The quality of each segment
(m) in wire (Wn) is determined by calculating its local resistance (rnm). At
first, it is assumed that all resistances (rnm) for segments values (m: 1 M)
are identical since there is no prior information about how good each value
is. Therefore the resistances are calculated according to Equation (3.1).
n nmRr (3.1)M
=
In order to determine the actual resistance of each segment, a sensitivity
analysis is conducted. The top (Z)3 wires are selected to perform the
3 Z is the number of top wires selected to perform sensitivity analysis.
67
sensitivity analysis. This is done by substituting the value (lnm) of each
segment of wire (Wz) in its corresponding segment of the Comparison
Wire. The change (∆R) in the global resistance of the Comparison Wire is
then recorded (see Equations 3.2 and 3.3) and the modified resistance of
the segment is calculated according to Equation (3.4). The modified
resistances (r*nm) of the wire segments are then normalized so that their
sum is equal to the original wire resistance (Rn). This guarantees that
there is no violation to Kirchhoff’s rule.
best nR R R (3.2)∆ = −
bestH R / R (3.3)= ∆
M* ml nm n nmm 1
r [r (1 H)] R / [r (1 H)] (3.4)=
= − × −∑
Where r*ml: modified resistance of segment (m); rnm: resistance of segment
(m) in the original wire (Wn); Rn: resistance of wire (Wn); and
Rbest: resistance of best wire (Comparison Wire).
7. Updating resistances (rlm) for the generated values: At iteration(x=0),
all the values in the solution space are considered to have the same
quality as there is no prior information about their quality. Therefore, each
value is assigned the same initial resistance (r0) that is determined by the
algorithm. This is accomplished by dividing the global resistance (V/I) of
the wire generated in step 2 by the number of segments. In each iteration
68
(x), the resistance (rml) is updated for each selected value (l) for each
segment (m) according to Equation (3.5):
^ *ml ml ml r r [r (X - y 1)] (3.5)= + ÷ +
Where ^mlr : updated resistance for value (l) of segment (m);
rml: resistance for value (l) of segment (m) from the previous iteration;
X: total number of iterations; and y: current iteration number.
It is important to note that another advantage of the proposed algorithm is
that it can explore different values for each decision variable in the
solution space by the accumulation of resistances through successive
iterations. The term (X – y + 1) simulates the heat generated in different
segments due to overuse in multiple wires, which increases the resistance
of parts throughout iterations. This helps to avoid converging to a local
optimal solution. The term (+1) is added to prevent division by zero.
8. Selection of new values (lnm) for the variables: The selection process of
new values is based on the individual resistance (rml) associated with each
value (l), which is updated after each iteration until the optimum wire is
created. The probability of selecting values for each parameter in the
objective function is calculated according to Equation (3.6).
69
^ml
ml Lml
l 1
1/ r P (3.6)^1/ r
=
=
∑
Where Pml: probability that value (l) is selected for segment (m).
At iteration (x=0), all values (l) for each variable have equal probabilities of
selection. In the subsequent iterations, the probability of selection is then
changed based on the resistance (rml).
9. Algorithm Termination: The algorithm terminates after the stipulated
number of iterations is reached. The pseudocode of the algorithm is given
in Figure 3.4.
3.5 Illustrative Example
The following hypothetical optimization problem is used to illustrate the
application of basic steps of the algorithm.
Maximize: 7a + b + 3c – 11d + 5e – 2f + 9g
Subject to: a + b + c ≤ 25
b, g ≥ 10
g + d ≤ 20
b – e + f ≤ 25
d – a + 5e – 3c ≤ 15
70
a, c, d, e, f > 5
For the above problem, the optimal solution is known to be 200. The
values of the objective function parameters are as follows: a =10; b =10;
c = d = f = 5; e = 7 and g = 15. For the sake of illustrations, 3 iteration and six
wires are used. The application of Electimize is as follows:
1. Fabrication of wires (trial solutions): A number of wires (N=6) is
created, each composed of (M=7) segments. Each segment has a
randomly selected value from the solution space, as shown in Figure 3.5.
2. Construction of the electric circuit: The created wires are connected to
an electric source of Voltage (V). For the given optimization problem a
random wire is created at the initiation point to determine the voltage in
the circuit and the initial resistances of values. The electric source voltage
is calculated as follows: V= (In) G= [7(6) + 1(5) + 3(2) – 11(3) + 5(3) – 2(23)
+ 9(6)] 1.618 = [43] 1.618 ≈ 440 volts.
3. Determining the electric current intensity (In): The values of segments
of each wire are directly substituted in the objective function to determine
the current intensity passing through them, as shown in Figure 3.5 and
Table 3.1.
71
Start; ‘initiation and fabricating wires Initialize # of iterations (X), # of wire (N), circuit voltage (V), & resistance (r0) Calculate selection probability (p0) for all values (l)
‘evaluating quality of fabricated wires
For i = 1 to X_iteritions
Fabricate a number of wires (Wn) of segments (M) Randomly select values (l) for segment (m) based on (Plm)
For j= 1 to N_wires
Calculate the current intensity (Ij) Calculate wire resistance (Rj) Calculate segment resistance (rjm) Determine Best wire (WBest)
Next j
‘sensitivity analysis and updating resistance
For j=1 to N_wires For S= 1 to M_segments
Plug value (ljs) of segment (s) in the corresponding segment of (Ww) Record change in resistance (∆ R)
Next S Calculate modified segment resistance (r*nm) Update resistance (r^nm) for value (l) of segment (m)
Next j ‘updating selection probability
For S= 1 to M_segments For k= 1 to L_values
Calculate Probability (Psk) for value (l) of segment (s) Next k
Next S Next i
Check termination condition=true End;
Figure 3.4: Pseudocode for Electimize
72
Optimization Variables
Trial solutions (Wires)
Figure 3.5: Substitution of Trial Values in the Objective Function to Determine Intensity (In)
4. Calculating the resistance of wires (Rn): The global resistances of the
created wires are calculated according to Ohm’s Law, as shown in
Table 3.1.
Table 3.1: Intensity and Resistance of Generated Wires Based on the Given Objective Function
In Rn RankW1 127 3.465 5W2 164 2.683 2W3 141 3.121 3W4 135 3.259 4W5 122 3.607 6W6 177 2.486 1
Wn
V=440
5. Evaluating the quality of wires: The best wire (W6) is determined based
on the global resistance, as shown in Table 3.1 wire segments.
73
6. Evaluating the quality of wire segments: For every wire, the initial
resistances of segments first are determined based on Equation (3.1). For
example, the global resistance of W6 is 2.486; the initial segment
resistance can then be calculated as (2.486/ 7=0.35) as shown in Table
3.2.
Table 3.2: Initial Calculation of Segment Resistances (rnm) for Different Values (lnm) of (W6)
m 1 2 3 4 5 6 7l6m 10 10 5 5 6 14 15r6m 0.355 0.355 0.355 0.355 0.355 0.355 0.355
R6 =2.486
The actual resistances of segments are then determined by conducting a
sensitivity analysis, and normalizing the resistances values according to
Equations (3.2, 3.3, and 3.4) as discussed earlier, and as shown in Figure
3.6.
It should be noted that Wb, Wd, and We did not change the intensity of the
current in the original wire W6 that is why there contribution (H) did not
change. On the other hand, Wc represents an invalid solution for the given
optimization problem because it does not satisfy the constraints.
Therefore, its contribution (H) is set to zero.
74
W2 6 10 9 5 6 8 14
WB = W6 10 10 5 5 6 14 15
a b c d e f g In | Rn| H rnm(1-H) r*nm
Wa 6 10 5 5 6 14 15 149 2.953 -0.188 0.455 0.444
Wb 10 10 5 5 6 14 15 177 2.486 0.000 0.383 0.374
Wc 10 10 9 5 6 14 15 189 2.328 0.000 0.383 0.374
Wd 10 10 5 5 6 14 15 177 2.486 0.000 0.383 0.374
We 10 10 5 5 6 14 15 177 2.486 0.000 0.383 0.374
Wf 10 10 5 5 6 8 15 189 2.328 0.063 0.359 0.350
Wg 10 10 5 5 6 14 14 168 2.619 -0.054 0.404 0.3942.751 2.683
Figure 3.6: Calculating the Modified Resistance (r*nm) for Different Segments of (W2)
7. Updating resistances (rlm) for the generated values: The resistance (r0)
of all values in the solution space is determined by dividing the global
resistance (V/I) of the wire generated in step 2 by the number of
segments. For the above optimization problem, the initial resistance (r0) is
1.5 ohms [(440 / 43) / 7]. In each iteration (x), the resistance (rml) is
updated according to Equation (3.5), and as shown in Table 3.3.
8. Selection of new values (lnm) for the variables: The selection probability
of new values is calculated according to Equation (3.6), as shown in
Table 3.3. In this table, it can be noticed that the algorithm starts to
converge towards the optimal solution by assigning higher probabilities to
optimal/near optimal values (e.g. a=10, e=6 and g=15). It is also worth
mentioning that this method of selecting the values guarantees the
75
deployment of all values in the solution space at least once, as the initial
resistance of each value is equal at the first iteration.
Table 3.3: Selection Probabilities at Different Iterations Based on Value Resistance (rlm)
Variable Values (l ) 5 6 7 8 9 10 5 6 7 8 9 10 11 12 13 14 15r0 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5
Plm at (Start: x=1) 0.167 0.167 0.167 0.167 0.167 0.167 0.200 0.200 0.200 0.200 0.200 0.167 0.167 0.167 0.167 0.167 0.167
rlmat (End:x=1) 1.030 0.964 0.989 0.991 1.008 0.932 0.992 0.949 0.994 1.500 1.500 1.500 1.001 1.500 0.969 0.942 0.911Plm at (Start:x=2) 0.159 0.170 0.166 0.166 0.163 0.176 0.229 0.239 0.229 0.151 0.151 0.121 0.181 0.121 0.187 0.192 0.199
e ga
9. Algorithm Termination: Steps 1-8 are repeated throughout the iterations,
and the algorithm terminates when X=3.
3.6 Summary and Conclusion:
This chapter presented a detailed description of a new evolutionary
algorithm for solving combinatorial optimization problems, named Electimize. The
proposed algorithm simulates the phenomenon of electric current conduction and
the ability of electrons to select the path (wire) with the lease resistance. The
chapter covered the basic steps of optimization along with an illustrative example
accompanied with figures and tables to show the applicability of the algorithm in
solving combinatorial optimization problem. Electimize is comprised of nine basic
steps, which are: 1) Fabrication of wire; 2) Construction of the electric circuit; 3)
Determining the electric current intensity; 4) Calculating the resistance of wires 5)
Evaluating the quality of wires; 6) Evaluating the quality of wire segments; 7)
Updating resistances for the generated values; 8) Selection of new values for the
variables; and 9) Algorithm Termination.
76
The major contributions of Electimize lies in the evaluation process of the
solution strings. The algorithm is equipped with the capability of evaluating each
value in the solution string independently, which is a major limitation in some
EAs. Another major advantage of the algorithm is the selection process of
values. The principle of selecting values based on the updated resistances
allows the algorithm to search the solution space extensively and prevents
convergence to local optima. The following chapters present the testing of
Electimize internal processes with major application in solving some of the most
popular discrete optimization problem in construction engineering.
77
CHAPTER 4: ENABLING THE INDIVIDUAL ASSESSMENT OF THE DECISION VARIABLE VALUES
QUALITY
4.1 Introduction
A primary objective of this research is to devise a method that is capable
of evaluating the quality of each value in the solution string independently. This
objective was defined to make up for the shortcomings in some existing
evolutionary algorithms, which are attributed to their inability to evaluate every
decision variable value in the solution string independently. The previous chapter
presented the basic steps of Electimize, and the methodology used for the
individual assessment of the quality of decision variable values, as illustrated in
the sensitivity analysis step and shown in Figure 4.1. Electimize was applied to a
hypothetical optimization problem with a set of constraints. The investigation of
the change in the probability of selection of different decision variable values
showed that the algorithm converged incrementally towards the values
comprising the optimal solution throughout the iterations.
Despite the successful implementation of Electimize in solving this
hypothetical problem, it was necessary to further investigate the performance of
the algorithm and its capability of assessing the quality of the decision variable
values on a more sophisticated construction-related problem. This chapter
presents the application of Electimize to a contractor cash flow management
78
problem. The optimal solution for this problem is known beforehand in the
literature.
Figure 4.1: Basic steps of Electimize
4.2 Methodology
The developed algorithm is intended to be a powerful tool for solving
combinatorial optimization problems of the NP-hard type. Therefore, it deemed
essential to validate the performance of the algorithm in solving a problem of that
type in order to evaluate its capabilities and understand its limitations. As such, it
was necessary to select a problem for which the optimal solution is known
beforehand in order to serve as a valid basis for comparison.
79
To test the effectiveness of Electimize innovative method of assessing the
individual quality of decision variable values, it was important to select a
sophisticated problem for application. A construction cash flow management was
selected for the application for three main reasons. First, the problem cannot be
solved in a polynomial time frame, i.e. NP-hard. Second, the problem is classified
as a dynamic optimization problem, which makes it even harder for an algorithm
to find its optimal solution. Third, it was important to test the capabilities of the
algorithm as an efficient tool for solving construction engineering optimization
problems. Hence, solving the problem would present a real life application of the
algorithm.
The cash flow management problem originally appeared in Ahuja (1983)
and was reattempted by Abdel-Raheem (2007) using ant colony optimization.
The optimal solution for the problem is known beforehand. The selection
probabilities of values in the solution space were monitored and recorded
throughout the iterations. The final results obtained by Electimize were then
compared with previous attempts to highlight any improvement made.
4.3 Construction Cash Flow Management (CCFM): Overview
In any construction project, a primary objective for the contractor is to
maximize the profit. This is accomplished by minimizing the overall cost incurred
during the project phases. In most cases, the contractor would rely on a financial
institution to finance the construction of the project. The cost incurred can be
categorized into two main categories: 1) Project-related costs, which includes
80
activities direct costs, project indirect cost, and liquidated damages, if any; and
2) Credit costs, which includes interests charged by the financial institution on
borrowed amounts and unused portions of it.
In the project planning phase, the contractor has to estimate the cash
inflow and outflow for the project. Based on this forecast, the contractor
determines the needed sum of money (overdraft) that would guarantee the
continuity of the project throughout its different stages. As such, a main objective
for the contractor is to try to minimize the amount of the overdraft in order to
maximize the profit. This can be accomplished by a variety of methods including
shifting different non-critical activities within the limits of their total floats. For
every non-critical activity, there is a set of possible start dates. The objective is to
determine the start dates for the project activities that would guarantee its
completion with the possible minimum cost, i.e. their optimal start dates.
For example, let us consider the hypothetical construction project
illustrated in Figure 4.2. The project is composed of four main activities; three of
them are critical. Assuming that the contractor is going to rely completely on
external financing, the original cash flow forecast (See Figure 4.2a) shows that
the contractor needs to secure $246,000 (paid as monthly installments of
$20,500) in order to cover the maximum overdraft throughout the duration of the
project. In a second scenario (see Figure 4.2b), activity B (non-critical) is
scheduled to start at the beginning of the tenth month. In such case, the total
external fund needed would drop to $160,440 (paid as monthly installments of
$13,370).
81
The main parameters that determine the optimal start dates of the project
non-critical activities are: 1) Total direct cost; 2) Total indirect cost; 3) Interest
charged on used portion of the credit; 4) Interest charged on unused portion of
the credit; and 5) Liquidated damages or the incentive for speedy construction –
if any. These parameters can be incorporated in one objective function, as shown
in Equation (4.1).
n T Ti 1 s s 2 s s l
i 1 s 1 s 1 Minimize : TI C i B t i U t C - W (4.1)
= = =+ + + +∑ ∑ ∑
where: T: project total duration; I: indirect cost per day/week; n: total number of
project activities; Ci: direct cost of activity (i); Bs: amount of credit used on day (s);
i1: interest rate charged on used portion of credit; Us: amount of unused portion of
credit requested on day (s); i2: interest charged on unused portion of the credit;
Cl: total liquidated damages; and W: incentive for speedy construction.
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12
A $5,000 $5,000 $5,000 $5,000 A $5,000 $5,000 $5,000 $5,000
B $12,000 $12,000 $12,000 B $12,000 $12,000 $12,000
C $8,500 $8,500 $8,500 $8,500 $8,500 C $8,500 $8,500 $8,500 $8,500 $8,500
D $1,370 $1,370 $1,370 D $1,370 $1,370 $1,370Total $5,000 $5,000 $5,000 $5,000 $20,500 $20,500 $20,500 $8,500 $8,500 $1,370 $1,370 $1,370 Total $5,000 $5,000 $5,000 $5,000 $8,500 $8,500 $8,500 $8,500 $8,500 $13,370 $13,370 $13,370
0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 120 -5000 -5000 -5000 -5000 -20500 -20500 -20500 -8500 -8500 -1370 -1370 -1370 0 -5000 -5000 -5000 -5000 -8500 -8500 -8500 -8500 -8500 -13370 -13370 -13370
(a) (b)
Duration (month)Activity Activity Duration (month)
Project Cash Overdraft
-22000-17000-12000
-7000-200030008000
0 1 2 3 4 5 6 7 8 9 10 11 12 13
Duration (month)
Cas
h ($
)
Project Cash Overdraft
-22000-17000-12000
-7000-200030008000
0 1 2 3 4 5 6 7 8 9 10 11 12 13
Duration (month)
Cas
h ($
)
Figure 4.2: Utilizing the Non-critical Activity Float to Minimize the Cash Overdraft
82
4.4 CCFM: Problem Modeling
The problem was modeled similar to Abdel-Raheem’s attempt using Ant
Colony optimization in 2007. Each activity (i) has a number of possible start
dates (J) depending on the availability of the activity total float. A number of wires
(N) composed of (M) segments are generated. The number of segments
corresponds to the number of the project activities (i). Each segment (m) is
randomly assigned possible start date (j) for the activity it represents, as shown
in Figure 4.3.
1 2 3 i IWn d1j d2j d3j dij dIj
Activity Start Date
Activity/Segment No.
Figure 4.3: Wire Representation of the Project Activities Possible Start Dates Scenarios
The dynamic nature of the cash flow management problem is related to
the fact that every time a start date is selected for an activity, the available start
dates for the rest of non-critical activities should be updated. This update is
necessary as some of the available start dates may be rendered invalid if
portions of the total float are utilized by other dependent activities.
The generated wires are connected to an imaginary source of electricity of
voltage (V). The intensity (In) of the current flowing in each wire is calculated
using the objective function given in Equation (4.1). Each wire represents a
possible scenario of the different start dates of the project activities. These start
83
dates are used to schedule the project and determine its completion time. The
project associated costs are then calculated using the objective function
illustrated in Equation (4.1). The global resistances (RN) of the wires are then
calculated using Ohm’s law, and the wires are ranked according to their overall
quality, i.e. global resistance.
The top wires are selected to undergo the sensitivity analysis step using
the best wire (the one with the highest resistance) as a Comparison Wire. The
sensitivity analysis aims to individually evaluate the quality of segment values
(rij). For all the top-ranked wires, each segment value is substituted into its
corresponding segment of the comparison wire, as shown in Figure 4.4. The
change in the global resistance (Rbest) of the best wire is then recorded and
normalized with respect to the original global resistance (Rn) of the wire (n) being
evaluated according to Kirchhoff’s rule, as illustrated in details in Chapter 3. It
should be noted that the sensitivity analysis is expected to generate some
infeasible solutions due to the violation of the interdependency relationships
among the activities. Therefore, when evaluating the quality of values in the
sensitivity analysis step, the contributions of the values generating infeasible
solutions to the change in the resistance of the comparison wire are set to zero.
The local resistances of segment values are then updated to reflect the
actual individual quality of each value in the solution string, according to Equation
(3.5). The selection probabilities of values in the solution space are then
calculated according to Equation (3.6).
84
a b c* d e f g h* i*
Wbest 2 7 1 8 9 10 13 6 12
Wn 3 3 1 9 7 9 13 6 12
Wa 3 7 1 8 9 10 13 6 12Wb 2 3 1 8 9 10 13 6 12Wc 2 7 1 8 9 10 13 6 12Wd 2 7 1 9 9 10 13 6 12We 2 7 1 8 7 10 13 6 12Wf 2 7 1 8 9 9 13 6 12Wg 2 7 1 8 9 10 13 6 12Wh 2 7 1 8 9 10 13 6 12Wi 2 7 1 8 9 10 13 6 12
(*): indicates critical activity
Figure 4.4: Individual Assessment of the Quality of Different Start Dates
4.5 CCFM: Computer Coding
Microsoft Project TM software was used as a primary interface to input the
data, which includes the number of activities, their durations, direct costs, and
relationships. The software is used to schedule the project activities and
determine the project duration for the various scenarios examined throughout the
optimization. Electimize was coded as a macro program using VBA. A user-
friendly interface was created to collect additional data about the number of
iterations, wires, indirect cost, liquidated damages, and interest charged, as
shown in Figure 4.5. The VBA code for solving this problem using Electimize is
documented in Appendix (A-I).
85
Figure 4.5: Using Microsoft Project to Schedule the Project and Store project Data
All the generated wires are exported to MS Project to verify the activity
relationship logic. Wires with illogical relationships are excluded. Once the wires
are verified, they are then exported to a Microsoft Excel spread sheet to perform
the necessary cash flow calculations, and determine the value of the objective
function (wire intensity), as shown in Figure 4.6. The current intensities are
exported back to Electimize to complete the optimization process. The procedure
is repeated until completing the stipulated number of iterations.
86
Project DeadlineActivity Start Date 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Activity Start Date 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Activity Start Date 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 1-2 1 250 250 2502 1-3 3 500 5003 1-5* 1 600 600 600 600 6004 2-6 7 350 350 3505 3-4 8 400 400 400 4006 3-7 9 200 200 200 2007 4-7 12 700 7008 5-6* 6 450 450 450 450 450 4509 6-7* 12 700 700 700
Total Due 850 850 1350 1100 0 600 450 0 800 1200 1400 1050 1050 1600 1400 700 0Received Payment 1000 5000 5000 5000 5000Available 4500 3650 2800 1450 350 350 750 300 300 4500 3300 1900 850 4800 3200 6800 6100 11100Direct Cost 14400Indirect Cost 3200Incentive 0Penalty 1000Intensity 18600
Original Schedule * Critical Activities
Start Date
1-2 1-3 1-5 2-6 3-4 3-7 4-7 5-6 6-7W1 1 3 1 7 8 9 12 6 12
Activity
1-2 1-3 1-5 2-6 3-4 3-7 4-7 5-6 6-7W 2 3 2 1 6 4 7 13 6 12
1-2 1-3 1-5 2-6 3-4 3-7 4-7 5-6 6-7 W 3 2 6 1 9 8 8 12 6 12
Figure 4.6: Cash Flow Distribution for Various Activities Start Dates Scenarios
4.6 CCFM: Application Example
As mentioned earlier, a cash flow management problem that originally
appeared in Ahuja (1983) and reattempted by Abdel-Raheem (2007) using ant
colony optimization was utilized to validate the developed algorithm. The problem
involves a project with nine main construction activities that are originally
scheduled for completion in 14 weeks. The relationships among the activities,
their durations, and their associated weekly expenditures are shown in
Figure 4.7. At the beginning of the project, the contractor has an initial investment
of $4,500; and throughout the duration of the project, the contractor receives a
payment of $1,000 in the 5th week, $5,000 in the 8th week, and $5,000 in the 12th
week. The remaining $5,000 payment is received one week after the project is
87
completed. The direct cost for the project is $16,000. Liquidated damages of
$500 are stipulated by the owner for every week beyond the designated
completion duration (14 weeks). A sum of $200 per week was assumed as an
indirect cost in the project. The original cash flow profile for this project is given in
Figure 4.8.
Figure 4.7: Activity Network of the Cash Flow Management Application Example
Cash Flow Profile
0
2500
5000
7500
10000
12500
15000
17500
20000
22500
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17Weeks
Cos
t ($)
Cumulative Cost
Payment Received
Figure 4.8: Original Cash Flow Profile of the Application Example
88
As discussed earlier, the main objective of this optimization problem is to
maximize the contractor’s profit by the end of the project, given the financial
constraints denoted by the limitation on the availability of funds. In order to
maximize the profit, the contractor should schedule the project activities so that
the total project cost (direct costs, indirect costs and liquidated damages) is
minimized. To this end, each project activity is shifted within the limits defined by
its float so that the total project overdraft is minimized, as shown in Figure 4.9.
Overdraft Profile
-6000-5000-4000-3000-2000-1000
01000200030004000500060007000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Weeks
Cos
t ($)
Gantt Chart
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
123456789
Task
s
Weeks
700 700 700
450 450 450 450 450 450
700 700
200 200 200 200
400 400 400 400
350 350 350
600 600 600 600 600
500 500
250 250 250
Figure 4.9: Gantt Chart and Overdraft Profile of the Application Example
For this optimization problem, Ahuja (1983) stipulated a set of rules to
prioritize the financing of project activities. First, an activity can be executed only
if sufficient funds could be secured to cover its cost. Assuming the availability of
sufficient funds, the activities are financed in the following order: 1) Activities that
89
have the latest start date; 2) Activities with the minimum float; 3) Activities that
lead to a progress payment; 4) Activities that require the largest total budget, and
5) Activities that require the largest daily budget. Second, all activities with the
same start date should start together. Third, the logical relationships among
activities should be maintained throughout the project life.
As mentioned earlier, the problem is modeled to find the optimal start date
for each activity that guarantees minimizing the overall cost while maintaining the
relationships among the project activities. In the original problem, no interest rate
is charged on the used/unused portions of the credit limit; therefore, the objective
function can be reduced to (4.2).
ni l
i 1 Minimize : TI C C (4.2)
=+ +∑
Although the problem at hand may seem simple, in reality, it is a complex
and difficult problem to solve due to its dynamic nature, as discussed earlier.
Second, it is hard to minimize the objective function while satisfying the set of the
given financing constraints. For each activity, there is a set of available start
dates that are determined by the available total float, as shown in Table 4.1.
Once the start date of an activity is selected and part of its float is used, the floats
available for its succeeding activities have to be reduced, rendering some start
dates invalid. For example, if activity 1-2 is scheduled to start on the 3rd week, the
latest start date of activity 2-6 will be the 7th week rendering options 5 and 6 for
this activity invalid. This problem occurred in Elazouni and Metwally’s finance-
90
based scheduling model (2005) and the relationships among activities were
violated when they attempted the problem using Genetic Algorithms. This
necessitated extra effort and coding to fix this problem. To overcome this
problem, Microsoft Project was utilized to maintain the logical relationships
between activities.
Table 4.1: Different Possible Start Dates for Project Activities
Activity Duration Early Start Total Float Opt.1 Opt.2 Opt.3 Opt.4 Opt.5 Opt.6 Opt.7 Opt.8 Opt.91-2 3 1 2 1 2 31-3 2 1 6 1 2 3 4 5 6 71-5* 5 1 0 12-6 3 4 5 4 5 6 7 8 93-4 4 3 6 3 4 5 6 7 8 93-7 4 3 8 3 4 5 6 7 8 9 10 114-7 2 7 6 7 8 9 10 11 12 135-6* 6 6 0 66-7* 3 12 0 12
Different Start Dates Options for Project Activities
4.7 CCFM Application Example: Results and Comparisons
In this problem, Electimize was able to find the optimal solution using 15
iterations and 9 wires in 21.25 minutes on a 2.00 GHz Intel Core 2 Duo computer
with 4.00 GB of memory. The results were then compared to the solutions
obtained by Ahuja (1983), and Abdel-Raheem (2007). The optimal solution
generated by Electimize for this project is a schedule of 15 weeks and a total
cost of $17,900, which is the same duration and cost obtained by Abdel-Raheem
(2007) using Ant Colony optimization. Both solutions are better than the solution
presented by Ahuja (1983), which is 16 weeks with a total cost of $18,600, when
the indirect cost and liquidated damages are considered. Figure 4.10 compares
91
the original solution presented by Ahuja (1983) to the new optimal solution
achieved by Electimize.
In addition, Electimize was able to identify ten different alternative optimal
solutions for the problem, as shown in Table 4.2. This provides an advantage
over Ant Colony Optimization as the developed algorithm is: 1) Capable of
exploring the solution space thoroughly using the sensitivity analysis step, which
allows for evaluating the potential of each value in the solution space regardless
of the quality of the whole solution string (wire); and 2) Designed to calculate the
resistance of each generated value individually, and hence the calculation of the
selection probability, which enables exploring different values and prevents the
convergence towards one given solution. This observation is illustrated in Figure
4.11 which demonstrates the oscillation of selection probability over the different
iterations to enable the exploration of new values and convergence towards the
optimal ones. To further differentiate between the generated solutions, the total
number of critical activities is used as an additional criterion to favor solutions
with higher float levels.
Table 4.2: Alternative Optimal Solutions Identified by Electimize for the Cash Flow Problem
1-2 1-3 1-5* 2-6 3-4 3-7 4-7 5-6* 6-7*7 8 17,900 1 7 1 8 9 9 13 6 12 68 3 17,900 2 7 1 7 9 9 13 6 12 614 3 17,900 2 7 1 7 9 10 13 6 12 614 7 17,900 1 7 1 7 9 9 13 6 12 62 7 17,900 3 7 1 8 9 9 13 6 12 74 6 17,900 2 7 1 9 9 9 13 6 12 77 3 17,900 3 7 1 8 9 9 13 6 12 72 1 17,900 2 7 1 9 9 11 13 6 12 83 3 17,900 3 7 1 9 9 9 13 6 12 89 7 17,900 3 7 1 7 9 11 13 6 12 8
IterationActivities Start Dates No. of Critical
ActivitiesIntensity
(Total Cost)Wire
92
Activity Start Date 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 1-2 3 250 250 2502 1-3 7 500 5003 1-5 1 600 600 600 600 6004 2-6 8 350 350 3505 3-4 9 400 400 400 4006 3-7 9 200 200 200 2007 4-7 13 700 7008 5-6 6 450 450 450 450 450 4509 6-7 12 700 700 700
Total Due 600 600 850 850 850 450 950 0 1300 1400 1400 1050 1300 1400 1400 0 0Received Payment 1000 5000 5000 5000 5000Available 4500 3900 3300 2450 1600 750 1300 350 350 4050 2650 1250 200 3900 2500 6100 6100 11100Direct Cost 14400Indirect Cost 3000Incentive 0Penalty 500Intensity 17900
Original Schedule Ahuja(1983) Solution
Figure 4.10: Cash Flow Distribution of the Optimal Solution
By investigating Figure 4.11, it can be noticed that the selection probability
for the given three start dates for activity (1-2) changed from one iteration to
another to allow for the exploration of its different values. Eventually, the three
start date options maintained almost the same probability of selection towards
the end of the iterations. This occurs because the three values can be part of the
optimal solution as indicated by the problem multiple solutions identified in Table
4.2. On the other hand, although the selection probabilities of the seven start
dates options of activity (1-3) oscillate and vary greatly through different
iterations, the solutions still converge to one value, which is start date (7). It is
also clear -as indicated in Table 4.2- that this value has been consistently part of
all the multiple optimal solutions identified.
93
0.13
0.14
0.15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Iteration
Prob
abili
ty
1 2 3 45 6 7
b) Selection Probability of Different Start Dates of Activity (1-3)
0.32
0.33
0.34
0.35
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Iteration
Prob
abili
ty1 2 3
a) Selection Probability of Different Start Dates of Activity (1-2)
Figure 4. 1: Selection Probabilities for Start Dates of Activities 1-2 and 1-3
4.8 Summary and Conclusion
This chapter presented the application of Electimize to a construction cash
flow management problem. The main objective in this chapter is to verify the
newly developed innovative method for evaluating the quality of decision variable
values and its effect on directing the search towards the optimal solution(s). The
chapter presented the efforts made to model the problem, and the application of
Electimize to solve it.
The results obtained by Electimize were compared to two previous
attempts. The comparison showed that Electimize has an advantage over these
algorithms demonstrated by the identification of multiple optimal solutions rather
than a single solution. This proves that the algorithm has high capabilities of
searching the solution space. In other words, it does not converge to one value,
but it keeps searching the solution space for alternatives. This quality should
prove Electimize useful in solving of a wide range of NP-hard optimization
problems especially the multimodal ones.
94
CHAPTER 5: DEVELOPING AND TESTING INTERNAL PROCESSES TO EXPLORE THE SOLUTION
SPACE EXTENSIVELY
5.1 Introduction
As discussed in chapter 1, the second objective of this research is to
design an algorithm with expanded capabilities of finding the optimal solution for
a wide range of optimization problems of class NP-hard. The philosophy of the
work revolved around the idea that increasing the capability of the algorithm to
explore the solution space will increase its chances of finding the optimal
solution. In the previous chapter, it was shown that some of the internal
processes of the algorithms enabled the algorithm not only to find the optimal
solution, but also to identify alternative solutions with the same level of optimality.
The main processes that contributed to this accomplishment are: 1) Individual
evaluation of the quality of decision variable values, which is captured in the
sensitivity analysis step; and 2) Method used for calculating the selection
probability.
This chapter aims to examine the capability of Electimize in exploring the
solution space. Two combinatorial optimization problems were used for this
purpose. The two problems belong to the NP-hard class. The first problem is an
asymmetric multimodal travelling salesman problem (TSP) that was designed
and solved mathematically to identify all the possible optimal solutions. The
95
second problem is a symmetrical bench-mark TSP from the literature. The
solutions of both problems are known before hand.
5.2 Methodology
The travelling salesman problem was used to test the capability of
Electimize in exploring the solution space through the identification of the optimal
tours(s) of the problem. The TSP was selected for three main reasons. First, the
TSP is an NP-complete problem. This means that the processing time of any
algorithm used to solve the problem is most likely to increase exponentially with
the increasing the number of cities linearly. Second, the TSP is the hardest to
solve in its class, i.e. NP-Complete4. Third, the TSP has direct application in the
construction industry, as discussed in chapter 2.
The main objective in solving the TSP is to find the shortest tour between
a number of cities. The objective of the TSP can be minimizing time, cost or
distance. The TSP problem can either be symmetric or asymmetric. A symmetric
TSP instance implies that the distance, time, or cost between any two given cities
is equal regardless of which one is selected as a starting point. Adversely, an
asymmetric TSP indicates that the travelling distance, time, or cost between
cities A and B is not equal to that between B and A. In both cases, and in a
regular TSP, the tour always starts from a definite start point.
An asymmetric multimodal TSP was designed to examine the
performance of Electimize in searching the solution space. A multimodal 4 The notion of NP-Complete was discussed in Chapter 2
96
optimization problem is known to have a number of alternative solutions, i.e.
multiple global optima, as demonstrated in Figure 5.1. The problem is a small
size problem that is composed of 9 cities. The problem was designed so that it
has alternative optimal routes, i.e. same optimum value. It should be noted that
the problem was selected as small size so that all possible solutions can be
determined through permutations, and hence identify the optimal ones.
To complicate the problem and rigorously test the performance of the
algorithm, the start city was left undefined. This means that there are 9 possible
start points, representing the 9 cities, yielding 362,880 possible solutions. For the
selected problem, there are 27 global optima that were determined
mathematically, i.e. using permutations.
00
X
f(x)
Figure 5.1: Multiple Global Minima for a Hypothetical Multimodal Minimization Problem
Testing the capabilities of Electimize was extended to include its
application to a symmetric TSP. Any symmetric TSP is a bi-modal optimization
problem. For example, in a 3-city TSP, if the optimal tour is known to be 1-2-3-1
97
and alternative optimal solution for this problem would be the reverse of this tour,
which is 1-3-2-1. A symmetric bench mark TSP problem was selected from the
literature to verify the capabilities of the algorithm. The problem selected is
referred to as Ulysses16 in the TSPlib5. The instance is composed of 16 cities
with the optimum solution known beforehand. The Ulysses16 is a complex
problem and has 1.31x1012 possible solutions. The optimal solution for this
problem is known.
Unlike the asymmetric TSP described earlier, the tours in this benchmark
symmetric TSP always starts from definite starting point. In this problem, the
target set is to test the capabilities of Electimize of identifying the optimal tour in
one direction and its reverse, i.e. alternative optimal solution.
5.3 Problem Modeling
A very important step in solving any optimization problem is the
appropriate modeling of the problem in a mathematical form. The model should
be well designed to capture all the given information about the problem and its
constraints. This is critical step is required to facilitate the efficient application of
the optimization algorithm.
5.3.1 Modeling Schemes:
Identifying the sequence of the cities in the optimal tour of a TSP can be
accomplished in two ways: 1) Identifying the sequence of any given city with
5 TSPlib is an online library that contains data for a wide range of benchmark TSP instances of different sizes along with their best known optimal solution.
98
respect to the city preceding it or 2) Identifying the position of the city in the tour
independent of any relationship with other cities. For example, for a 4-city TSP, if
the optimal tour identified is A-D-B-C-A, it can be stated that the city B
succeeding city D is part of the optimal tour. Alternatively, it can be thought of as
city B is the third city in the optimal tour. Therefore, two modeling schemes were
considered in solving the TSP using Electimize. The first scheme assumes that
there are interdependencies between the cities. In other words, it is assumed that
the probability of selecting a city is dependent on the city before it in the tour
regardless of its position in the tour. The methodology used in this modeling
scheme aims to identify portions of the optimal tour regardless of their position in
the tour. This will eventually be used to lead the algorithm to find the optimal
tour(s). As illustrated in Figure 5.2a, the sequence of cities (b) and (c) was
identified to be part of the optimal tour. Consequently, they are selected in the
same sequence in the subsequent optimization cycles (i.e. next set of generated
wires) regardless of their position in the tour.
The second scheme assumes that each city is independent of the rest of
the cities; and the probability of its selection is associated with its position in the
sequence of the tour. The objective of this modeling scheme is to determine the
position of each city in the optimal tour independently. As shown in Figure 5.2b,
city (b) was identified as the second city in the optimal tour. Therefore, it was
selected in the same position in the next wire generated independent of any
relationship with the rest of the cities. The two schemes will be discussed in the
following sections in more detail.
99
(a)
(b)(c)
(d)
(e)
1
2
3
4
5
(a)
(b)(c)
(d)
(e)
1
2
3 4
5
(a)
(b)(c)
(d)
(e)
1
23
4
5
(a)
(b)(c)
(d)
(e)1
2
3
4
5
a b
Figure 5.2: Different Modeling Schemes of the TSP Using Electimize
5.3.2 Using Electimize to Explore the Solution Space of the TSP:
As mentioned in chapter 3, Electimize is comprised of 9 main steps. Each
step will be discussed in detail with a main emphasis on modeling of the
multimodal TSP and the application of Electimize to solve it.
1. Fabrication of wires (trial solutions): A number of (N) wires composed
of (M) segments are fabricated. Each segment in a wire represents a city
in the tour, as shown in Figure 5.2. The city selected for each segment is
chosen randomly based on the selection probability discussed in step 8.
100
W1 1 3 5 8 7 9 4 2 6 1
W2 8 3 9 1 5 2 4 6 7 8
W3 4 8 5 7 3 1 6 9 2 4
W4 2 8 3 4 9 6 7 1 5 2
W5 5 9 4 6 2 7 8 1 3 5
Figure 5.3: Wire Representation of a 9-City TSP Tour
2. Construction of the electric circuit: The fabricated wires are then
connected to an imaginary source of electricity that has a voltage (V). The
value of (V) is calculated as the intensity (In) of any randomly selected wire
raised to the power of (G)6. For example, if the first wire in Figure 5.2 is
used to assign an appropriate voltage to the circuit, the voltage can be
calculated as V= 1351.5.
3. Determining the electric current intensity (In): The total travel distance
in the tour is modeled as the intensity of electric current passing through
each branch of the circuit. . The intensity is calculated by substituting the
travel distances between the cities selected by any given wire in the
objective function. The objective function is stated as:
m ij
j i 1Minimize : D
= +∑
6 An arbitrary value in the range of [1.5, 1.9[ used to calculated the voltage (V) of the electric circuit, as discussed in Chapter 4.
101
where, Dij: distance between cities (i) and (j), and m: total number of
segments in the wire. The travel distances between cities are known
before hand and stored in the distance matrix. According to Table 5.1., the
intensities of the electric current passing through the wires in Figure 5.2
are calculated and tabulated in Table 5.2.
Table 5.1: Travel Distance Matrix of the 9-City TSP
City 1 2 3 4 5 6 7 8 9
1 0 23 12 2 21 15 8 6 152 7 0 25 26 13 6 13 23 213 11 1 0 26 20 15 14 18 154 4 19 10 0 15 4 14 8 235 24 18 13 5 0 3 14 20 266 18 10 16 15 24 0 6 14 167 21 7 10 18 9 2 0 2 268 16 8 26 10 11 26 2 0 239 6 15 15 12 19 10 10 7 0
4. Calculating the resistance of wires (Rn): The global resistance (Rn) of
each wire (n) is calculated using Ohm’s Law Rn= V/In.
5. Evaluating the quality of wires: The wires are ranked according to their
global resistances (Rn). The best wire is identified as the wire with the
least resistance, i.e. shortest tour. The best wire is then used as a
comparison medium to evaluate the quality of the wire segments, as
discussed in the next step. The wire resistances and ranks are given in
Table 5.2.
102
Table 5.2: Intensities and Resistances of the Wires Generated in Figure 5.3
In Rn RankW1 135 11.62 4W2 124 12.65 2W3 126 12.45 3W4 174 9.01 5W5 115 13.64 1
Wn
V=1568.56
6. Evaluating the quality of wire segments: As mentioned in chapter 3, the
evaluation of the quality of segments is done by determining their actual
local resistances. The first step is to determine the initial local segment
resistance, which is calculated as (rnm=Rn/M) according to Equation (3.1).
A sensitivity analysis is then conducted by substituting each decision
variable value in the best wire (comparison wire) among them. The
change in the comparison wire global resistance (∆R) is then recorded,
and the local resistances are updated in accordance.
Two modeling schemes were considered for solving the TSP using
Electimize. In the first scheme, the evaluation process is thought of as an
assessment of the relationship between a segment value and its
successor, rather than an assessment of the quality of an individual
segment’s value.
When conducting sensitivity analysis in the first scheme, the first step is to
determine the segment value (cityeva) being evaluated and its successor
(citysuc). The succeeding city (citysuc) is then placed in its corresponding
103
position in the comparison wire, i.e. after (cityeva). This in turn will create a
violation in the logic of the sequence of the tour of the comparison wire.
Consequently, the second step alleviates this violation by substituting the
city replaced (cityrep) in the comparison wire in place of the value that
replaced it, i.e. (citysuc), as illustrated in Figures 5.4a and 5.4b.
Special attention should be given if the city being replaced (cityrep) in the
comparison wire is the starting point of the tour. If the TSP has no defined
starting point, the sensitivity analysis will follow the same logic described
above, as shown in Figure 5.4b. However, if a definite start point is known,
which means that the tour will always start from city 1, then a different
procedure is followed. If the city succeeding (citysuc) the segment value
being evaluated (cityeva) will have to replace the starting city of the tour,
then the segment value being evaluated (cityeva) will replace the city
preceding (cityrep) its successor (citysuc) in the comparison wire, as
demonstrated in Figures 5.4c and 5.4d.
104
Wbest 5 9 4 6 2 7 8 1 3 5 Wbest 1 3 9 2 5 4 8 7 6 1
Wn 4 8 5 7 3 1 6 9 2 4 Wn 1 8 7 3 5 2 4 6 9 1
Wbest 5 9 4 8 2 7 8 1 3 5 Wbest 1 8 9 2 5 4 8 7 6 1
Wbest 5 9 4 8 2 7 6 1 3 5 Wbest 1 8 9 2 5 4 3 7 6 1
(a) (c)
Wbest 5 9 4 6 2 7 8 1 3 5 Wbest 1 3 9 2 5 4 8 7 6 1
Wn 4 8 5 7 3 1 6 9 2 4 Wn 1 8 7 3 5 2 4 6 9 1
Wbest 1 9 4 6 2 7 8 1 3 1 Wbest 1 6 9 2 5 4 8 7 6 1
Wbest 1 9 4 6 2 7 8 5 3 1 Wbest 1 6 9 2 5 4 8 7 3 1(b) (d)
Legend
Step 1
Step 2
Step 1 Step 1
Evaluation of the First Segemnt Value Evaluation of the First Segemnt Value
Step 1
Cityrep
Step 2
Step 2
Evaluation of a Middle Segemnt Value
Cityeva Citysuc
Case 1: TSP with an Undefined Start Case 2: TSP with a Defined Start
Step 2
Evaluation of a Middle Segemnt Value
Figure 5.4: Different Cases of the TSP Sensitivity Analysis using the First Modeling Scheme (Segment Values to Be Evaluated are in Blue)
In the second modeling scheme, the quality of a certain value is
associated with its position in the tour. The quality evaluation is based on
the change in the tour length when the value is placed at different
positions in the tour. In this modeling scheme, the first step in conducting
the sensitivity analysis is to place the value of the segment being
evaluated (cityeva) in its corresponding segment (cityrep) of the comparison
wire. The second step is to copy the value being replaced (in the
comparison wire (cityrep) to the original position of the city being evaluated
(cityeva) in the comparison wire, as shown in Figure 5.5.
105
City Position 1 2 3 4 5 6 7 8 9 1 City
Position 1 2 3 4 5 6 7 8 9 1
Wbest 5 9 4 6 2 7 8 1 3 5 Wbest 1 3 9 2 5 4 8 7 6 1
Wn 4 8 5 7 3 1 6 9 2 4 Wn 1 8 7 3 5 2 4 6 9 1
Wbest 4 9 4 6 2 7 8 1 3 4 Wbest 1 3 9 2 5 4 8 7 6 1
Wbest 4 9 5 6 2 7 8 1 3 4 Wbest 1 3 9 2 5 4 8 7 6 1
(a) (c)
Wbest 5 9 4 6 2 7 8 1 3 5 Wbest 1 3 9 2 5 4 8 7 6 1
Wn 4 8 5 7 3 1 6 9 2 4 Wn 1 8 7 3 5 2 4 6 9 1
Wbest 5 9 4 6 3 7 8 1 3 5 Wbest 1 3 9 2 5 4 8 7 9 1
Wbest 5 9 4 6 3 7 8 1 2 5 Wbest 1 3 6 2 5 4 8 7 9 1(b) (d)
Legend
Step 2 Step 2
Evaluation of the First Segemnt Value Evaluation of the First Segemnt Value
Step 1 Step 1
Evaluation of a Middle Segemnt Value Evaluation of a Middle Segemnt Value
Cityeva Cityrep
Case 2: TSP with a Defined Start
Step 2 Step 2
Step 1 Step 1
Case 1: TSP with an Undefined Start
Figure 5.5: Different Cases for Evaluating Different Wire Segments Using the Comparison Wire in the Second Modeling Scheme
Once these modifications in the segments of the comparison wire are
completed, the change in the current intensity passing through the
comparison wire and its resistance are recorded. The local resistances of
the segments are then normalized and updated in accordance with
Equations (3.2), (3.3), and (3.4); and as illustrated in Figures 5.6 and 5.7.
It should be noted that the change in resistance (H) in both modeling
schemes was divided by 4, which is rooted to the nature of the problem
and not the original algorithm. This occurs due to the fact that the
substitution of any segment value in the comparison wire will introduce
four new relationships or change four city positions, as shown in Figure
5.8. Consequently, the change in resistance cannot be attributed to
106
segment value being evaluated; it should be rather thought of as the
contribution of the four new arrangements in the comparison wire.
WBest = W5 5 9 4 6 2 7 8 1 3 5a b c d e f g h i a
W2 8 3 9 1 5 2 4 6 7 8
1 2 3 4 5 6 7 8 9 1 In |Rn| H rnm(1-H) r*nm
Wa 5 9 4 6 2 7 8 3 1 5 125 12.548 0.020 1.377 1.385Wb 9 3 4 6 2 7 8 1 3 9 113 13.881 -0.004 1.412 1.419Wc 5 9 1 6 2 7 8 4 3 5 112 14.005 -0.007 1.415 1.422Wd 3 9 4 6 2 7 8 1 5 3 106 14.798 -0.021 1.435 1.443We 6 9 4 5 2 7 8 1 3 6 119 13.181 0.008 1.394 1.401Wf 5 9 7 6 2 4 8 1 3 5 130 12.066 0.029 1.365 1.372Wg 5 9 4 6 2 7 8 1 3 5 115 13.640 0.000 1.406 1.413Wh 5 9 4 6 7 2 8 1 3 5 126 12.449 0.022 1.375 1.382Wi 5 9 4 6 2 7 8 1 3 5 115 13.640 0.000 1.406 1.413
12.584 12.65
Wire Segments
Figure 5.6: Calculating the Modified Local Resistances of Segments in the First Modeling Scheme
WBest = W5 5 9 4 6 2 7 8 1 3 5a b c d e f g h i a
W2 8 3 9 1 5 2 4 6 7 8
1 2 3 4 5 6 7 8 9 1 In |Rn| H rnm(1-H) r*nm
Wa 8 9 4 6 2 7 5 1 3 8 125 12.548 0.020 1.377 1.405Wb 5 3 4 6 2 7 8 1 9 5 118 13.293 0.006 1.397 1.425Wc 5 4 9 6 2 7 8 1 3 5 111 14.131 -0.009 1.418 1.447Wd 5 9 4 1 2 7 8 6 3 5 142 11.046 0.048 1.339 1.366We 2 9 4 6 5 7 8 1 3 2 106 14.798 -0.021 1.435 1.464Wf 5 9 4 6 7 2 8 1 3 5 126 12.449 0.022 1.375 1.402Wg 5 9 8 6 2 7 4 1 3 5 136 11.534 0.039 1.351 1.378Wh 5 9 4 1 2 7 8 6 3 5 142 11.046 0.048 1.339 1.366Wi 5 9 4 6 2 3 8 1 7 5 128 12.254 0.025 1.370 1.397
12.401 12.65
Wire Segments
Figure 5.7: Calculating the Modified Local Resistances of Segments in the Second Modeling Scheme
107
WBest = W5 5 9 4 6 2 7 8 1 3 5 5 9 4 6 2 7 8 1 3 5
W2 8 3 9 1 5 2 4 6 7 8 8 3 9 1 5 2 4 6 7 8
We 5 2 4 6 9 7 8 1 3 5 2 9 4 6 5 7 8 1 3 2(a) First Modeling Scheme (b) Second Modeling Scheme
Figure 5.8: The Four Relationship Changes Occurring in the Comparison Wire during the Sensitivity Analysis
7. Updating segment value resistances (rml): The segment value
resistances (rml) are then updated according to Equation (3.5). By using
the same wire utilized to calculate the volt (V), the initial resistance (r0) of
all values in the solution space for all segments is set to [(1351.5 ÷135) ÷9]
= 1.3.
8. Selection of new values (lnm) for the variables: Each variable in the
objective function is represented by a segment that is assigned a value
from the solution space. The values are selected according to a certain
probability, which in turn is based on the local resistances. The
probabilities are updated in each iteration using the following Equation for
minimization problems:
^ml ml L ^
mll 1
rP(r )
=
=
∑
Where Pml: probability that value (l) is selected for segment (m), and
mlr∧
: updated resistance for value (l) of segment (m).
108
Although the procedure of calculating probabilities is the same in each
modeling scheme, the final probability matrix is different. The dimensions
of the probability matrix is (Ncities x Ncities), Where N is the number of the
cities in the problem.
In the first modeling scheme, each row in the matrix represents the
probabilities that any of the available cites will succeed a designated city
in the tour. Consequently, the summation of the probabilities across any
row is equal to 1, and the matrix has a zero diagonal. However, the matrix
is asymmetric, as shown in Table 5.3a.
In the second modeling scheme, each column stores the probabilities that
any of the cities in the tour will be selected in a certain position in the
sequence of the tour. Hence, the summation of the probabilities across the
columns is equal to 1, as illustrated in Table 5.3b.
The matrixes given in Table 5.3 represent the general case of the TSP,
i.e. with no defined start city for the tour. However, if the TSP has a
definite start city, then the matrixes can be reduced, as shown in Table
5.4a and 5.4b, for the first and the second modeling schemes,
respectively.
109
Table 5.3: Probability Matrixes for Different Modeling Schemes of a 9-city TSP with an Undefined Start City
Cities 1 2 3 4 5 6 7 8 9 Total1 0 0.108 0.108 0.151 0.090 0.092 0.183 0.134 0.133 12 0.160 0 0.089 0.097 0.130 0.153 0.124 0.103 0.144 13 0.124 0.180 0 0.083 0.150 0.104 0.128 0.108 0.123 14 0.108 0.112 0.169 0 0.107 0.181 0.103 0.127 0.093 15 0.095 0.101 0.123 0.187 0 0.142 0.119 0.099 0.134 16 0.100 0.138 0.105 0.101 0.123 0 0.142 0.146 0.146 17 0.083 0.101 0.132 0.130 0.126 0.137 0 0.183 0.110 18 0.110 0.126 0.104 0.121 0.174 0.102 0.154 0 0.108 19 0.125 0.106 0.146 0.125 0.076 0.151 0.122 0.149 0 1
PositionCities 1 2 3 4 5 6 7 8 9
1 0.320 0.156 0.119 0.125 0.100 0.114 0.098 0.143 0.1632 0.077 0.065 0.182 0.080 0.073 0.114 0.093 0.109 0.0903 0.092 0.096 0.085 0.175 0.132 0.121 0.128 0.099 0.1124 0.098 0.091 0.070 0.065 0.158 0.103 0.103 0.102 0.0885 0.064 0.139 0.100 0.144 0.085 0.094 0.186 0.162 0.1016 0.078 0.146 0.078 0.082 0.100 0.065 0.113 0.056 0.1167 0.071 0.086 0.134 0.103 0.123 0.101 0.085 0.164 0.1218 0.147 0.070 0.096 0.114 0.099 0.126 0.104 0.065 0.1239 0.053 0.151 0.134 0.112 0.130 0.163 0.090 0.101 0.086
Total 1 1 1 1 1 1 1 1 1
(a) First Modeling Scheme
(b) Second Modeling Scheme
Table 5.4: Probability Matrixes for Different Modeling Schemes of a 9-city TSP with a Defined Start City
Cities 1 2 3 4 5 6 7 8 9 Total1 0 0.108 0.108 0.151 0.090 0.092 0.183 0.134 0.133 12 0 0 0.112 0.119 0.153 0.176 0.147 0.126 0.166 13 0 0.198 0 0.101 0.168 0.122 0.146 0.125 0.140 14 0 0.127 0.184 0 0.123 0.196 0.118 0.143 0.109 15 0 0.115 0.136 0.201 0 0.156 0.133 0.112 0.147 16 0 0.152 0.119 0.115 0.138 0 0.156 0.160 0.160 17 0 0.113 0.143 0.141 0.137 0.149 0 0.195 0.122 18 0 0.142 0.119 0.137 0.190 0.118 0.170 0 0.124 19 0 0.124 0.164 0.143 0.094 0.168 0.140 0.167 0 1
PositionCities 1 2 3 4 5 6 7 8 9
1 1 0 0 0 0 0 0 0 02 0 0.075 0.192 0.089 0.083 0.123 0.102 0.118 0.1003 0 0.107 0.097 0.186 0.144 0.132 0.139 0.111 0.1234 0 0.103 0.082 0.077 0.170 0.115 0.115 0.114 0.1005 0 0.147 0.108 0.152 0.093 0.102 0.194 0.170 0.1096 0 0.156 0.088 0.092 0.110 0.075 0.123 0.065 0.1267 0 0.094 0.143 0.112 0.131 0.110 0.094 0.173 0.1308 0 0.089 0.115 0.132 0.117 0.144 0.122 0.083 0.1419 0 0.229 0.141 0.159 0.136 0.199 0.097 0.165 0.092
Total 1 1 1 1 1 1 1 1 1(b) Second Modeling Scheme
(a) First Modeling Scheme
110
At the beginning of the first iteration, the initial resistance (r0) is used to
calculate the selection probabilities of the cities for the first population of
wires.
For any given iteration, if the TSP has a defined start then the first city in
the tour will always get the first segment. However, if the TSP has no
defined start, then the initial resistances of the whole matrix is normalized
to the unity, and the first city is selected based on a random number
generated, as shown in Table 5.5.
Table 5.5: Normalized Probabilities Used for the Selection of the First City at the Beginning of any Iteration for the TSP with No Defined Start City
Cities 1 2 3 4 5 6 7 8 91 0 0.010 0.015 0.021 0.012 0.013 0.001 0.017 0.0162 0.009 0 0.013 0.014 0.019 0.015 0.015 0.008 0.0143 0.021 0.012 0 0.012 0.017 0.009 0.012 0.017 0.0144 0.012 0.011 0.016 0 0.016 0.020 0.011 0.015 0.0145 0.012 0.018 0.012 0.015 0 0.016 0.015 0.012 0.0206 0.014 0.019 0.014 0.009 0.007 0 0.017 0.019 0.0177 0.012 0.014 0.021 0.008 0.017 0.001 0 0.016 0.0188 0.015 0.019 0.014 0.008 0.014 0.010 0.020 0 0.0139 0.019 0.016 0.001 0.015 0.001 0.014 0.015 0.020 0
Total=1
Every time a city is selected, the probability matrix is updated to
accommodate the change in the availability of values for the rest of
segments. In the first modeling scheme, when a city is selected, its
selection probabilities all over the matrix are set to zero, and the rows are
normalized to one, as illustrated in Figure 5.9a. In the second modeling
scheme, if a city is selected for a certain position in the tour, the
probabilities stored in the column representing this position as well as the
selection probabilities of the selected city for different positions along the
111
rows are set to zero, as illustrated in Figure 5.9b. The rest of columns are
then normalized to one.
9. Algorithm Termination: The Algorithm is terminated after a specified
number of iterations are reached.
1 2 3 4 5 6 7 8 9
Wn 5 8 3 ….. ….. ….. ….. ….. …..
Cities 1 2 3 4 5 6 7 8 9 Total1 0 0.162 0 0.226 0 0.138 0.274 0 0.200 12 0.236 0 0 0.143 0 0.226 0.183 0 0.212 13 0.167 0.242 0 0.112 0 0.141 0.172 0 0.166 14 0.180 0.188 0 0 0 0.303 0.173 0 0.156 15 0.122 0.130 0 0.241 0 0.183 0.153 0 0.172 16 0.159 0.220 0 0.161 0 0 0.227 0 0.233 17 0.148 0.181 0 0.231 0 0.244 0 0 0.196 18 0.153 0.175 0 0.168 0 0.141 0.213 0 0.150 19 0.199 0.169 0 0.199 0 0.240 0.194 0 0 1
Cities 1 2 3 4 5 6 7 8 91 0 0 0 0.221 0.100 0.173 0.098 0.211 0.1632 0 0 0 0.140 0.073 0.172 0.093 0.161 0.0903 0 0 0 0 0 0 0 0 04 0 0 0 0.115 0.158 0.156 0.103 0.151 0.0885 0 0 0 0 0 0 0 0 06 0 0 0 0.145 0.100 0.098 0.113 0.083 0.1167 0 0 0 0.182 0.123 0.153 0.085 0.244 0.1218 0 0 0 0 0 0 0 0 09 0 0 0 0.197 0.130 0.248 0.090 0.150 0.086
Total 0 0 0 1 1 1 1 1 1
(a) First Modeling Scheme
(b) Second Modeling Scheme
Figure 5.9: Changes Accommodated in the Probability Matrix after Selection of Values from the Solution Space for the Two Modeling Schemes
5.4 Computer Coding
The algorithm was coded using Visual Basic for Application as a macro in
Microsoft Excel. A simple interface was developed for the user to input the data
regarding the number of iterations, number of wires, size of the instance, and
112
number of wires performing the sensitivity analysis as shown in Figure 5.10.
Separate multiple sheets were prepared to store distance matrixes and the
output solutions. Various data were collected to trace and verify the logic in
computation. The VBA code is given in Appendix (A-II).
Figure 5.10: Screenshot of the User Interface Developed for the TSP
5.5 Experimentation and Results
First, it was essential to decide on the best modeling scheme to use
throughout the experimentations. Several preliminarily experiments were
conducted to test the performance of the two modeling schemes. The results
showed that the first modeling scheme outperforms the second one in terms of
convergence toward the optimal solution and the quality of solutions obtained. It
should be noted that the first modeling scheme entails more computational
efforts, which slightly increases the computational time compared to the second
modeling scheme.
113
5.5.1 Results of the 9-City TSP Using Electimize:
5.5.1.1 Undefined Start:
The 9-city TSP is a multimodal combinatorial optimization problem. If the
problem has no specified start point, there are 27 alternative optimal solutions, as
shown in Table 5.6. The optimal solution for this problem is 61 distance units.
Several experiments were conducted by varying the number of iterations,
number of wires, and number of best wires used in the sensitivity analysis step.
The best result were obtained using 200 iterations, 200 wires and the top 9 best
wires in each iteration. Electimize was able to identify 21 solutions out of the 27,
which are highlighted in Table 5.6.
5.5.1.2 Defined Start:
The 9-TSP with a defined start has three alternative solutions. When city 1
was defined as the start of the tour, Electimize was able to identify the three
alternative optimal solutions using 160 iterations, 160 wires, and the top 9 wires
in each iteration, as shown in Table 5.6.
It is worth mentioning that the capability of Electimize in exploring the
solution space is demonstrated by its ability to identify other local minima without
getting trapped in them. Some of these local minima have values very close to
the optimal solution, as shown in Table 5.7.
114
Table 5.6: Alternative Optimal Solutions for the 9-City TSP
No. Optimum Value
1 1 4 6 9 8 7 5 3 2 1 612 1 4 8 7 3 2 5 6 9 1 613 1 8 7 5 4 3 2 6 9 1 614 2 1 4 6 9 8 7 5 3 2 615 2 5 6 9 1 4 8 7 3 2 616 2 6 9 1 8 7 5 4 3 2 617 3 2 1 4 6 9 8 7 5 3 618 3 2 5 6 9 1 4 8 7 3 619 3 2 6 9 1 8 7 5 4 3 61
10 4 3 2 6 9 1 8 7 5 4 6111 4 6 9 8 7 5 3 2 1 4 6112 4 8 7 3 2 5 6 9 1 4 6113 5 3 2 1 4 6 9 8 7 5 6114 5 4 3 2 6 9 1 8 7 5 6115 5 6 9 1 4 8 7 3 2 5 6116 6 9 1 4 8 7 3 2 5 6 6117 6 9 1 8 7 5 4 3 2 6 6118 6 9 8 7 5 3 2 1 4 6 6119 7 3 2 5 6 9 1 4 8 7 6120 7 5 3 2 1 4 6 9 8 7 6121 7 5 4 3 2 6 9 1 8 7 6122 8 7 3 2 5 6 9 1 4 8 6123 8 7 5 3 2 1 4 6 9 8 6124 8 7 5 4 3 2 6 9 1 8 6125 9 1 4 8 7 3 2 5 6 9 6126 9 1 8 7 5 4 3 2 6 9 6127 9 8 7 5 3 2 1 4 6 9 61
Optimal Tours
Table 5.7: Local Minima Identified by Electimize for the 9-City TSP
No. Value1 9 8 7 5 4 1 3 2 6 9 622 1 8 7 3 2 5 4 6 9 1 633 2 5 4 6 9 1 8 7 3 2 634 6 9 8 7 3 2 1 4 5 6 635 9 3 2 6 7 8 5 4 1 9 656 3 2 5 4 8 7 6 9 1 3 657 5 4 1 3 2 6 9 7 8 5 67
Other Sub-optimal Tours
5.5.2 Results of the 16-City TSP (Ulysses16) Using Electimize:
The Ulysses16 is a symmetric benchmark TSP consisting of 16 cities. The
problem has a defined start, which is City1. The data of this problem is available
on many TSP libraries online. Although the coordinates of the cities of this
problem are given in degree.minute, several researches in the past attempted
this problem as a 2-D problem using Cartesian coordinates. Therefore, the
distance between each pair of cities was calculated twice as: 1) Geographic
115
distance (GEO) using latitudes and longitudes, and 2) Euclidian distance in a two
dimensional Cartesian plane using the Pythagorean Theorem. In turn, there are
two attempts of the problem with respect to the two methods of calculating the
distances among cities. The data of the problem and the distance matrixes are
given in Appendix (B-I).
5.5.2.1 Ulysses16: Optimal Solution for the GEO Distance Method:
The optimal solution for the Ulysses16 TSP problem is 6,859 km.
Electimize was able to find the optimal solution using 250 iterations and 500
wires. The top 21 wires were used to conduct the sensitivity analysis.
Additionally, Electimize was able to identify the alternative optimal solution, which
is the reverse tour.
The curve in Figure 5.11 shows that Electimize was able to reach the
optimal tour and its reverse in the 36th and 37th iterations, respectively. It is worth
noting that one of the capabilities of Electimize is its fast convergence toward the
global optima by narrowing the search zone within the first 10% of the total
iterations demonstrated by the dramatic decrease in the values found for the
objective function, as illustrated in Figure 5.11. The optimal tours along with
some of the best tours identified are given in Table 5.8.
116
6000
6250
6500
6750
7000
7250
7500
7750
8000
8250
8500
0 25 50 75 100 125 150 175 200 225 250 275
Iteration
Tour
Dis
tanc
e
Figure 5.11: Convergence toward Optimal Solution for Ulysses16 (GEO) Using Electimize
Table 5.8: Best Tours Identified by Electimize for Ulysses16 (GEO)
No. Value1 1 14 13 12 7 6 15 5 11 9 10 16 3 2 4 8 1 68592 1 8 4 2 3 16 10 9 11 5 15 6 7 12 13 14 1 68593 1 13 14 12 7 6 15 5 11 9 10 16 3 2 4 8 1 68654 1 8 4 2 3 16 13 14 15 5 11 9 10 6 7 12 1 68955 1 8 4 2 3 16 14 15 5 11 9 10 6 7 12 13 1 69236 1 8 4 2 3 16 14 15 5 11 9 10 7 6 12 13 1 69267 1 8 4 2 3 16 14 15 5 11 9 10 7 6 13 12 1 6975
Best Tours for Ulysses16 (GEO)
5.5.2.2 Ulysses16: Optimal Solution for the Euclidian Distance Method:
Although there is no optimal solution known for the Ulysses16 using
Euclidian distance method of calculations, several attempts were made in the
past. The best optimal tours found for this problem had a total distance of 73.999
km (Cook 2000) and 73.9876 km (Wang et al 2005).
Electimize was able to find both tours using 120 iterations and 210 wires.
The sensitivity analysis step deployed the top 12 wires in each iteration. As
shown in Figure 5.12, Electimize was able to find the optimal solution (73.9876)
117
in the 12th iteration and its reverse in 23rd iteration. The optimal tours and some
of the best tours found are given in Table 5.9.
60
65
70
75
80
85
90
95
100
105
0 20 40 60 80 100 120 140
Iteration
Tour
Dis
tanc
e
Figure 5.12: Convergence toward Optimal Solution for Ulysses16 (ECU) Using Electimize
Table 5.9: Best Tours Identified by Electimize for Ulysses16 (ECU)
No. Value1 1 16 12 13 14 6 7 10 9 11 5 15 8 4 2 3 1 73.9882 1 3 2 4 8 15 5 11 9 10 7 6 14 13 12 16 1 73.9883 1 14 15 5 11 9 10 6 7 12 13 16 3 2 4 8 1 73.999834 1 8 4 2 3 16 12 13 14 15 5 11 9 10 6 7 1 74.7945 1 16 14 15 5 11 9 10 6 7 12 13 8 4 2 3 1 74.441
Best Tours for Ulysses16 (ECU)
5.6 Summary and Conclusion
This chapter focused on the second objective of this doctoral research,
which is testing the capabilities of Electimize in searching the solution space.
Two NP-hard combinatorial optimization problems were attempted. The first
problem is a multimodal asymmetric 9-city Travelling Salesman Problem (TSP)
that has 27 alternative solutions. The second problem is a bi-modal 16-city
118
symmetrical TSP selected from the literature. Different modeling schemes were
considered to alleviate any doubts about the abilities of the algorithm of finding
existing alternative optimal solution.
Electimize was applied successfully and was able to identify 21 alternative
solutions for the first problem, when the starting point was undefined. The first
problem was reattempted with a defined start, and Electimize identified all
existing optimal solutions. Additionally, Electimize was able to find the optimal
tour and its reverse for the 16 city TSP using Geometric and Euclidian methods
of distance calculations.
The capabilities of the algorithm in identifying alternative optimal solutions
are rooted to the sensitivity analysis step. This steps aims to effectively evaluate
every possible decision variable value in the solution space independent of the
rest of the solution string. Furthermore, the mechanism of this process acts as a
tuner for the best solution found in an iteration, and in many cases leads to the
generation of the optimal ones. Finally, the second objective of the research is
accomplished as Electimize demonstrates high capabilities in searching the
solution space. Hence, it can be applied successfully in solving multimodal
discrete optimization problems.
119
CHAPTER 6: ENHANCING THE OPTIMIZATION MECHANISM OF ELECTIMIZE
6.1 Introduction
In the previous chapters, the original algorithm of Electimize was tested to
verify the capabilities of the new processes introduced in the algorithm. The
primary objectives of these processes are to: 1) Assess the quality of decision
variable values in the solution space, which has been achieved by introducing
the concept of local resistance, and 2) Provide the algorithm with the capability of
exploring the solution space and identifying alternative optimal solutions, which
has been achieved by introducing the sensitivity analysis step.
Although the algorithm was tested successfully and demonstrated its
efficiency in executing the above mentioned objectives, a major limitation of
Electimize was its slow rate of convergence towards the optimal solution if the
size of instance is increased. This is mainly attributed to the fact that the
algorithm spends unnecessary time in searching the solution space due to the
lack of guiding parameters. Therefore, it deemed important to accelerate the
convergence of the algorithm, while preserving its ability to identify alternative
optimal solutions.
6.2 Methodology
To overcome the identified problem, it was necessary to review the
literature thoroughly with a primary focus on the convergence mechanisms of
120
existing evolutionary algorithms. The review included the basic theory as in the
works of [Goldberg 1989; Moscato 1989; Fonseca and Fleming 1995; Kennedy
and Eberhart 2001; Dorigo and Stützle 2004; Eusuff et al. 2006].
Two important points were remarked. First, in Ant Colony Optimization
(ACO), each ant represents a feasible solution for a given objective function. The
ant is guided in its stochastic search in the solution space through two factors:
1) Pheromone trails, which presents the quality of a certain value in the solution
space based on the performance of other ants in previous iterations, and
2) Heuristic factor that favors a specific value among other values available for
the ant to select from. The probability that an ant (k) would select a path (j) is
based on those two factors as shown in Equation (6.1). (Dorigo and Stützle
2004).
Second, the pheromone trails are subject to an evaporation rate that
would decrease the amount of pheromone deposited throughout the iterations.
This minimizes the chances of premature convergence. The pheromone trails
associated with each value are updated as shown in Equation (6.2) (Dorigo and
Stützle 2004)
ij ijij
ij ij
(t) P (k,t) (6.1)
(t)
α β⎡ ⎤ ⎡ ⎤τ × η⎣ ⎦ ⎣ ⎦=α β⎡ ⎤ ⎡ ⎤τ × η∑ ⎣ ⎦ ⎣ ⎦
ij ij ij (t) (t 1) (6.2)τ = ρτ − + ∆τ
121
where, Pij(k, t): probability that ant (k) will move from node (i) to node (j) at
iteration (t); τij(t): pheromone concentration associated with edge (i-j) at iteration
(t); ηij: heuristic factor that guides the ant towards a certain preference when
moving from node (i) to all available nodes (j); α and β: parameters used to
reflect the relative importance between the pheromone concentration and
heuristic factor; ρ: pheromone evaporation rate; and ∆τij: new pheromone
deposition.
Similarly, in Particle Swarm Optimization (PSO), the velocity and the
position of any particle are updated in the original algorithm according to
Equations (6.3) and (6.4). If the velocity of a given particle calculated in Equation
(6.3) exceeds a constant value, the velocity is then set to ± Vmax, which is a user-
defined value. This allows the particle to explore the solution space and prevents
it from being trapped in a local optimum (Fan and Shi 2001).
( )( ) ( )( )i i 1 i i 2 g i V V c rand P X c Rand P X (6.3)= + − + −
i i i X X V (6.4) = +
Where, Vi: velocity of particle (i); c1 and c2: positive constants; rand() and Rand():
different random functions; Xi: current position of particle(i); Pi: best previous
position achieved by particle (i); and Pg: position of the best particle in the
population.
122
6.3 Objectives
The main objective in this chapter is to implement new guiding parameters
that would help guide Electimize in its search and accelerate its convergence
towards optimal solution(s). The modifications made to the algorithm are based
on the noticeable differences in the mechanisms of ACO and PSO. To achieve
this goal, new optimization parameters are added to the original algorithm as
discussed in the next section.
6.4 New Optimization Parameters
The new parameters introduced can be classified as resistance-related or
solution space parameters. Resistance-related parameters establish further
understanding of the notion of local resistance for a decision variable value and
its potential of assisting the algorithm to reach optimality. Specifically, these
parameters are: 1) Resistivity; 2) Length; and 3) Cross-sectional area of the wire
segments, as discussed in details in the following section. Other parameters
introduced are related to solution space exploration. These parameters are:
1) Heat Factor (HF) parameter; and 2) Comparison wire selection.
In general, the introduction of theses parameters serves two main
purposes: 1) Providing the algorithm with further insights about the optimization
problem in order to accelerate convergence towards the optimal solution(s); and
2) Preventing premature convergence while facilitating an extensive exploration
of the solution space
123
6.4.1 Resistance Parameters:
The objective of these parameters is to accelerate the convergence of the
algorithm towards the global optima. The main principle in the original algorithm
revolves around associating each value in the solution space with a calculated
resistance that reflects its potential (quality) to reach the optimal solution. In the
new mechanism, the principle of resistance is used to provide further information
about the solution space values through its decomposition to its basic
parameters. In physics, the resistance of a wire segment is calculated as the
product of the wire material resistivity and its length divided by the cross-section
area of the wire, as shown in Equation (6.5) and demonstrated in Figure 6.1.
m mlml
ml
b r (6.5)a
ρ ×=
where, rml: resistance of decision variable value (l) for segment (m); ρm: material
resistivity of segment (m); bl: length of the segment for decision variable value (l);
and al: cross-sectional area of the segment for decision variable value (l).
Each variable v ∈ 1, 2, 3… V in the objective function is represented by
a segment m ∈ m1, m2, m3... mM that has a value (l) ∈ lm1, lm2, lm3,.. lmL. All
decision variable values in a given set have equal resistivity (ρm), different cross-
sectional areas (aml), and different lengths (bml), as shown in Figure 6.1. Unlike
the value length, it is assumed that once a decision variable value is assigned an
area (aml), it remains constant throughout the iterations.
124
A wire is made of randomly selected values from the solution space based
on their qualities. The quality of any given segment value (lm) in the solution
space is determined by two main factors; its length (bml) and cross-sectional area
(aml), which collectively are presented as the local resistance (segment
resistance) as shown in Equation (6.5). The cross-sectional area (aml) of each
value (lm) is selected to provide information about the relative quality of each
decision variable value (lm) compared to the rest of values in the set, i.e. values
of the same decision variable (segment). For example, the cross-sectional area
can be calculated as shown in Equation (6.6), where (U) is a user defined value
that reflects the user knowledge or certain preference. For example, some
construction projects are characterized by high overhead. Therefore, the planner
knows beforehand that it is more likely that selecting construction methods with
the shortest durations would achieve completing the project with the possible
minimum cost. In this case, the value (U) can be defined as the inverse of the
duration of a construction method available to execute the project activities.
On the other hand, the length (bml) of the segment is designed to provide
information about the relative quality of a given segment value (lm) compared to
other segment values in the same wire (Wn), i.e. values of other decision
variables (segments). It is important to note that the length of a given segment
could change for the same value selected from one wire to another as dictated
by the global resistance of the wire. As such, the process of determining the
segment length becomes complicated. To simplify the process, it is assumed that
all wire segments are made of the same material with resistivity (ρ=1). In the
125
original algorithm, the updated local resistance (rml) is calculated in steps 6 and
7. As such, the length can be determined using Equation (6.5), given the values
of resistivity, area and local resistance.
19
17
14
Segment 1
Segment 2
Segment 3
Segment m
Segment M
Figure 6.1: Different Values of Segment 2 (equal ρm, different aml and bml)
It is worth mentioning that the introduction of wire segment cross section
area helps to capture the local potential of each decision variable value to
achieve optimality; i.e. compared to other possible values for the same objective
function variable. Adversely, the notion of the length captures the global potential
of each decision variable value to achieve optimality, i.e. compared to all
available values for all optimization variables in the solution space.
ml L
l 1
U a (6.6)U
=
=
∑
The probability of selecting a value from the solution space is based on its
current length (bml), which is calculated in each iteration, rather than the local
resistance, as in the case of the original algorithm. The utilization of the
parameters of area and local resistance to calculate the length is expected to
direct the algorithm towards optimality in a more effective way, as the quality of
126
each candidate solution is analyzed using more than one parameter. A quick
comparison between Electimize and ACO reveals a similarity in the convergence
mechanism. The parameter of the area is similar to the heuristic factor in ACO;
however, the area is always dependent on the numeric values of the problem
while the heuristic factor is usually set to a specific value by the user. This is
another advantage of Electimize over ACO, as it minimizes the effort for setting
the values for this parameter.
6.4.2 Solution Exploration Parameters:
As mentioned earlier in this chapter, the solution exploration parameters
are mainly: 1) Heat Factor (HF), and 2) Selection of the comparison wire.
6.4.2.1 Heat Factor:
To counterbalance the effect of the new parameters added to accelerate
the convergence mechanism of the algorithm, another parameter was added to
prevent premature convergence and allow for the extensive search of the
solution space. In physics, there is a directly proportional relationship between
the electric resistance and the temperature. The electric resistance increases as
the temperature of the medium increases. This is attributed to the increase in the
resistivity of metals with temperature. As such, it is assumed that the repeated
selection of a wire segment value will raise the temperature of the wire segment
due to its overuse. Consequently, the local resistance of a segment, in such a
case, will no longer reflect the actual quality of the segment value precisely for
127
part of the resistance will be attributed to the generated heat. In turn, the local
resistance is expressed as (rml = rml (quality) + rml (heat)).
After all, the probability of selecting any value in the solution space is not
only based on the quality of values, but also on randomness, which favors some
values over others. Although the random number is based on a uniform function,
at iteration (x=0), it is not guaranteed to select values from the solution space
uniformly. Some values will be selected more frequently than others in the initial
solution strings. In turn, this could result in the accumulation of unreal value
appreciation (pheromone, heat, merit ...etc.) over iterations and eventually to
convergence towards local optima. Many EAs account for this misconception by
reducing the value appreciation periodically. For example, in ACO, the
pheromone evaporation reduces the concentration of the pheromone associated
with each value in the solution space upon which the selection probability is
calculated. Similarly, in PSO, when the speed of a particle exceeds a certain
limit, it is set to Vmax, as discussed earlier. It is worth mentioning that ACO
reduces the value appreciation continuously by multiplying it by the pheromone
evaporation rate, as shown in Equation (6.2). On the other hand, PSO reduces
its values appreciation periodically only when it exceeds a certain value.
In Electimize, the decision variable value appreciation (resistance) is
reduced continuously and once again periodically. First, the wire global
resistances are reduced each iteration in accordance to their qualities. The
resistance (Rn) is multiplied by a reduction factor (Ibest/In), where (Ibest) is the
intensity of the current passing through the best wire identified at a given iteration
128
(x). This accounts for the heat generated due to the conduction of the electric
current in the wire. Second, the local resistances of decision variable values are
reduced periodically (after a specified number of selections that varies according
to the type of problem) to account for the pseudo-resistance generated due to the
heat effect of overusing a certain segment value. As such, the calculated
segment value resistances (rml) are reduced by a multiplier, referred to as the
Heat Factor, which has a value less than one.
Based on experimentations, It was be noted that each method has its own
advantage. The continuous reduction of resistance allows for the selection of
some new values in the next iterations, while the periodic reduction of resistance
prevents the convergence toward a certain set of values, i.e. local optima.
6.4.2.2 Control Wire:
The capability of Electimize to efficiently explore the solution space stems
from the sensitivity analysis step. In this step, the best wires of the population
undergo the sensitivity analysis against a comparison wire referred to as the
Control Wire, as shown in Figure 6.2. The Control Wire in the original algorithm
was the best wire determined in a single iteration. Additionally, experimentations
showed that using the best wire in all iterations as a Control Wire gives better
results. In fact, every Control Wire of them has a specific advantage that can be
utilized to enhance the performance of the algorithm. Using the identified best
wire in each iteration as a Control Wire allows the algorithm to explore the
solution space thoroughly; however, it slows the convergence process. On the
129
other hand, using the best wire among all wires in all iterations accelerates the
convergence towards optima or near optima, but doesn’t facilitate exploring the
solution space for more alternative optimal solutions. In the new mechanism,
both wires are utilized throughout the iterations. At start – and for the majority of
iterations – the best wire in each iteration is utilized as the Control Wire in order
to facilitate solution space exploration. However, it is replaced by the best wire
identified in all iterations as the algorithm approaches the termination condition.
In the sensitivity analysis step, whenever a new wire of a better value is created,
it replaces the Control Wire. This can be regarded as an internal evolution.
a b c d eWn 8 10 6 7 3
Control Wire 9 11 5 4 8
Wa 8 11 5 4 8Wb 9 10 5 4 8Wc 9 11 6 4 8Wd 9 11 5 7 8We 9 11 5 4 3
Figure 6.2: Individual Evaluation of Values in the Sensitivity Analysis Step
Moreover, in the very first attempts of designing the algorithm as
demonstrated in Chapter 4 and 5, all wires in the population undergo the
sensitivity analysis process. However, this was found inefficient and impractical
for two reasons: 1) It consumes a lot of time that makes the performance of the
algorithm very slow especially with large instances; and 2) The process of
adjusting the local resistances of values could increase the appreciation of a bad
value merely because the quality of the rest of values in the wire are worse than
it. Consequently, a main modification was introduced by selecting the (Z) wires
130
as the best (5-25% of the wires) to undergo the sensitivity analysis step.
Experimentations proved that this change made the algorithm more time efficient
and faster in convergence.
6.5 Using the Modified Algorithm to Solve the TSP
The modifications introduced to the algorithm affect steps 1, 4, 5, 6, 7 and
8. The modified algorithm was used to solve bigger instances of the TSP. Two
symmetric benchmark TSP were selected from the literature to test the
performance; Bayg29 (29 cities) and Att48 (48 cities). Additionally, the modified
algorithm was used to solve Ulyesses16 for two purposes: 1) Comparing the
performance of the algorithm before and after the modification, 2) Ensuring that
the previously claimed capabilities of the algorithm are still maintained. The
modification of steps 1, 4, 5, 6, 7, and 8 are discussed as follows:
1. Step 1: Fabrication of wires (trial solutions): A number of wires (N)
composed of (M) segments are fabricated. For each segment, a value is
selected randomly from the solution space. Every value (lm) in the
solutions space belongs to a segment of the wire and is assumed to have
a constant cross-sectional area (aml) that is calculated according to
Equation (6.6), as shown in Figure 6.1. The length of each segment is
determined after computing the local resistance in step 6. In the TSP, the
value (U) is defined as the distance between any two cities. Consequently,
a matrix of (Ncities x Ncities) was developed to store area values, as shown in
Figure 6.3.
131
Area 1 2 3 4 5 6 7 8 91 0 102/23=4.43 12/102=8.5 51.00 4.86 6.80 12.75 17.00 6.80
Area Matrix
Wn 1 ?
City ji 1 2 3 4 5 6 7 8 9 Total
1 0 23 12 2 21 15 8 6 15 102
Segments
Distance Matrix
Figure 6.3: Areas Corresponding to Decision Variable Values for the First Wire Segment in the 9-City TSP
2. Step 4: Calculating the global resistance of wires (Rn): The global
resistance of each wire is calculated using Ohm’s Law: Rn = V/In and then
multiplied by a reduction factor (Ibest/In).
3. Step 5: Evaluating the quality of wires: The quality of each wire (Wn) is
indicated by its global resistance (Rn), which is calculated in the previous
step. The best (5-25) % of wires in the population, the best wire in each
iteration, and the best wire in all iterations are identified.
4. Step 6: Evaluating the quality of wire segments: At start, it is assumed
that all resistances (rml) for the values of segments (m:1 M) are equal.
The resistances are first calculated according to Equation (6.7). A
sensitivity analysis is then conducted to determine the actual resistances
of each value (lm). The top 5-25% of wires are selected to undergo the
sensitivity analysis by substituting the value (lm) of each segment in (1) the
best wire (Wbest) among them in 90% of the iterations, and (2) the overall
132
best wire determined throughout all the iterations (WBEST) in the remaining
10% of the iterations. If a better wire is identified, it immediately replaces
WBEST. The change (∆R) in the global resistance of the Control Wire is
then recorded (see Equations (6.8) and (6.9)). The resistances (rml) of
values are modified with respect to the change (∆R) encountered in the
Control Wire resistance when they were substituted in the corresponding
segments according to Equation (6.10), and as discussed in details in
Chapter 3. The modified resistances (r*ml) are then normalized so that
their sum is equal to the original wire resistance (Rn). This guarantees that
there is no violation to Kirchhoff’s rule.
r R /M nm n (6.7)=
cw n R R R (6.8)∆ = −
cwH R / R (6.9)= ∆
M* ml ml n mlm 1
r [r (1 H)] R / [r (1 H)] (6.10)=
= − × −∑
Where r*ml: modified resistance of segment (m); rml: resistance of value
(lm) of segment (m) in the original wire (Wn); Rn: resistance of wire (Wn);
and RCW: resistance of the control wire.
5. Step 7: Updating resistances (rml) and segment lengths (bml) for the
generated values: The resistance (rml) is updated for each selected value
(lm) of each segment (m) according to Equation (6.11). The length (bml)
133
can then be calculated using Equation (6.5). If a certain value (lm) is used
more than a specified number of times- set by the user, then the updated
resistance lmr∧
is multiplied by the Heat Factor to account for the pseudo-
resistance generated due to the overuse of segments. Experimentation
showed that a suitable value for the Heat Factor can be selected in the
range of [0.4, 0.7[.
^ *ml ml ml r r r (6.11)= +
where, ^mlr : updated resistance for value (l) of segment (m); and
rml: resistance for value (lm) of segment (m) from the previous iteration.
6. Step 8: Selection of new values (lm) for the variables: The selection
probability of new values is based on the calculated length (bml) of each
value (lm). For maximization problems, it can be calculated according to
Equation (6.12).
ml ml Lml
l 1
1/ bP (6.12)(1/ b )
=
=
∑
where Pml: probability that value (lm) is selected for segment (m); and
bml: length of the resistance (rml) of the value (lm) available for segment
(m).
134
6.6 Experimentation and Results for the Bayg29 TSP:
Bayg29 is a real-life benchmark symmetric TSP, with an objective of
finding the optimal tour between 29 cities in Bavaria. The problem has
3.05 x 1029 possible solutions. The distances between cities are geographical,
and the distance matrix is given in Appendix (B-II).
The algorithm was applied successfully and determined the optimum
solution for the Bayg29 TSP (1,610 km) using 100 iterations, 500 wires and the
top 50 wires in each iteration for the sensitivity analysis in 30 minutes and 4
seconds on a on a 2.00 GHz Intel Core 2 Duo computer with 4.00 GB of memory.
The Control Wire was defined as the best wire identified in each iteration in 90%
of the iteration, and the overall best wire in all iterations in the remaining 10
percent. The resistance for each decision variable value (rml) is multiplied by a
Heat Factor (HF=0.4), if the value is selected more than 5,000 times. As shown
in Figure 6.4, Electimize was able to reach the optimum solution in the 17th
iteration. The optimal tour and some of the sub-optimal tours identified are given
in Table 6.1. By inspecting the tours in Table 6.1, it can be noticed that some
good wires have been evolving incrementally throughout the iterations until the
optimal state is reached.
135
1200
1450
1700
1950
2200
2450
2700
2950
3200
3450
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105
Iteration
Tour
Dis
tanc
e
Figure 6.4: Convergence toward Optimal Solution for the Bayg29 TSP Using the Modified Version of Electimize
6.6.1 Comparison with Previous Results for Bayg29 TSP:
The results obtained by Electimize were compared to the most recent
attempts made to solve the Bayg29 TSP. Shimomura et al. (2010) introduced a
modified version of Ant Colony Optimization (ACO) referred to as Ant Colony
Optimization with Intelligent and Dull Ants (IDACO). They attempted Bayg29 TSP
to compare the performance of their proposed algorithm (IDACO) and traditional
(ACO). Although they proved that IDACO outperforms ACO, both algorithms
failed to reach the optimal solution of Bayg29. The best result obtained by
IDACO had an error rate of 1.38% compared to an error rate of 2.49% of ACO.
The error rate is calculated according to Equation (6.13). The error rates given
were used to calculate the tour lengths obtained, as shown in Table 6.2. It can be
noticed that some of the near-optimal values identified by Electimize –as shown
in Table 6.1- are still better than the best values reported by IDACO, ACO, and
136
GAs. This becomes clearer by investigating the performance of Electimize, as
shown in Figure 6.4. It can be noticed that Electimize has high rate of
convergence demonstrated by the dramatic drop in the error rate from 110.8% in
the first iteration to 0.74% in the eleventh iteration.
algorithm solution - optimal solution 100 optimal solution
Error Rate (%) (6.13)×=
Ahmed (2010) proposed a new crossover method for Genetic Algorithms
(GAs) referred to as Sequential Constructive Crossover (SCX). In an attempt to
compare the performance of GAs after the introduction of the new crossover
method, he selected to try the Bayg29. The new crossover method proved to be
more efficient as it reached the optimal solution (1,610 km) compared to an error
rate of 9.25% of the original GAs, as shown in Table 6.2.
Table 6.1: Best Tours Identified by Electimize for Bayg29 No. Value1 1 28 6 12 9 26 3 29 5 21 2 20 10 4 15 18 14 17 22 11 19 25 7 23 8 27 16 13 24 1 16102 1 28 6 12 9 26 3 29 5 21 2 20 10 4 15 18 14 17 22 11 19 25 7 23 27 16 13 24 8 1 16153 1 28 6 12 9 26 3 29 5 21 2 20 10 4 15 18 14 17 22 11 19 25 7 23 27 8 24 16 13 1 16204 1 28 12 6 9 26 3 29 5 21 2 20 10 4 15 18 14 17 22 11 19 25 7 23 27 16 13 24 8 1 1622
Best Tours for Bayg29
Table 6.2: Best Tour Values Identified by Different Algorithm for the Bayg29 TSP
Algorithm Best Solution % ErrorElectimize 1,610 0.00%
IDACO 1,637 1.68%
ACO 1,650 2.48%
GAs (SCX) 1,610 0.00%
GAs 1,759 9.25%
137
6.7 Experimentation and Results for the Att48 TSP:
Att48 is a real-life benchmark symmetric TSP that, with an objective of
finding the optimal tour between the capitals of the 48 States of the US, as
shown in Figure 6.5. The Att48 problem has 2.58623 x 1059 possible solutions.
The distances between cities are Euclidean and given in Appendix 1.
The optimal solution for this problem is 33,523.71 miles. Electimize was
able to determine the optimal solution using 210 iterations, 1,200 wires, and best
21 wires in each iteration for the sensitivity analysis step in 5 hours, 16 minutes
and 28 seconds on a on a 2.00 GHz Intel Core 2 Duo computer with 4.00 GB of
memory.. In ninety percent of the iterations, the best wire identified in each
iteration was used as a Control Wire for the sensitivity analysis step, while the
best wire in all iterations was used as a Control Wire in the remaining 10 percent
of iterations. The local resistances (rml) were reduced periodically by a HF of 0.4,
if the value is selected more than 10,000 times. The optimal solution was
determined in the 192nd iteration, as shown in Figure 6.6. The optimal tour and
some of the best tours identified are given in Appendix (B-III).
By inspecting the curve in Figure 6.6, several important points can be
drawn. First, Electimize was able to find two new better solutions at the 191st and
192nd iterations after no change in the best value for 123 consecutive iterations.
This demonstrates the effect of changing the comparison wire in the last 10% of
the iterations, i.e. at the 189th iteration. Second, the convergence rate of
Electimize has been enhanced greatly as demonstrated by the steep drop in the
138
best achieved solution for the problem from 106,850 miles to 34,875 miles in the
first 6 iterations. This can be translated as an error rate of 4.03% of the optimal
solution.
Figure 6.5: Optimal Tour of the Capitals of the 48 States of USA
6.7.1 Comparison with Previous Results for Att48 TSP:
Att48 is one of the most classic TSPs and has been attempted many times
by several researchers. The most recent attempt was made by Shimomura et al.
(2010) using IDACO, which is a modified version of ACO. Similar to their
attempts of solving the Bayg29 TSP, they also compared the performance of
their proposed algorithm to traditional ACO in solving the Att48 TSP. Although
IDACO proved to outperform the traditional ACO, the two algorithms failed to
reach the optimal solution for Att48. The best result obtained by IDACO was
34,265 miles with an error rate of 2.21% of the optimal solution compared to the
139
best result obtained by ACO, which is 34,456 miles with an error rate of 2.78% of
the optimal solution. The results of the two algorithms are given in Table 6.3.
0
20000
40000
60000
80000
100000
120000
0 20 40 60 80 100 120 140 160 180 200 220 240
Iteration
Tour
Dis
tanc
e
33000
33500
34000
34500
35000
0 20 40 60 80 100 120 140 160 180 200 220 240
Iteration
Tour
Dis
tanc
e
Figure 6.6: Convergence toward Optimal Solution for the Att48 TSP Using the Modified Version of Electimize
140
Fang et al. (2007) proposed a modification for the traditional Particle
Swarm Optimization (PSO) by incorporating Simulated Annealing (SA) to
overcome a major shortcoming of PSO, which got the model trapped in local
minima. To provide a scientific insight about their proposed modification, they
applied PSO-SA to the Att48 TSP. They compared the performance of PSO-SA
to three main evolutionary algorithms, which are: 1) Basic GAs; 2) Basic SA; and
3) Basic ACO. Although the PSO-SA proved to outperform the rest of the
algorithms in comparison, none of them was able to reach the optimal solution of
the Att48 TSP. The results are given in Table 6.3. By inspecting the best tours
identified by Electimize – Appendix (B-III), it can be noticed that the worst tour
among the near-optimal solutions (34,219 miles) is better than the ones identified
by the other EAs.
Table 6.3: Best Tour Values Identified by Different Algorithm for the Att48 TSP
Algorithm Best Solution % Error Attempt By
Electimize 33,523.71 0.00% Abdel-Raheem (2011)IDACO 34,265.00 2.21%ACO 34,456.00 2.78%PSO-SA 33,966.00 1.32%GAs- Basic 36,759.00 9.65%SA- Basic 35,745.00 6.63%ACO- Basic 34,559.00 3.09%
Shimomura et al. (2010)
Fang et al. (2007)
141
6.8 Computer Coding:
The modified version of the algorithm was also coded using Visual Basic
for Application as a macro in Microsoft Excel. The VBA code is given in Appendix
(A-IV).
6.9 Verification of the Previous Tested Capabilities:
Ulysses16 TSP was reattempted after introducing the new parameters in
the modified version of Electimize. The new parameters enabled Electimize to
determine the optimal solution (6,859 km), the optimal tour, and its alternative
using 30 iterations, 1,200 wires, and the top 12 wires for conducting the
sensitivity analysis step in 7 minutes and 41 seconds on a 2.00 GHz Intel Core 2
Duo computer with 4.00 GB of memory. This is compared to 250 iterations, 500
wires, and top 26 in the previous attempt. To have a fair comparison, the total
number of wires generated in all iterations was used as a basis for the
comparison. In the first attempt, a total of 125,000 (250 x 500) wires were
generated compared to 36,000 (30 x 1200) wires generated in the second
attempt. This in turn can be translated as an enhancement of approximately
350% in efficiency.
Additionally, in the second attempt, the new parameters introduced
enabled Electimize to determine the optimal solutions in the 4th and 7th iterations
compared to the 36th and 37th iteration of the first attempt, as shown in Figure
6.7.
142
6600
6800
7000
7200
7400
7600
7800
8000
8200
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32
Iterations
Tour
Dis
tanc
e
Figure 6.7: Convergence toward Optimal Solution for the Ulysses16 TSP Using the Modified Version of Electimize
6.10 Summary and Conclusion:
In this chapter, new parameters were introduced to enhance the
performance of Electimize. The parameters introduced were classified into two
sets: 1) Resistance-related parameters, and 2) Solution space parameters. The
modified version of the algorithm was applied to larger instances of the NP-hard
TSP. Two benchmark symmetric TSPs were attempted; the Bayg29 and Att48
TSPs. The results generated by Electimize were compared to previous attempts
made to solve these problems using different evolutionary algorithms. The results
showed that Electimize outperformed all of them.
Additionally, the Ulysses16 TSP was reattempted. The results obtained by
the modified version of Electimize illustrate a significant enhancement in the
performance compared to that of the original version.
143
Based on the above experimentation, it could be concluded that the
introduction of the new optimization parameters have improved the convergence
rate of Electimize greatly. This renders Electimize a very efficient tool that could
be used to solve complex NP-hard optimization problems. It has demonstrated its
robustness by solving a wide variety of problems and outperforming many of the
existing evolutionary algorithms with respect to the quality and the number of
generated solutions.
144
CHAPTER 7: TESTING THE CAPABILITIES OF ELECTIMIZE IN SOLVING CONSTRUCTION ENGINEERING
OPTIMIZATION PROBLEMS
7.1 Introduction
A primary objective of this PhD research is to present an optimization tool
that is capable of solving a variety of optimization problems in the domain of
construction engineering and management. In chapter 4, the basic algorithm was
applied successfully to a dynamic optimization benchmark problem, which is the
cash flow management problem. However, in construction engineering there are
a variety of optimization problems of differing nature and differing sets of
constraints. Each problem requires significant modeling and computational effort.
The majority of these problems belongs to the NP-hard class and can be either
static or dynamic optimization problems. Many attempts have been conducted to
solve these problems using different evolutionary algorithms yielding comparable
results. Consequently, it deemed essential to: 1) Test the efficiency of the
algorithm as an optimization tool for solving different construction-related
optimization problems; and 2) Assess the performance of the algorithm after the
introduction of the new parameters – as discussed in chapter 5 – by comparing
its output with the previous attempts made using other evolutionary algorithms.
This chapter presents the application of the modified version of Electimize
to solve two construction-related optimization problems, namely: 1) Time-Cost
145
Tradeoff Problem (TCTP), and 2) Site Layout Planning (SLP). Both problems
have been addressed in the literature with many results to compare against.
7.2 Methodology
In selecting the construction engineering applications, a set of criteria
were defined. First, the applications should be of a meaningful and substantial
importance to the construction industry. Second, the problems selected for
applications should present a computational challenge and are hard to solve, i.e.
NP-hard. Third, applications should represent a variety of problems in the
domain. Fourth, the problems should have previous reported results that can be
compare to the results obtained by using Electimize.
The time-cost tradeoff analysis and site layout planning problems were
found suitable for the criteria stated above. The two problems are of significant
importance to the construction industry in terms of cost minimization denoted by
the immense research conducted to model and solve them, as discussed in the
literature review chapter. The two problems belong to the NP-hard class. The
TCTP was selected as an example of static construction optimization problems,
while the SLP is used as an example of dynamic construction optimization
problems. The two selected problems have been attempted several times,
yielding benchmark problems with optimal solutions known beforehand. In turn,
this makes them very convenient for utilization in comparative studies.
146
7.3 Time-Cost Tradeoff Problem (TCTP): Overview
In construction projects, there is a relationship between the activity
duration and both the direct cost and indirect costs. In general, as the activity
duration increases, the direct cost decreases, while the indirect cost increases,
as discussed thoroughly in the literature review chapter. Additionally, if the
project duration surpasses the stipulated deadline of project completion, usually
penalties and liquidated damages are applied. This in turn increases the
contractor incurred cost.
For every single project activity, there is a set of alternative construction
methods available to execute it. Each construction method has different
completion times and costs. The challenge that usually faces construction
planners is to select the best combination of these construction methods, for
hundreds of activities, in order to guarantee completing the project in the most
efficient way (i.e. with the least cost and optimal time).
There are four main variables that determine the optimal completion time
of a construction project. These variables are: 1) Project total direct cost;
2) Project total indirect cost; 3) Total liquidated damages; and 4) Incentive for
speedy construction. The four variables can be incorporated in a single objective
function, as shown in Equation (7.1).
kij l
i 1 Minimize :DR C C - W (7.1)
=+ +∑
147
where, D:project total duration; R:indirect cost/unit time; Cij: direct cost of activity
(i) using construction method (j); k: number of activities; Cl: total liquidated
damages; and W: incentive for speedy performance.
7.4 TCTP: Modeling
The TCTP in this research was formulated in a similar manner to previous
attempts made to solve the same problem, as in Feng et al. 1997; Elbeltagi 2005;
and Elbeltagi, et al. 2005. For each activity, there is a variety of construction
methods available. The construction method is a combination of the available
resources, materials, technologies, and equipment, and each method has a
stipulated time and cost determined by the construction planner. An index is then
created to relate the construction method time and cost to its main activity. The
index is merely a reference that is used to retrieve the cost and time of a specific
construction method that is available to execute a designated activity.
A number of wires (N), each consisting of (M) segments are created. The
number of segments is equal to the number of project activities, where each
segment represents an activity and carries an index (Xij) that refers to a certain
construction method (j) available for executing activity (i), as illustrated in Figure
7.1. The indexes are used to retrieve the duration and cost of each activity in
order to compute the total cost of the randomly-generated project scenarios.
Each segment has a cross-sectional area (aij). Further discussion about the
segment cross-sectional areas is given later in this chapter.
148
X 1 j X 2 j X 3 j Xij XKj
1 2 3 i KWire
Activity/Segment No.
IndexIndex (Construction Method)
Activity/ Segment No.
Wire
Figure 7.1: Wire Representation of a Project Activities-Execution Scenario
The generated wires are connected to a source of electricity that has a
voltage (V), forming an electric circuit. The electric current intensities represent
the total cost of different project scenarios (wires). They are calculated by
substituting the project completion time, total direct cost, indirect cost, liquidated
damages, and incentive for speedy construction in the objective function. The
individual wire resistances are then calculated in accordance to Ohm’s Law.
For the best 25% of the wires generated in each iteration, the randomly
generated construction methods are then individually evaluated by conducting a
one-way sensitivity analysis, as shown in Figure 7.2. The objective of this step is
to assess the potential (local resistance (rij)) of the segment values to realize the
project optimum completion time.
Once the local resistances are determined, the lengths (bij) of the
segments (construction method) are calculated and accordingly the selection
probability (Pij) is updated.
149
Activity a b c d e f g h iNo. of Const. Methods. 5 5 3 3 3 1 3 5 2
Control Wire 1 5 2 2 4 1 3 5 1Wn 3 2 1 2 2 1 3 4 2
Wa 3 5 2 2 4 1 3 5 1Wb 1 2 2 2 4 1 3 5 1Wc 1 5 1 2 4 1 3 5 1Wd 1 5 2 2 4 1 3 5 1We 1 5 2 2 2 1 3 5 1Wf 1 5 2 2 4 1 3 5 1Wg 1 5 2 2 4 1 3 5 1Wh 1 5 2 2 4 1 3 4 1Wi 1 5 2 2 4 1 3 5 2
Figure 7.2: Individual Evaluation of Segment Values (Construction Method)
7.5 TCTP: Computer Coding
Microsoft Project TM scheduling software was used to manage the
relationship between activities, project data, and the cost and duration of each
construction method, and to calculate the total project duration.
Electimize was coded as a macro program in MS Project TM using VBA.
The indexes carried by each wire are used to import the cost and time data of the
project activities to the Macro program to perform the necessary calculations
needed for wires evaluation and eventually determining the optimum solution.
A user interface was developed to collect the input data regarding the
number of iterations and wires, size of the instance, number of wires to perform
the sensitivity analysis, project indirect cost, liquidated damages, and incentive
for speedy construction, as shown in Figure 7.3. Separate multiple spreadsheets
150
were prepared to store the generated solutions, selection probabilities, and the
log for tracing the evolution of wires. The VBA code is presented in Appendix
(A-V).
Figure 7.3: User Interface to Collect Additional Project Data
7.6 TCTP: Application Example and Results
A problem is selected from the research literature to test the performance
of Electimize. The problem was first solved using linear and integer programming
(Burns et al. 1996); reattempted using GAs (Feng et al. 1997); re-solved using
Ant Colony Optimization (Elebeltagi 2005); and reattempted using five different
evolutionary algorithms (Elebeltagi et al. 2005).
The problem involves a construction project comprised of 18 activities,
with different construction methods available to execute each of these activities.
The construction methods available for a single activity ranged between two and
151
five methods. The duration and cost associated with each construction method
are presented in Table 7.1. The optimization objective is to find the project
optimal duration, which corresponds to the least cost, using the most appropriate
combination of construction methods for the project activities. The problem at
hand has 4.72 x 109 possible combinations of construction methods.
Table 7.1: Benchmark TCTP: Data of Activities Relationships, Times, and Costs (Elebeltagi et al. 2005)
Activity Duration Predec. Time Cost Time Cost Time Cost Time Cost Time Cost1 24 d 14 2,400 15 2,150 16 1,900 21 1,500 24 1,2002 25 d 15 3,000 18 2,400 20 1,800 23 1,500 25 1,0003 33 d 15 4,500 22 4,000 33 3,2004 20 d 12 45,000 16 35,000 20 30,0005 30 d 1 22 20,000 24 17,500 28 15,000 30 10,0006 24 d 1 14 40,000 18 32,000 24 18,0007 18 d 5 9 30,000 15 24,000 18 22,0008 24 d 6 14 220 15 215 16 200 21 208 24 1209 25 d 6 15 300 18 240 20 180 23 150 25 10010 33 d 2,6 15 450 22 400 33 32011 20 d 7,8 12 450 16 350 20 30012 30 d 5,9,10 22 2,000 24 1,750 28 1,500 30 1,00013 24 d 3 14 4,000 18 3,200 24 1,80014 18 d 4,10 9 3,000 15 2,400 18 2,20015 16 d 12 12 4,500 16 3,50016 30 d 13,14 20 3,000 22 2,000 24 1,750 28 1,500 30 1,00017 24 d 11,14,15 14 4,000 18 3,200 24 1,80018 18 d 16,17 9 3,000 15 2,400 18 2,200
Construction Method1 2 3 4 5
Similar to previous attempts made in the literature, all activities were set to
the construction method (CM) with longest duration, which is CM 5 for activities
(1, 2, 8, 9, 16) and CM 3 for activities (3, 4, 6, 7, 10, 11, 13, 14, 17, 18), and
CM 2 for activity 15. The total project duration in this case is 169 days with a total
direct cost of $99,740. An indirect cost of $500/day was accumulated over the
entire project duration rendering the total project cost $184,240. In this project,
no liquidated damages nor incentive for speedy construction were stipulated.
152
Electimize was able to find the optimal completion time for the given
project (110 days) and the corresponding minimum cost ($161,270) in just one
iteration, using 30 wires, and by conducting the sensitivity analysis step on the
best 21 wires. The reported time is 19 seconds on a 2.00 GHz Intel Core 2 Duo
laptop with 4.00 GB of memory. In this case the Control Wire (CM) was selected
as: (1) Best wire in each iteration for 90% of the iterations, and (2) Global best
wire identified throughout all the iterations in the remaining 10%. The Heat Factor
(HF) was set to a value of 0.6, and the local resistances (rml) were reduced
periodically in accordance, if a value is selected more than 200 times.
The generated optimal solution for this problem is given in Table 7.2. The
problem was attempted using the above settings more than 20 times with a
success rate of 100%.
Table 7.2: Optimal Solution for the Benchmark 18-Activity TCTP
Activity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18Construction Method 1 5 3 3 4 3 3 5 1 1 3 1 3 3 1 5 1 1Total Cost 161,270
It is worth mentioning that one of the powerful capabilities of Electimize is
the sensitivity analysis step. The identification of the optimal solution in a single
iteration is mainly attributed to the sensitivity analysis step. In this step, whenever
a solution better than the Comparison Wire (WBest) is identified, it immediately
replaces it. This can be thought of as an internal evolution of the wires.
153
7.6.1 TCTP: Comparison with Previous Attempts:
For the problem at hand, some EAs failed to find the optimal solution
(Elebeltagi et al. 2005), and those that found it used hundreds of iterations and
solution strings. Feng et. al (1997) used Genetic Algorithms (GAs) to solve this
problem. The primary objective of their work was to draw the Time-Cost Tradeoff
curve. However, the actual optimal solution of the problem was never mentioned
in their work. Elbelatgi (2005) attempted the problem using Ant Colony
Optimization (ACO). He was able to find the optimal solution using 100 iterations
and 30 ants. Elbetagi et al. (2005) conducted a comparison among five
evolutionary algorithms, namely: GAs, Memetic Algorithm (MA), ACO, Particle
Swarm Optimization (PSO), and Shuffled Frog Leaping (SFL). To compare the
performance of these algorithms in solving discrete optimization problems, the
18-activity TCTP was used. The results showed that MA and ACO were able to
find the optimal solution with the help of local search7. While PSO found the
optimal solution using 10,000 iterations and 40 swarms, GAs and SFL failed to
do. All previous attempts of solving the TCTP using different EAs are
summarized in Table 7.3.
7 Refer to Chapter 2 for more information about Local Search
154
Table 7.3: Comparison of Results and Parameters Settings of Different EAs Used to Solve the TCTP
Algorithm Least Cost
Best Time
(Days)
Number of Iteration
Number of Sol. Strings
Unit of Sol. Strings
Total Solution Strings
Local Search Attempt By
Electimize 161,270 110 1 30 Wire 540 No Abdel-Raheem
Genetic Algorithms NA NA 50 400 Chromosome 20,000 No Feng et. al
Genetic Algorithms 162,270 113 Unspecified 500 Chromosome NA No Elebetagi et. al
Ant Colony Algorithm 161,270 110 100 30 Ant 3,000 Yes Elebetagi et. al
Memetic Algorithm 161,270 110 Unspecified 100 Chromosome NA Yes Elebetagi et. al
Particle Swarm 161,270 110 10,000 40 Particle 400,000 No Elebetagi et. al
Shuffled Frog Leaping 162,020 112 10 200 Frog 2,000 No Elebetagi et. al
7.6.2 TCTP: Values Cross-Sectional Area (aij):
As discussed in Chapter 6, the notion of the value cross-sectional area
(aij) aims to provide the algorithm with some information about the quality of
values available in the solution space. This information is dependent on the
nature of the problem. In the TCTP, it was confusing to decide on the parameters
that would lead Electimize to the optimal solution due to the tradeoff relationship
between the project time and cost. In Elebetagi’s attempt (2005) in solving the
TCTP using ACO, one of the parameters that guides the ant toward the optimal
solution is the heuristic factor (η). In his attempt, he selected (η) as the inverse of
the construction method time, giving preference to methods with short duration.
To determine the problem’s input data that could represent the cross-
sectional area (aij), five experiments were conducted. In each experiment, the
cross-sectional area was represented by one type of data. The selection
probabilities of the decision variable values for four randomly selected activities,
namely activities 1, 2, 7 and 12, were recorded to monitor the influence of the
cross-sectional area on directing Electimize in the search space. The recording
155
was done for 120 iterations using 210 wires and the top 21 wires for the
sensitivity analysis step. The different types of data used, their descriptions, and
their influence on directing the solution space search are summarized in Table
7.4.
In the first experiment, the cross-sectional area was selected as the
inverse of the construction method’s relative execution time (ΣTij/ tij). The
preference is given to methods with the least relative construction time. When the
experiment was conducted, it showed that construction methods with the least
time had the highest selection probability throughout the iterations. This in turn
led to a slow convergence toward the optimum solution, although Electimize was
able to identify the optimal solution toward the very end of the iterations. As
shown in Figure 7.4, the selection probabilities for activities 1, 2, 7 and 12
increase significantly throughout the iterations toward CM 1, which has the least
construction time.
Table 7.4: Various Types of Data Used to Represent Cross-Sectional Area in the TCTP
Area = Description Activity 1 Activity 2 Activity 3 Activity 4
ΣTij/tij Preference is given to the construction method with the shortest time
1 1 1 1
ΣCij/cij
Preference is given to the construction method with the least cost
5 5 3 4
cij /tij
Preference is given to the construction method with the best time with respect to its cost
1 1 1 1
tij /cij
Preference is given to the construction method with the least cost with respect to its time
5 5 3 4
1 No Preference 1, 2, 3, 4, 5 1, 2, 3, 4, 6 1, 2, 3 1, 2, 3, 41 5 3 1
Most Frequently CM Selected
Optimum Solution
156
Activity 2
0
0.1
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3 4 5
Activity 1
0
0.1
0.2
0.3
0.4
0 20 40 60 80 100 120
1 2 3 4 5
Activity 7
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0 20 40 60 80 100 120
1 2 3
Activity 12
0.1
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3 4
Figure 7.4: Convergence towards CM with the Least Time for Cross-sectional Area represented as (ΣTij/ tij).
In the second experiment, the cross-sectional area was represented as
the inverse of the construction method’s relative direct cost (ΣCij/ cij). In this case,
the preference is given to construction methods with the least cost. The
experiment showed that the algorithm converged toward construction methods
with the least cost regardless of their potential of being part of the optimal
solution, as shown in Figure 7.5. The selection probabilities for activities 1, 2, 7
and 12 increased significantly throughout the iterations toward CM 5, CM 5,
CM 3, and CM 4 respectively, which have the least direct cost.
157
Activity 2
0
0.1
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3 4 5
Activity 7
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0 20 40 60 80 100 120
1 2 3
Activity 12
0.1
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3 4
Activity 1
0
0.1
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3 4 5
Figure 7.5: Convergence towards CM with the Least Cost for Cross-sectional Area represented as (ΣCij/ cij).
In the third and fourth experiments, the cross-sectional area was
represented by the relationship between the CM time and cost in terms of the CM
time divided by its cost (cij/ tij) or its inverse (tij/ cij). In experiment three, the area
was represented as (cij/ tij), the preference is given to CM with the shortest time
with respect to its cost. Adversely, in experiment four, the notion of (tij/ cij) gives
preference to CMs with the least cost with respect to the construction time. None
of those relationships provided the expected guidance for the algorithm to
allocate the CMs that constitute the optimal solution. In the third experiment, the
convergence was toward the CM with the shortest time, as shown in Figure 7.6.
On the other hand, the convergence of the algorithm was toward CMs with the
least cost in the fourth experiment, shown in Figure 7.7. In both experiments, the
optimal solution was identified towards the very end of the iterations.
158
Activity 1
0
0.1
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3 4 5
Activity 2
0
0.1
0.2
0.3
0.4
0.5
0.6
0 20 40 60 80 100 120
1 2 3 4 5
Activity 7
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0 20 40 60 80 100 120
1 2 3
Activity 12
0
0.1
0.2
0.3
0.4
0.5
0.6
0 20 40 60 80 100 120
1 2 3 4
Figure 7.6: Convergence of Selection Probabilities for Cross-sectional Area represented as (cij/ tij)
Activity 1
0
0.1
0.2
0.3
0.4
0 20 40 60 80 100 120
1 2 3 4 5
Activity 2
0
0.1
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3 4 5
Activity 7
0
0.1
0.2
0.3
0.4
0.5
0.6
0 20 40 60 80 100 120
1 2 3
Activity 12
0
0.1
0.2
0.3
0.4
0.5
0.6
0 20 40 60 80 100 120
1 2 3 4
Figure 7.7: Convergence of Selection Probabilities for Cross-sectional Area represented as (tij/ cij)
159
In the fifth experiment, the cross-sectional area of all values in the solution
space was given a value unity (aij=1). In this case, no information was given
about the problem excluding any external influence in directing the algorithm in
the search space. The experiments showed that selection probabilities oscillated
almost equally between the available construction methods throughout the
iterations. This in term prevented premature convergence to specific set of CMs
allowing Electimize to identify the optimal solution in the first iteration. For
verification, the analysis included two additional activities (5 and 18), as shown in
Figure 7.8.
160
Activity 1
0.1
0.2
0.3
0 20 40 60 80 100 120
1 2 3 4 5
Activity 2
0.1
0.2
0.3
0 20 40 60 80 100 120
1 2 3 4 5
Activity 7
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3
Activity 12
0.1
0.2
0.3
0.4
0 20 40 60 80 100 120
1 2 3 4
Activity 10
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3
Activity 18
0.2
0.3
0.4
0.5
0 20 40 60 80 100 120
1 2 3
Figure 7.8: Selection Probabilities of Different CMs for Cross-Sectional Area Represented as the Unity (aij =1)
7.7 Site Layout Planning Problem (SLPP): Overview
Site layout planning is an important process in any construction project.
Good site layout planning minimizes the travel distances among facilities,
materials handling, and maximizes the efficiency in executing different
construction activities (Hegazy and Elbeltagi 1999). There are two types of
facilities allocated in any construction site: a) Fixed facilities, which are the actual
construction, and b) Temporary facilities, which are secondary facilities that are
needed for a limited amount of time for construction purposes. The SLPP can be
161
categorized as dynamic versus static and tightly versus loosely packed. The
classification of the problem can be any combination of these. In dynamic SLPP,
there is a time constraint associated with the allocation of facilities. For example,
a concrete batch plant can be erected for a specific duration of the project then
dismantled after finishing the concrete works. Similarly, in most cases of limited-
space construction sites, the project permanent facilities are constructed in
sequence rather than in parallel. Therefore, the field office can be established
temporarily at the location of a permanent facility for a limited amount of time,
and then it can be transferred to a partially finished facility to allow for the
construction of the new facility. In tightly packed construction SLPP, the facilities
are allocated adjacent to each other with no space separating them. This type of
allocation is usually used for limited space construction sites. On the other hand,
in loosely packed SLPP, spaces are allowed in between facilities.
The main objective in the SLPP is to minimize the total travel distance or
cost between facilities. The allocation of facilities on site could be based on
desired closeness relationships, which are referred to as proximity relationships.
These relationships present a certain preference in having particular facilities
close or apart from each other. Such relationships can be determined
quantitatively by calculating the transportation cost between facilities per unit
time or qualitatively by using proximity weights that are determined subjectively
based on prior experiences (Hegazy and Elbeltagi 1999). For example, it is very
desirable to allocate the concrete batch plant as close as possible to the concrete
structures in the project, while the power generator on site should be allocated as
162
far as possible from the water tank. As such, there are two main factors that
determine the optimal layout of the construction project facilities: 1) Distance
between facilities; and 2) Desired closeness between them. These two factors
could be incorporated in one minimization objective function, as shown in
Equation (7.2).
T 1 Tij ij
i 1 j i 1 Minimize : Total Travel Distance (D P ) (7.2)
−
= = += ×∑ ∑
where, T: total number of facilities in the project (permanent and temporary),
Dij: travel distance between facilities (i) and (j), Pij: desired proximity (closeness)
between facilities (i) and (j).
Any SLPP can be classified as a dynamic problem from an optimization
point of view. The SLPP is one of the most sophisticated construction problems
due to the incorporation of many parameters that are needed to define the
problem. For example, Khalafallah and El-Rayes (2006) presented a model for
optimizing airport construction site layouts. In their model, they incorporated
specific parameters related to the aviation safety regulations and proceedings. In
general, there is no specific site layout planning model that is generic enough to
accommodate all the settings of different construction projects.
7.8 SLPP: Modeling
The primary objective in this chapter is to present applications examples
on the utilization of Electimize to solve construction optimization problems.
163
Because of the complexity of the SLPP, demonstrated by the multitude of the
models developed to solve the problem, it deemed necessary to attempt this
problem using Electimize. The model developed by Hegazy and Elbetagi (1999),
Evosite, was found suitable for this purpose for two main reasons: 1) The model
is generic in nature and can accommodate different types of construction
projects; and 2) It is EA-based, which would facilitate the application of
Electimize as well as the comparison with another EA, namely GAs. However,
some modifications in modeling the problem were introduced as will be
discussed in detail in the following sections.
In Evosite, the construction site is represented as a two-dimensional grid
composed of a number of units of equal areas. The area of a unit grid is
determined using the greatest common divisor of the areas of all facilities. For
example, if the project is composed of five facilities A, B, C, D and E of area
60 m2, 75 m2, 45 m2, 105 m2 and 90 m2 respectively, the greatest common
divisor for them is 15. Hence, the construction site will be represented as a grid
of a unit area of 15 m2, as shown in Figure 7.9. The facilities are then placed with
respect to their closeness relationship in an attempt of minimizing the travel
distance according to the objective function in Equation (7.2).
164
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1
2 A3 C4
5 B6 D7
8
9
10
11 E12
13
Figure 7.9: Placement of Facilities on a Grid of Equal Areas as in Evosite (Hegazi and Elbeltagi 1999)
In Evosite, each solution string (chromosome) carries values of the
location reference of both the permanent and temporary facilities. The location
reference of any facility can be calculated using Equation (7.3).
( )Location Reference row no. – 1 x no. of columns column no. (7.3) = +
For example, the location reference of facility “E” given in Figure 7.9 is
[(11–1) x 14 + 3 = 143]. As such, if facilities A, B, and D are the permanent
facilities in the project, while facilities E and C are the temporary ones, a
randomly generated chromosome can look like Figure 7.10.
The travel distances between facilities are measured between the
centroids, as shown in Figure 7.10. For simplicity, irregular shaped facilities are
approximated to the closest rectangular shape to facilitate the calculation of the
facility centroid position on the grid. The distances are then calculated using the
165
Pythagorean Theorem. For example, the distance between facilities A and B can
be calculated as square root of ((2 – 5.5)2 + (2 – 5)2) = 4.61 grid unit distance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 C2 A3
4
5 B6 D7 E8
9
10
11
12
13
A B D C E
16 61 82 6 92
Fixed Facilities Temp. Facilities
Chromosome
Figure 7.10: A Randomly Generated Chromosome & Facilities Allocation on Site according to Evosite (Hegazi and Elbeltagi 1999)
In modeling the SLPP using Electimize, a major modification was
introduced in the generation of solution strings (wires) compared to GAs
chromosomes deployed by Evosite. In Evosite, the solution strings
(chromosomes) represented the locations of all facilities on site, as shown in
Figure 7.10. On the other hand, the solution strings (wires) in Electimize were
designed to represent the locations of the temporary facilities only. This was
achieved by generating a number of wires (N) composed of segments (M)
randomly. The number of segments corresponds to the number of temporary
facilities. Each wire segment carries the value of a location reference (k) for the
166
corresponding temporary facility (i) only unlike the solution strings in Evosite, as
shown in Figure 7.11. Each location reference has a cross-sectional area (aik)
that is initially given a value of “1”, since there is no prior information available
about the quality of each location. In other words, all locations available for a
single facility appear identical in terms of their likelihood to contribute toward
reaching the overall optimal solution. A cross-sectional area of value equal to the
unity was found convenient based on the TCTP area experimentation, as
discussed in the previous section.
C D EWn 9 39 13
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
1 1 2 3 4 5 6 7 8 1 1 2 3 4 5 6 7 8
2 9 1011 A 12 13
14 B 15 16 2 9 C 1011 A 12
13 E 14 B 15 16
3 17 18 19 20 21 22 23 24 3 17 18 19 20 21 22 23 24
4 25 26 27 28 29 30 31 32 4 25 26 27 28 29 30 31 32
5 33 34 35 36 37 38 39 40 5 33 34 35 36 37 3839 D 40
(a) (b)
Wire RepresentationFixed FacilityTemporary Facility
Figure 7.11: Modeling Temporary Facilities using Wires in Electimize
There are a number of possible positions on site for each temporary
facility. These positions are stored in a matrix referred to as the “Availability
Matrix”. The Availability Matrix has dimensions of (Nfacilities, L*W), where: (Nfacilities)
is the number of the temporary facilities in the project; (L) is the length of the grid
(number of rows); and (W) is the width of the grid (number of columns). The
Availability Matrix is a binary matrix, where the value “0” indicates that the
167
position (grid unit) is currently occupied and the value “1” indicates its availability.
At start, all fixed facilities are allocated in their definite position on site, and the
grid units they occupy are set to “0” in the availability matrix. The placement of
any temporary facility on site is based on: 1) Availability of the grid unit (has a
value of “1”), and 2) Interference of the facility width or length with any other
existing facility. Considering the example in Figure 7.11, although grid units 25,
26, 27, and 28 are available, they cannot accommodate facility E as it will be
extended beyond the boundaries of the construction site. Therefore, these grid
units are also set to “0” along with other similar grid units for facility E. The notion
of the availability matrix limit the search to the feasible solutions only, which is
expected to decrease the processing time and guide the algorithm towards a
feasible optimal solution. The initial availability matrix (before placing the
temporary facilities) of the example in Figure 7.11(a) is given in Table 7.5.
Table 7.5: Initial Availability Matrix of the Site Layout Example in Figure 7.11 (a) GridFacility 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Total Positions
AvailableC 1 1 0 0 0 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 13
D 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 1 0 1 1 1 1 1 1 1 0 22
E 1 1 0 0 1 0 1 1 1 1 0 0 1 0 1 1 1 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15
Every time a facility is placed on site, the availability matrix is updated to
exclude the infeasible options. For example, the number of feasible options
available to facility E was reduced to seven options after the allocation of facilities
C and D, as shown in Table 7.2.
168
Table 7.6: Availability Matrix of the Site Layout Example in Figure 7.11 (a) after the Allocation of Facilities A and B
GridFacility 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Total Positions
AvailableE 0 0 0 0 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7
The wires are connected in parallel to an imaginary source of electricity
that has a voltage (V) forming an electric circuit. The distances between facilities
are calculated according to their positions on site as stipulated by each wire. The
intensities of the wires represent the total travel distance between facilities. They
are calculated by substituting the distances between facilities and their closeness
relationships in the objective function (7.2). The global resistance (Rn) of a wire
represents its quality. This means that the wires achieved the shortest travel
distance will be assigned higher resistances. The global resistances are
calculated using Ohm’s law, as discussed in previous chapters. The wires are
ranked according to their quality, and the top 25% (highest resistances) are
selected to conduct sensitivity analysis.
The quality of each available position on site associated with a certain
facility is then determined based on its local resistance (rml). The local
resistances are determined through the sensitivity analysis step. For each of the
top wires, the value of each segment (location reference) is substituted in its
corresponding segment of the comparison wire. Figure 7.12 illustrates the
sensitivity analysis step using the construction site setting in the previous figure.
Each time a segment is evaluated, the wire generated is checked for its
feasibility. The contribution of the infeasible wires is minimized by decreasing
their global resistance. This is achieved by assigning them the resistance of the
169
control wire divided by a factor slightly greater than one. Based on preliminary
experimentations, a factor of value (1.2) was found to be suitable. As such, this
will decrease the probability of selecting this location reference for the facility in
future iterations. However, the decrease is not much. The reasoning behind this
procedure is that the infeasibility of the solution is related to the current setting of
the site (control wire); however, the segment value can still provide feasible
solutions in different site settings (wires). As shown in Figure 7.12, although the
location reference (28) is an available option for placing facility D, the positions of
facilities C and E in the control wire will interfere with placing it rendering (WD) an
infeasible solution.
C D EWbest 9 39 13Wn 33 28 15
WC 33 39 13WD 9 28 13 InfeasibleWE 9 39 15
Figure 7.12: Sensitivity Analysis Step for SLPP Modeling Using Electimize
The local resistances (rik) of site location (k) for facility (i) are then updated
and the selection probability (Pik) are calculated in accordance. It should be
noted that the selection probability (Pik) of site locations is based on the local
resistance (rik), since the area (aik) and resistivity (ρ) are the same for all decision
variable values, i.e. equal to 1.
170
7.9 SLPP: Computer Coding
Spreadsheet-based software was developed to model the SLPP. Microsoft
Excel was used in designing the software. The software is comprised of multiple
sheets to store, retrieve, and report different data about the problem like
information about the sizes of the facilities, availability matrix, best solutions
identified throughout the iterations, the wires generated, selection probabilities of
values, best wires generated form the sensitivity analysis step only, and drawing
the final site layout. The user interaction is limited only to two spreadsheets. On
the first spreadsheet, the user enters the data about the dimensions of the
construction site, the number of facilities, facility name, facility type (fixed or
temporary), and facility dimensions, as shown in Figure 7.13a. On the second
spreadsheet, the user enters the closeness relationships between facilities, as
shown in Figure 7.13b. The software uses the given information to determine the
size of the grid units, centroids of the facilities, and calculate the travel distances
among them. The software was coded as a Macro Program in MS Excel using
VBA. The VBA code for the SLPP is presented in Appendix (A-VI).
When the user starts the optimization process, the software collects
information about the number of iterations, number of wires, and the number of
best wires to be used in the sensitivity analysis step. Separate spreadsheets
were designed to store information about the generated wires, best and worst
solutions, and record the convergence of the solution towards the global
optimum. After completing the optimization process, the software then uses the
best solution to draw the final layout of the site with all facilities in position.
171
(a)
(b)
Figure 7.13: Screenshots of the Site Layout Software
7.10 SLPP: Application Example and Results
Electimize was applied to a site layout planning problem from the
literature. The problem was first introduced by Rodriguez-Ramos in 1982 in his
PhD thesis, presenting quantitative techniques for construction site layout
planning based on CRAFT, which is a computer-based model for construction
site layout planning (Hegazy and Elbetagi 1999). The problem was reattempted
by Hegazi and ELbeltagi (1999) in their proposed model –Evosite, which is based
on Genetic Algorithms. The problem is a tightly-packed construction site layout
planning problem composed of 8 temporary facilities to be allocated on a
construction site that has dimensions of (1,500 x 1,700) square feet. The project
has nine fixed facilities, as shown in Figure 7.14. The project facilities description
and information are given in Table 7.7. The site grid was divided into
15 columns x 17 rows, with each grid unit representing an area of 10 x 10 ft2.
172
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1
2 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 2
3 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 3
4 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 4
5 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 5
6 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 6
7 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 7
8 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 8
9 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 9
10 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 10
11 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 11
12 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 12
13 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 13
14 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 14
15 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 15
16 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 16
17 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 171 2 3 4 5 6 7 8 9 10 11 12 13 14 15
IK
J
QL
M N
O
P
Figure 7.14: Construction Site of the Application Example (Hegazy and Elbetagi 1999)
Table 7.7: Fixed and Temporary Facility Attributes used in the Application Example (Hegazy and Elbetagi 1999)
Facility Description Area (ft2)
Facility Type (1 = Fixed, 0=
Temp) Width Length No. of
OptionsX-
Coord.Y-
Coord.
1 Field office 600 0 30 20 93 - -2 Warehouse 600 0 20 30 102 - -3 Reinforcing bars shop 1 600 0 30 20 93 - -4 Reinforcing bars shop 2 600 0 20 30 102 - -5 Excavated material 800 0 20 40 88 - -6 Patch plant 800 0 20 40 88 - -7 Subcontractor's office 600 0 30 20 93 - -8 Formwork shop 800 0 20 40 88 - -9 Project I 1,200 1 30 40 - 8.5 2
10 Project J 600 1 30 20 - 8.5 511 Project K 1,200 1 30 40 - 5.5 212 Project L 800 1 20 40 - 1 1213 Project M 600 1 20 30 - 1 15.514 Project N 1,500 1 50 30 - 6.5 15.515 Project O 1,600 1 40 40 - 13 1216 Project P 1,200 1 40 30 - 13 15.517 Project Q 1,200 1 30 40 - 3.5 12
173
The optimization objective in this problem is to minimize the total travelling
distance between the 17 facilities, taking into account the desired closeness
relationships (proximity) among them, as given in Table 7.8.
Table 7.8: Proximity Matrix of Relationships between Facilities in the Application Example (Hegazy and Elbetagi 1999)
Field office
Wareh.
Reinf. shop 1
Reinf. shop 2
Exc. Material
Patch plant
Sub. office
Form. shop I J K L M N O P Q
Field office 0 10 2 4 0 2 0 2 2 2 6 10 2 2 20 4 2Warehouse 10 0 4 4 0 0 0 20 4 6 4 2 4 6 20 4 2Reinforcing bars shop 1 2 4 0 0 0 0 0 0 20 20 20 0 0 0 20 20 0Reinforcing bars shop 2 4 4 0 0 0 0 0 0 0 0 0 20 40 60 0 0 20Excavated material 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0Patch plant 2 0 0 0 0 0 0 0 100 200 100 400 300 100 500 400 300Subcontractor's office 0 0 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6Formwork shop 2 20 0 0 0 0 0 0 20 20 20 20 20 20 60 20 20Project I 2 4 20 0 0 100 6 20 0 0 0 0 0 0 0 0 0Project J 2 6 20 0 0 200 6 20 0 0 0 0 0 0 0 0 0Project K 6 4 20 0 0 100 6 20 0 0 0 0 0 0 0 0 0Project L 10 2 0 20 0 400 6 20 0 0 0 0 0 0 0 0 0Project M 2 4 0 40 0 300 6 20 0 0 0 0 0 0 0 0 0Project N 2 6 0 60 0 100 6 20 0 0 0 0 0 0 0 0 0Project O 20 20 20 0 0 500 6 60 0 0 0 0 0 0 0 0 0Project P 4 4 20 0 0 400 6 20 0 0 0 0 0 0 0 0 0Project Q 2 2 0 20 0 300 6 20 0 0 0 0 0 0 0 0 0
Electimize was able to find a new optimal solution for this problem using
50 iterations, 100 wires, and the top 21 wires in each iteration for the sensitivity
analysis step. In the sensitivity analysis step, the best wire generated is used as
a comparison wire for 90% of the iterations, and the overall global best wire is
used in the remaining 10%. Based on experimentations, the Heat Factor (HF)
was set to a value of 0.55, and the local resistances (rml) were reduced
periodically in accordance if a value is selected more than 900 times. A new
optimal solution was generated by Electimize (18,713.14 ft) in 1hr, 20 min., and
32 sec. on a 2.00 GHz Intel Core 2 Duo laptop with 4.00 GB of memory. This
solution, along with some other near optimal solutions, is illustrated in Table 7.9.
Electimize was able to identify this solution in the 50th iteration, as shown in
174
Figure 7.15. The fact that solution was identified in the very last iterations made it
essential to reattempt the problem with different settings for Electimize. The
experiment was conducted using 100 iterations, while the rest of settings
remained the same; however, no further enhancement in the solution was
reported.
Table 7.9: Best Site Layout Settings for the Application Example
No. Field office Ware. Reinf.
shop 1Reinf. shop 2
Exc. Material
Patch plant
Sub. office
Form. shop Travel Distance
1 129 160 99 213 26 156 125 158 18,713.142 132 160 99 213 26 156 124 158 18,776.683 132 160 113 213 26 156 124 158 18,803.66
Facility Location Reference
1850018700189001910019300195001970019900201002030020500
0 2 4 6 8 10 12 1416 18 2022 24 2628 30 3234 36 3840 42 4446 48 5052 54
Iterations
Trav
el D
ista
nce
Figure 7.15: Electimize Convergence towards the Optimal Solution
The optimal solution was verified mathematically, as illustrated in
Appendix (C-I). By inspecting Figure 7.15, it can be seen that there is a dramatic
drop in the total travel distance after the first and second iterations, which
indicates the fast convergence rate of Electimize towards the optimal value
175
region. Additionally, it can be noticed that identification of the optimal solution
appeared in the last 10% of the number of iterations; i.e. after changing the
comparison wire.
7.10.1 SLPP: Comparison with Previous Attempts:
As mentioned in the previous section, the application example was
attempted twice. The original solution for this problem was reported by
Rodriguez-Ramos in 1982 and has a value of 22,386 ft (Hegazy and Elbetagi
1999). The second attempt was conducted by Hegazy and Elbetagi in 1999 using
GAs. In their attempt, they used a population of 200 genes and 100 offspring.
They obtained a new solution (22, 229 ft), which is better than the first attempt
with an improvement of 1 percent. Electimize was able to identify a better
solution (18,713.14) than the previous attempts with an improvement of 20% and
19% from the first and second attempt respectively. It should be noticed that the
solution reported by Electimize in the first iteration (20,392.89) is still better than
previous attempts. This demonstrates the capabilities of Electimize of being a
very efficient tool for solving construction combinatorial optimization problems.
The different attempts made to solve the problem are summarized in Table 7.10.
The final site layout reported by Electimize in comparison to Hegazi and
Elbeltagi’s solution is illustrated in Figure 7.16.
176
Table 7.10: Summary of Different Attempts Made to Solve SLPP Application Example
Algorithm Best Solution Attempt ByElectimize 18,713 Abdel-Raheem GAs 22,229 Hegazy and Elebeltagi (1999)Mathematical Technique 22,386 Rodriguez-Ramos (1982)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
11 2 3 4 5 6 7 8 9 10 11 12 13 14 15
11 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1
216 17 18 19 20 21 22 23 24 25 28 29 30
216 17 18 19 20 21 22 23 24 25 26 27 28 29 30
2
331 32 33 34 35 36 37 38 39 40 43 44 45
331 32 33 34 35 36 37 38 39 40 41 42 43 44 45
3
446 47 48 49 50 51 52 53 54 55 58 59 60
446 47 48 49 50 51 52 53 54 55 56 57 58 59 60
4
561 62 63 64 65 66 67 68 69 70 73 74 75
561 62 63 64 68 69 70 71 72 73 74 75
5
676 77 78 79 80 81 82 83 84 85 86 87 88 89 90
676 77 78 79 83 84 85 86 87 88 89 90
6
791 92 93 94 95 96 97 98 102 103 104 105
791 92 93 94 95 96 97 101 102 103 104 105
7
8106 107 108 109 110 111 112 113 117 118 119 120
8106 107 108 111 112 116 117 118 119 120
8
9121 122 123 124 128 132 133 134 135
9121 122 123 129 130 131 132 133 134 135
9
10136 137 138 139 143 147 148 149 150
10136 137 138 144 145 146 147 148 149 150
10
11151 152 153 154 155 162 163 164 165
11151 152 153 154 155 160 161 162 163 164 165
11
12166 167 168 169 170 177 178 179 180
12166 167 168 169 170 177 178 179 180
12
13181 182 183 184 185 192 193 194 195
13181 182 183 184 185 192 193 194 195
13
14196 197 198 199 200 205 206 207 208 209 210
14196 197 198 199 200 207 208 209 210
14
15211 212 215 216 217 218 219 220 221 222 223 224 225
15211 212 215 216 217 218 219 222 223 224 225
15
16226 227 230 231 232 233 234 235 236 237 238 239 240
16226 227 230 231 232 233 234 235 236 237 238 239 240
16
17241 242 245 246 247 248 249 250 251 252 253 254 255
17241 242 245 246 247 248 249 250 251 252 253 254 255
171 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
(a) Electimize (b) Genetic Algorithms ( Hegazy & Elbetagi 1999)
IK
J
QL
M N
O
P
IK
J
QL
M N
O
P
Excav. Material
Rein. Bar Shop 1
Field OfficeSub. Office
Patch Plant
Form. Shop
Ware-house
Rein. Bar
Shop 2
Sub. Office
Rein. Bar Shop 1
Field OfficeWare-house
Form. Shop
Patch Plant
Rein. Bar
Shop 2
Excav. Material
Figure 7.16: Final Site Layout Plan of the Application Example for Different Attempts
7.11 Summary and Conclusion
This chapter presented testing Electimize performance in solving complex
construction,-related optimization problems. Two construction combinatorial
optimization problems were attempted. The first problem is a static optimization
problem, which is the time-cost tradeoff problem (TCTP). Electimizie was applied
to a benchmark TCTP in comparison to other evolutionary algorithms (EAs) used
to solve the same problem in previous studies. Not only was Electimize able to
find the optimal solution for the problem, but also it outperformed other EAs in
terms of the number of iterations and solution strings used to find the optimal
value.
177
The second problem attempted is a dynamic construction optimization
problem, which is the site layout planning problem (SLPP). Electimize was also
applied to a benchmark SLPP in comparison to a previous attempt made using
GAs. Eletimize was successful in identifying a new optimal solution for this
problem with an improvement of almost 20% over the solution reported in the
research literature. It is worth mentioning that the two problems are complex, and
they required extensive efforts in computer modeling before optimization using
Electimize.
Electimize proved to be an efficient tool in solving complex construction
optimization problems. The ease of its application and its fast convergence make
it a reliable tool for searching for and identifying the optimal solution(s) for a wide
range of problems in construction engineering and management.
178
CHAPTER 8: SUMMARY, CONCLUSIONS, CONTRIBUTIONS AND FUTURE RESEARCH
8.1 Introduction
This chapter aims to provide: 1) a quick summary of the work
accomplished throughout this doctoral research, 2) the conclusions inferred and
their expected contributions to the construction industry, and finally 3) possible
future research in the area of construction engineering optimization.
8.2 Summary
This doctoral research presented the development of a new evolutionary
algorithm for optimization named “Electimize”, and its application in construction
engineering. The main motivation of this research is to overcome the limitations
of other existing evolutionary algorithms (EAs) demonstrated by their inability of
finding the optimal solution for different types of optimization problems. The
philosophy adopted in this research attributed such limitations to two main
factors. First, the majority of EAs evaluate the quality of solution strings as a
whole without considering the individual quality of decision variable values in the
solution string. Some EAs assign equal merit (quality indicator) to all values in
the same solution string despite the differences in their quality. Second, the
concept of simulation adopted by the some EAs is quite flawed in the sense that
they simulate the most common behavior of a certain species when the fact is
species change their behavior to adapt to the change in the environment around
179
them. This shortcoming is also demonstrated by the use of hypothetical
equation(s) to model the interaction between certain species and their
environment.
The research addressed three main objectives in the development of
Electimize. These objectives are 1) Developing optimization methodology that is
capable of evaluating the quality of each value in the solution string
independently; 2) Devising internal processes that would enable the algorithm to
extensively search the solution space and avoid its convergence to local optima;
and 3) Providing the construction industry with a reliable optimization tool that is
capable of solving different classes of optimization problems.
The development of the algorithm was followed by testing of its
capabilities on a multitude of optimization problems. First, the algorithm was
verified for its ability to assess the quality of each value in the solution string
independently, and its impact on guiding the search towards the optimal solution.
In testing the first capability of the algorithm, a benchmark NP-hard cash flow
management problem, which belongs to the dynamic optimization class, was
attempted. The probabilities of selecting values from the solution space were
traced and documented throughout the iterations. The results showed that the
solution space values comprising the optimal solution had the highest selection
probabilities. In other words, the notion of individual quality assessment of values
guided the algorithm in its search for the optimal values in the solution space.
180
Not only was Electimize able to find the optimal solution for the cash flow
management problem, but also it was able to identify ten alternative optimal
solutions for this given problem. This demonstrates its capability of extensively
searching the solution space. To further verify such capability, the test was
extended to include multimodal optimization problems. A 9-city asymmetric
travelling salesman problem (TSP) was utilized to test the performance of
Electimize. The problem has 27 alternative optimal solutions. Electimize was able
to identify 21 alternative optimal solutions for this problem. In order to draw solid
conclusions about the capabilities of the algorithm, it deemed essential to test its
performance on solving larger instances. A symmetric benchmark 16-city TSP –
referred to as Ulysses16– was attempted. The logic behind the work is that any
symmetric TSP can be considered a bimodal optimization problem. Ulysses16
was attempted twice. In the first attempt, the coordinates of the cities were used
to calculate the distances between them using the Euclidian theorem.
Alternatively, in the second case, the distances between cities are calculated as
geographic. In both cases, Electimize was able to identify the optimal tour and its
reverse.
When the size of the instance of the TSP was increased to 29 cities,
Electimize experienced slow rate of convergence and was not able to identify the
optimal solution within an acceptable computational time. As such, it deemed
essential to modify the algorithm’s steps and internal processes in order to
enhance the convergence rate. New optimization parameters were introduced.
These parameters are classified into two main categories: 1) resistance-related
181
parameters, which provide the algorithm with additional information about the
problem to guide the search towards the optimal values; and 2) solution
exploration parameters, which aim at preventing the algorithm from converging
prematurely towards local optima and consequently improve the convergence
rate. Two symmetric benchmark TSPs were then attempted. The first problem is
a 29-city TSP – referred to as Bayg29; and the second problem is a 48-city TSP
– referred to as Att48. Electimize was able to identify the optimal solutions for
both problems. The results showed high convergence of the algorithm after the
introduction of the new parameters. This was demonstrated by achieving an error
rate of less than 10% of the optimal solution after the third iteration and before
identifying the optimal solution. The results were compared to previous attempt
made to solve the two problems using different EAs. The comparison showed
that Electimize outperformed some of the most popular EAs in terms of the
quality of the solution reported, as the majority of them failed to find the optimal
solution for the problems.
To test the reliability of Electimize as an optimization tool for the
construction industry, two construction optimization problems were attempted.
The first problem is an NP-hard static optimization problem, which is the time-
cost tradeoff problem (TCTP). The second problem is a dynamic NP-hard
optimization problem, which is the site layout planning problem (SLPP). First, a
benchmark TCTP was selected from the literature, modeled, and attempted
using Electimize, which was able to find the optimal solution in the first iteration
using 30 solution strings (wires). The results were compared to previous attempts
182
made using different EAs. Although some of the EAs used in previous attempts
were able to find the optimal solution, they needed hundreds of iterations and/or
solution strings in addition to local search algorithms – in some cases– to find the
optimal solution. Second, Electimize was applied to a benchmark SLPP from the
literature. Electimize was able to identify a new optimal solution for the problem
with an improvement of almost 20.
8.3 Conclusion
There are some important points that can be concluded from this research
study:
1. Electimize proved to be efficient in assessing the quality of each decision
variable value in the solution string and as such, it helped in directing the
search towards the optimal values. This was demonstrated by the
assignment of higher selection probabilities to decision variable values
constituting the optimal solution.
2. Electimize showed high performance in searching the solution space
extensively. This was illustrated by the algorithm’s success in identifying
multiple alternative optimal solutions in the optimization problems
attempted. As such, it could be concluded that Electimize is capable of
solving the NP-hard multimodal optimization problems.
3. Electimize proved to be a reliable tool for solving static optimization
problems in the construction domain. This was demonstrated by its ability
183
to solve a static construction optimization problem in a single iteration
using thirty solution strings in comparison to hundreds of iterations and
solution strings used by other EAs to find the optimal solution for the same
problem.
4. Electimize proved to be efficient in solving dynamic construction-related
optimization problems as demonstrated by its ability to identify alternative
optimal solutions for the cash flow management problem and the
identification of a new optimal solution that has never been determined by
previous algorithms for a benchmark site layout problem.
5. Although the interaction of the end user with Electimize is limited to her/his
input of the number of iterations, number of wires, and the number of
wires used for the sensitivity analysis step, Electimize is characterized by
a large number of parameters that require a solid understanding by the
developer in order to model it.
8.4 Research Contributions
The main contributions of this doctoral research can be summarized as
follows:
1. Development of a new evolutionary algorithm –named Electimize- based
on the simulation of the phenomenon of electric conduction. The algorithm
was designed to solve discrete optimization problems.
184
2. Development of internal processes within the algorithm that are capable of
individually evaluating the quality of each decision variable values. This
was demonstrated by the notion of local resistance and the method of
calculating the selection probabilities of decision variable values form the
solution space.
3. Development internal processes that are capable of providing further
insight about the solution space and help identify alternative optimal
solution for the same optimization problem. This was accomplished by the
sensitivity analysis step, changing the control wire throughout various
iterations, and the notion of heat effect.
4. Providing an efficient optimization tool for solving complex construction
engineering optimization problem. This was demonstrated by solving three
NP-hard construction-related problems.
8.5 Future Research
The main objectives of this research studies were accomplished.
However, a need for further research studies has emerged during the course of
this research. These future research studies can be summarized as follows:
1. Although some preliminary experiments were conducted in this research
to determine the feasible ranges of values for the various optimization
parameters used by Electimize, there is a need for a robust study to
understand how to fine tune these parameters.
185
2. The reported computational time for solving each of the various
optimization problems discussed in this study does not accurately
represent the least time required to solve the problem due to the
incorporation of additional steps in order to report the intermediate data
that is needed to analyze the algorithm performance. The computational
times reported aimed at providing a general insight into the time-wise
performance of Electimize. It is expected that Electimize would need less
time to solve the same problems using a low-level programming language
with effective coding.
3. The comparison between the performance of Electimize and other EAs
was limited to a number of benchmark problems from the literature.
Therefore, there is a need for a focused study that would conduct
comparative analysis on the performance of Electimize with other types of
EAs – like Estimation of Distribution algorithm – and on solving large-scale
combinatorial optimization problems.
4. The applications of Electimize have been limited to solving discrete
optimization problems. Hence, there is a need to further expand the
capabilities of Electimize in order to provide the capability of solving
optimization problems with continuous decision variables.
186
APPENDIX A: VBA CODES OF ELECTIMIZE AND MODELS DEVELOPED
FOR DIFFERENT PROBLEMS ATTEMPTED
187
APPENDIX (A-I): VBA Code for the Cash Flow Problem Using Electimize (Original Version)
Public nDurDivisor As Integer Public mnDefDurUnits As Integer Public otask As Object Public ntasks, BestWire As Integer Public options() As Integer Public AssessValOF() As Integer Public Alternatives() As Integer Public Ires() As Double Public wire() As Integer Public ComparableValue, WorstComparableValue As Double Public OFValue() As Double Public UpdateOFValue() As Double Public BestOFValue() As Double Public WorstOFValue() As Double Public Prob() As Double Public Original() As Integer Public Intens() As Double Public Intens1() As Double Public best() As Integer Public worst() As Integer Public score() As Double Public Dscore() As Double Public ElDuplicate() As Integer '********************** Create Excel Sheet to Store Results************ Sub CashFlow_Electimize_Original_Algorithm Start = Time: Last = Start Randomize Dim xlapp As Object Set xlapp = CreateObject("excel.application") FileName = "c:\Ahuja.xls" xlapp.Application.DisplayAlerts = False xlapp.Application.Workbooks.Open FileName xlapp.Application.Visible = True FileName = "f:\summary.xls" xlapp.Application.DisplayAlerts = False xlapp.Application.Workbooks.Open FileName xlapp.Application.Visible = True xlapp.Workbooks("summary.xls").Worksheets("time").Cells(4, 7).Value = Start '***************************** Define Parameters Needed************************** Dim Volt, N_Iter, N_Wires, counter, maxalt, TS As Integer Dim Intensity, Intensity1 As Double msg = "How Many Wires Do You like to Fabricate ?" N_Wires = Int(Val(InputBox(msg, Title, ""))): If N_Wires = 0 Then End msg = "How Many Iterations Do You Like to Generate ?" iterations = Int(Val(InputBox(msg, Title, ""))) msg = "What is the Voltage of the Circuit ?"
188
Volt = Int(Val(InputBox(msg, Title, ""))) msg = "What is the Deadline of the Project (weeks) ?" Deadline = Int(Val(InputBox(msg, Title, ""))): If Deadline = 0 Then End msg = "What is the Penalty for Exceeding the Deadline ($) ?" penaltyperday = Int(Val(InputBox(msg, Title, "0"))) msg = "What is the Incentive for Finishing the Project Earlier ($) ?" incentiveperday = Int(Val(InputBox(msg, Title, "0"))) msg = "What is the Indirect Cost per Day ($) ?" indirectCostPerDay = Int(Val(InputBox(msg, Title, "0"))) '******************* ******************** Construction of Trial Solutions******* ************************ mnDefDurUnits = ActiveProject.DefaultDurationUnits nDurDivisor = GetDurDivisor() OptionsEdit DayLabelDisplay:=0 OptionsSchedule TaskType:=0, DurationUnits:=7 ViewApply Name:="&Gantt Chart" SelectBeginning ntasks = ActiveProject.tasks.count ReDim AssessValOF(ntasks) As Integer ReDim options(ntasks) As Integer ReDim wire(N_Wires, ntasks) As Integer ReDim UpdateOFValue(N_Wires, ntasks) As Double ReDim BestOFValue(N_Wires) As Double ReDim WorstOFValue(N_Wires) As Double ReDim OFValue(N_Wires) As Double ReDim Original(ntasks) As Integer ReDim Intens(N_Wires) As Double ReDim Intens1(ntasks) As Double ReDim best(ntasks) As Integer ReDim worst(ntasks) As Integer ReDim score(N_Wires) As Double ReDim Dscore(ntasks) As Double ReDim ElDuplicate(ntasks, N_Wires) For t = 1 To ntasks Original(t) = Val(ActiveProject.tasks(t).GetField(pjTaskEarlyStart)) Next t Dim count, count1 As Integer 'counter for excel sheet (Duplicate) and (Original) count = 1 count1 = 2 Dim sigma1, sigma2, sigma3, sigma4 As Double ' Sigma for resistance update and normalization 'Get Number of Options LevelingOptions Automatic:=True, Order:=2 counter = 0 maxalt = 0 Dim h As Integer For h = 1 To ActiveProject.tasks.count TS = Val(ActiveProject.tasks(h).GetField(pjTaskTotalSlack)) 'total slack (TS) If maxalt < (TS + 1) Then maxalt = (TS + 1)
189
End If Next h ReDim Alternatives(ntasks, maxalt) As Integer ReDim Ires(ntasks, maxalt) As Double ReDim Prob(ntasks, maxalt) As Double For o = 1 To ActiveProject.tasks.count 'Counting options of start dates ES = Val(ActiveProject.tasks(o).GetField(pjTaskEarlyStart)) TS = Val(ActiveProject.tasks(o).GetField(pjTaskTotalSlack)) For W = 0 To TS Alternatives(o, (W + 1)) = (ES + W) counter = counter + 1 options(o) = counter Next W counter = 0 Next o For i = 1 To ntasks 'Initial internal resistance of all options For j = 1 To options(i) Ires(i, j) = 0.01 Next j Next i Dim MX As Integer 'counter for resistance excel sheet MX = 1 ComparableValue = 0 'to determine best and worst wires through all the iterations WorstComparableValue = 100000000 For ppp = 1 To N_Wires BestOFValue(ppp) = ComparableValue WorstOFValue(ppp) = WorstComparableValue Next ppp Dim BestScore As Double BestScore = 0 Dim best1, worst1 As Double ' to determine best and worst wires in each iteration best1 = 0 worst1 = 100000000 '*******************************Start Evolution, Main Wire Loop**************** For X = 1 To iterations sigma1 = 0 sigma2 = 0 'Get Probability of Options xlapp.Workbooks.Add FileName = X xlapp.ActiveWorkbook.SaveAs FileName xlapp.ActiveWorkbook.Worksheets(1).Name = "Mohamed" xlapp.ActiveWorkbook.Worksheets(2).Name = "Wire"
190
xlapp.ActiveWorkbook.Worksheets(3).Name = "Random" xlapp.Worksheets.Add xlapp.ActiveWorkbook.ActiveSheet.Name = "Probability" xlapp.Worksheets.Add xlapp.ActiveWorkbook.Worksheets(1).Name = "Intensity" xlapp.Worksheets.Add xlapp.ActiveWorkbook.Worksheets(1).Name = "BestOF" xlapp.Worksheets.Add xlapp.ActiveWorkbook.Worksheets(1).Name = "WorstOF" xlapp.Workbooks("ahuja.xls").Worksheets("mohamed").Range("A1:AE20").Copy xlapp.ActiveWorkbook.Worksheets("mohamed").Paste For i = 1 To ntasks sigma = 0 For jm = 1 To options(i) sigma = sigma + (Ires(i, jm)) 'originally (1 / Ires(i, jm)) Next jm For jo = 1 To options(i) Prob(i, jo) = (Ires(i, jo)) / sigma ' originally (1 / Ires(i, jo)) xlapp.Worksheets("Probability").Cells(i, jo).Value = Prob(i, jo) Next jo Next i For Gap = 1 To ntasks xlapp.Workbooks("summary.xls").Worksheets("resistance").Cells((MX + Gap), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("resistance").Cells((MX + Gap), 2).Value = Gap For gf = 1 To options(Gap) xlapp.Workbooks("summary.xls").Worksheets("resistance").Cells((MX + Gap), (1 + 2 * gf)).Value = Alternatives(Gap, gf) xlapp.Workbooks("summary.xls").Worksheets("resistance").Cells((MX + Gap), (2 + 2 * gf)).Value = Ires(Gap, gf) Next gf Next Gap MX = MX + 1 + ntasks Dim K As Integer ‘****************************Fabricate population of wires************************ For K = 1 To N_Wires ' 'MsgBox (k) Dim CountSlack As Integer CountSlack = 0 xlapp.Workbooks("summary.xls").Worksheets("original").Cells((count1), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("original").Cells((count1), 2).Value = K xlapp.Worksheets.Add xlapp.Worksheets("mohamed").Range("A1:AE20").Copy xlapp.ActiveSheet.Paste xlapp.ActiveSheet.Name = K For i = 1 To ntasks Randomize
191
a = Rnd: sumprob = 0 xlapp.Worksheets("random").Cells(K, i).Value = a For j = 1 To options(i) If a >= sumprob And a < sumprob + Prob(i, j) Then wire(K, i) = Alternatives(i, j): Exit For 'originally = j End If sumprob = sumprob + Prob(i, j) Next j ActiveProject.tasks(i).SetField pjTaskStart, wire(K, i) Next i For i = 1 To ntasks wire(K, i) = Val(ActiveProject.tasks(i).GetField(pjTaskStart)) xlapp.Worksheets("wire").Cells(K, i).Value = wire(K, i) xlapp.Workbooks("summary.xls").Worksheets("original").Cells((count1), (i + 3)).Value = wire(K, i) If Val(ActiveProject.tasks(i).GetField(pjTaskTotalSlack)) = 0 Then CountSlack = CountSlack + 1 End If Next i xlapp.Workbooks("summary.xls").Worksheets("original").Cells((count1), 14).Value = CountSlack score(K) = ntasks / CountSlack Dim msg1, title1 As String Dim sum, availabe As Long Dim j1, m1, counterE, i1, a1, ff, fff, b, s, c, D, e, f, l, u, lastL, taskcount, earlyStart, duration, k1, av, counter1 As Integer taskcount = ActiveProject.tasks.count directcost = 0 indirectcost = penalty = incentive = 0 For j1 = 2 To taskcount + 1 xlapp.ActiveSheet.Cells(j1, 1).Value = (j1 - 1) Next j1 c = Val(ActiveProject.duration) / ((ActiveProject.HoursPerDay) * 60) lastL = 4 counterE = 0 For j = 1 To c counterE = 0 sum = 0 availabe = xlapp.ActiveSheet.Cells(13, lastL).Value For a = 1 To taskcount duration = Int(Val(ActiveProject.tasks(a).GetField(pjTaskDuration))) For f = 0 To duration - 1 If Val(ActiveProject.tasks(a).GetField(pjTaskEarlyStart) + f) = j Then 'And availabe >= sum Then
192
m = Val(ActiveProject.tasks(a).GetField(pjTaskText13)) sum = sum + m End If Next f Next a If availabe >= sum Then For s = 1 To taskcount duration = Int(Val(ActiveProject.tasks(s).GetField(pjTaskDuration))) For ff = 0 To duration - 1 m = Val(ActiveProject.tasks(s).GetField(pjTaskText13)) If Val(ActiveProject.tasks(s).GetField(pjTaskEarlyStart) + ff) = j Then xlapp.ActiveSheet.Cells(s + 1, lastL).Value = m xlapp.ActiveSheet.Cells(s + 1, 3).Value = Val(ActiveProject.tasks(s).GetField(pjTaskEarlyStart)) End If Next ff Next s counterE = 0 lastL = lastL + 1 Else For l = lastL + 1 To 200 availabe = xlapp.ActiveSheet.Cells(13, l).Value If availabe >= sum Then For u = 1 To taskcount duration = Int(Val(ActiveProject.tasks(u).GetField(pjTaskDuration))) For fff = 0 To duration - 1 m = Val(ActiveProject.tasks(u).GetField(pjTaskText13)) If Val(ActiveProject.tasks(u).GetField(pjTaskEarlyStart) + fff) = j Then xlapp.ActiveSheet.Cells(u + 1, l).Value = m xlapp.ActiveSheet.Cells(u + 1, 3).Value = Val(ActiveProject.tasks(u).GetField(pjTaskEarlyStart)) End If Next fff Next u counterE = 0 'lastL = l + 1 Exit For Else counterE = counterE + 1 If counterE = 5 Then MsgBox ("Insufficient Fund") GoTo Px End If End If Next l lastL = l + 1 End If counterE = 0 directcost = directcost + sum
193
Next j For j = 4 To lastL xlapp.ActiveSheet.Cells(1, (j - 1)).Value = (j - 4) Next j indirectcost = indirectCostPerDay * (lastL - 4) If Deadline - (lastL - 4) > 0 Then incentive = incentiveperday * (Deadline - (lastL - 4)) penalty = 0 Else penalty = penaltyperday * (-(Deadline - (lastL - 4))) incentive = 0 End If xlapp.ActiveSheet.Cells(14, 2).Value = "Direct Cost" xlapp.ActiveSheet.Cells(14, 3).Value = directcost xlapp.ActiveSheet.Cells(15, 2).Value = "Indirect Cost" xlapp.ActiveSheet.Cells(15, 3).Value = indirectcost xlapp.ActiveSheet.Cells(16, 2).Value = "Incentive" xlapp.ActiveSheet.Cells(16, 3).Value = incentive xlapp.ActiveSheet.Cells(17, 2).Value = "Penalty" xlapp.ActiveSheet.Cells(17, 3).Value = penalty Intensity = directcost + indirectcost + penalty - incentive xlapp.ActiveSheet.Cells(18, 2).Value = "Intensity" xlapp.ActiveSheet.Cells(18, 3).Value = Intensity xlapp.Worksheets("intensity").Cells(1, K).Value = Intensity Px: xlapp.Application.DisplayAlerts = False Intens(K) = Intensity Dim bbb As Double OFValue(K) = Volt / Intens(K) xlapp.Workbooks("summary.xls").Worksheets("original").Cells((count1), (3)).Value = Intens(K) Dim TempBest, TempWorst As Double If OFValue(K) > best1 Then best1 = OFValue(K) For bat = 1 To ntasks best(bat) = wire(K, bat) Next bat ElseIf OFValue(K) = best1 And score(K) > BestScore Then For bat = 1 To ntasks best(bat) = wire(K, bat) Next bat End If If OFValue(K) < worst1 Then worst1 = OFValue(K) For pat = 1 To ntasks worst(pat) = wire(K, pat) Next pat End If
194
If OFValue(K) > ComparableValue Then 'The best wire (the best overall solution) ComparableValue = OFValue(K) xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 2).Value = K xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 3).Value = Intens(K) xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 4).Value = "Best" xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 14).Value = CountSlack For sos = 1 To ntasks xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), (sos + 4)).Value = wire(K, sos) Next sos BestScore = score(K) For oi = 1 To ntasks ActiveProject.tasks(oi).SetField pjTaskText1, wire(K, oi) Next oi ElseIf OFValue(K) = ComparableValue And score(K) > BestScore Then ComparableValue = OFValue(K) xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 2).Value = K xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 3).Value = Intens(K) xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 4).Value = "Best" xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), 14).Value = CountSlack For sos1 = 1 To ntasks xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1), (sos1 + 4)).Value = wire(K, sos1) Next sos1 BestScore = score(K) For oi = 1 To ntasks ActiveProject.tasks(oi).SetField pjTaskText1, wire(K, oi) Next oi End If If OFValue(K) > BestOFValue(K) Then 'If new best solution for the current wire BestOFValue(K) = OFValue(K) xlapp.Workbooks("summary.xls").Worksheets("best").Cells((count1), 14).Value = CountSlack xlapp.Workbooks("summary.xls").Worksheets("best").Cells((count1), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("best").Cells((count1), 2).Value = K xlapp.Workbooks("summary.xls").Worksheets("best").Cells((count1), 3).Value = Intens(K) xlapp.Workbooks("summary.xls").Worksheets("best").Cells((count1), 4).Value = "Best" For j = 1 To ntasks ' Reset the best solution for the current wire
195
xlapp.Worksheets("BestOF").Cells(X, 1).Value = X xlapp.Worksheets("BestOF").Cells(j + 1, X).Value = wire(K, j) xlapp.Workbooks("summary.xls").Worksheets("best").Cells((count1), (j + 4)).Value = wire(K, j) Next j End If If OFValue(K) < WorstComparableValue Then 'The worst wire (the worst overall solution) WorstComparableValue = OFValue(K) xlapp.Workbooks("summary.xls").Worksheets("classify1").Cells((count1), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("classify1").Cells((count1), 2).Value = K xlapp.Workbooks("summary.xls").Worksheets("classify1").Cells((count1), 3).Value = Intens(K) xlapp.Workbooks("summary.xls").Worksheets("classify1").Cells((count1), 4).Value = "Worst" xlapp.Workbooks("summary.xls").Worksheets("classify1").Cells((count1), 14).Value = CountSlack For sps = 1 To ntasks xlapp.Workbooks("summary.xls").Worksheets("classify1").Cells((count1), (sps + 4)).Value = wire(K, sps) Next sps ActiveProject.tasks(oi).SetField pjTaskText2, wire(K, oi) Next oi Counter_stop = 0 End If If OFValue(K) < WorstOFValue(K) Then 'If new worst solution for the current wire WorstOFValue(K) = OFValue(K) xlapp.Workbooks("summary.xls").Worksheets("worst").Cells((count1), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("worst").Cells((count1), 2).Value = K xlapp.Workbooks("summary.xls").Worksheets("worst").Cells((count1), 3).Value = Intens(K) xlapp.Workbooks("summary.xls").Worksheets("worst").Cells((count1), 4).Value = "worst" xlapp.Workbooks("summary.xls").Worksheets("worst").Cells((count1), 14).Value = CountSlack For j = 1 To ntasks ' Reset the best solution for the current wire xlapp.Worksheets("WorstOF").Cells(X, 1).Value = X xlapp.Worksheets("WorstOF").Cells(j + 1, X).Value = wire(K, j) xlapp.Workbooks("summary.xls").Worksheets("worst").Cells((count1), (j + 4)).Value = wire(K, j) Next j End If For p = 1 To ntasks ActiveProject.tasks(p).SetField pjTaskStart, Original(p) Next p count1 = count1 + 1 Next K xlapp.ActiveWorkbook.Save xlapp.ActiveWorkbook.Close '*************************' Sensitivity Analysis******************************************
196
For Lcd = 1 To N_Wires xlapp.Workbooks.Add xlapp.ActiveWorkbook.SaveAs X * 100 + Lcd xlapp.ActiveWorkbook.Worksheets(1).Name = "Mohamed" xlapp.ActiveWorkbook.Worksheets("sheet2").Name = "intensity" xlapp.ActiveWorkbook.Worksheets("sheet3").Delete xlapp.Workbooks("ahuja.xls").Worksheets("mohamed").Range("A1:AE20").Copy xlapp.ActiveWorkbook.Worksheets("mohamed").Paste For D = 1 To ntasks CountSlack1 = 0 xlapp.Workbooks("summary.xls").Worksheets("Duplicate").Cells((X + count), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("Duplicate").Cells((X + count), 2).Value = D For td = 1 To ntasks AssessValOF(td) = worst(td) Next td For Tar = 1 To N_Wires If ElDuplicate(D, Tar) = wire(Lcd, D) Then UpdateOFValue(Lcd, D) = UpdateOFValue(Tar, D) xlapp.Workbooks("summary.xls").Worksheets("Duplicate").Cells((X + count), (D + 3)).Value = "Skip" GoTo Skip Else ElDuplicate(D, Tar) = wire(Lcd, D) End If Next Tar If worst(D) = wire(Lcd, D) Then UpdateOFValue(Lcd, D) = worst1 xlapp.Workbooks("summary.xls").Worksheets("Duplicate").Cells((X + count), (D + 3)).Value = "Skip" GoTo Skip Else AssessValOF(D) = wire(Lcd, D) End If For tt = 1 To ntasks xlapp.Workbooks("summary.xls").Worksheets("Duplicate").Cells((X + count), (tt + 3)).Value = AssessValOF(tt) Next tt xlapp.Worksheets.Add xlapp.Worksheets("mohamed").Range("A1:AE20").Copy xlapp.ActiveSheet.Paste xlapp.ActiveSheet.Name = (D & "D") For DD = 1 To ntasks ActiveProject.tasks(DD).SetField pjTaskStart, AssessValOF(DD) Next DD For IRI = 1 To ntasks If Val(ActiveProject.tasks(IRI).GetField(pjTaskTotalSlack)) = 0 Then CountSlack1 = CountSlack1 + 1
197
End If Next IRI Dscore(D) = CountSlack1 / ntasks directcost = 0 indirectcost = 0 penalty = 0 incentive = 0 For j1 = 2 To taskcount + 1 xlapp.ActiveSheet.Cells(j1, 1).Value = (j1 - 1) Next j1 c = Val(ActiveProject.duration) / ((ActiveProject.HoursPerDay) * 60) lastL = 4 counterE = 0 For j = 1 To c counterE = 0 sum = 0 availabe = xlapp.ActiveSheet.Cells(13, lastL).Value For a = 1 To taskcount duration = Int(Val(ActiveProject.tasks(a).GetField(pjTaskDuration))) For f = 0 To duration - 1 If Val(ActiveProject.tasks(a).GetField(pjTaskEarlyStart) + f) = j Then 'And availabe >= sum Then m = Val(ActiveProject.tasks(a).GetField(pjTaskText13)) sum = sum + m End If Next f Next a If availabe >= sum Then For s = 1 To taskcount duration = Int(Val(ActiveProject.tasks(s).GetField(pjTaskDuration))) For ff = 0 To duration - 1 m = Val(ActiveProject.tasks(s).GetField(pjTaskText13)) If Val(ActiveProject.tasks(s).GetField(pjTaskEarlyStart) + ff) = j Then xlapp.ActiveSheet.Cells(s + 1, lastL).Value = m xlapp.ActiveSheet.Cells(s + 1, 3).Value = Val(ActiveProject.tasks(s).GetField(pjTaskEarlyStart)) End If Next ff Next s counterE = 0 lastL = lastL + 1 Else For l = lastL + 1 To 200 availabe = xlapp.ActiveSheet.Cells(13, l).Value If availabe >= sum Then
198
For u = 1 To taskcount duration = Int(Val(ActiveProject.tasks(u).GetField(pjTaskDuration))) For fff = 0 To duration - 1 m = Val(ActiveProject.tasks(u).GetField(pjTaskText13)) If Val(ActiveProject.tasks(u).GetField(pjTaskEarlyStart) + fff) = j Then xlapp.ActiveSheet.Cells(u + 1, l).Value = m xlapp.ActiveSheet.Cells(u + 1, 3).Value = Val(ActiveProject.tasks(u).GetField(pjTaskEarlyStart)) End If Next fff Next u counterE = 0 Exit For Else counterE = counterE + 1 If counterE = 5 Then MsgBox ("Insufficient Fund") GoTo Dx End If End If Next l lastL = l + 1 End If counterE = 0 directcost = directcost + sum Next j For j = 4 To lastL xlapp.ActiveSheet.Cells(1, (j - 1)).Value = (j - 4) Next j indirectcost = indirectCostPerDay * (lastL - 4) If Deadline - (lastL - 4) > 0 Then incentive = incentiveperday * (Deadline - (lastL - 4)) penalty = 0 Else penalty = penaltyperday * (-(Deadline - (lastL - 4))) incentive = 0 End If xlapp.ActiveSheet.Cells(14, 2).Value = "Direct Cost" xlapp.ActiveSheet.Cells(14, 3).Value = directcost xlapp.ActiveSheet.Cells(15, 2).Value = "Indirect Cost" xlapp.ActiveSheet.Cells(15, 3).Value = indirectcost xlapp.ActiveSheet.Cells(16, 2).Value = "Incentive" xlapp.ActiveSheet.Cells(16, 3).Value = incentive xlapp.ActiveSheet.Cells(17, 2).Value = "Penalty" xlapp.ActiveSheet.Cells(17, 3).Value = penalty Intensity1 = directcost + indirectcost + penalty - incentive xlapp.ActiveSheet.Cells(18, 2).Value = "Intensity"
199
xlapp.ActiveSheet.Cells(18, 3).Value = Intensity1 xlapp.Worksheets("intensity").Cells(1, D).Value = Intensity1 Dx: xlapp.Application.DisplayAlerts = False '**********************************End Sensitivity Analysis ****************************** Intens1(D) = Intensity1 UpdateOFValue(Lcd, D) = Volt / Intensity1 xlapp.Workbooks("summary.xls").Worksheets("Duplicate").Cells((X + count), 3).Value = Intens1(D) xlapp.Workbooks("summary.xls").Worksheets("duplicate").Cells((X + count), 14).Value = CountSlack1 If UpdateOFValue(Lcd, D) > ComparableValue Then 'The best wire (the best overall solution) ComparableValue = UpdateOFValue(Lcd, D) BestScore = Dscore(D) xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 2).Value = D xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 3).Value = Intens1(D) xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 4).Value = "Duplicate" xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 14).Value = CountSlack1 For sos = 1 To ntasks xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), (sos + 4)).Value = AssessValOF(sos) Next sos 'last = Time ' noofsolutions = m best1 = UpdateOFValue(Lcd, D) For bat = 1 To ntasks best(bat) = AssessValOF(bat) ActiveProject.tasks(bat).SetField pjTaskText1, AssessValOF(bat) Next bat ElseIf UpdateOFValue(Lcd, D) = ComparableValue And Dscore(D) > BestScore Then BestScore = Dscore(D) ComparableValue = UpdateOFValue(Lcd, D) xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 1).Value = X xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 2).Value = D xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 3).Value = Intens1(D) xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 4).Value = "Duplicate" xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), 14).Value = CountSlack1 For sos1 = 1 To ntasks
200
xlapp.Workbooks("summary.xls").Worksheets("classify").Cells((count1 + 1), (sos1 + 4)).Value = AssessValOF(sos1) Next sos1 'last = Time ' noofsolutions = m best1 = UpdateOFValue(Lcd, D) For bat = 1 To ntasks best(bat) = AssessValOF(bat) ActiveProject.tasks(bat).SetField pjTaskText1, AssessValOF(bat) Next bat End If Skip: count = count + 1 Next D xlapp.ActiveWorkbook.Save xlapp.ActiveWorkbook.Close Next Lcd '**********************************Update Resistance *********************************** For MG = 1 To N_Wires ' Calculate sigma of total resistance For que = 1 To ntasks sigma1 = sigma1 + ((1 - ((worst1 - UpdateOFValue(MG, que)) / worst1)) * (OFValue(MG) / ntasks)) Next que For que4 = 1 To ntasks sigma4 = sigma4 + 1 / (((1 - ((worst1 - UpdateOFValue(MG, que4)) / worst1)) * (OFValue(MG) / ntasks)) / sigma1) Next que4 For di = 1 To ntasks 'Update internal resistance of all options For jp = 1 To options(di) If wire(MG, di) = Alternatives(di, jp) Then Ires(di, jp) = (Ires(di, jp) + (score(MG) * OFValue(MG) * ((1 / (((1 - ((worst1 - UpdateOFValue(MG, di)) / worst1)) * (OFValue(MG) / ntasks)) / sigma1)))) / sigma4) End If Next jp Next di Next MG count1 = count1 + 1 For Sat = 1 To ntasks ActiveProject.tasks(Sat).SetField pjTaskStart, Original(Sat) Next Sat Next X Last = Time xlapp.Workbooks("summary.xls").Worksheets("time").Cells(5, 7).Value = Last xlapp.Workbooks("summary.xls").SaveAs ("f:\summary1.xls") 'R: End Sub
201
‘*****************Private Function to Retrieve Data Stored in MS project Sheet************ Sub get_field_id(nof) Select Case nof Case 1 field_no = pjTaskText1 Case 2 field_no = pjTaskText2 Case 3 field_no = pjTaskText3 Case 4 field_no = pjTaskText4 Case 5 field_no = pjTaskText5 Case 6 field_no = pjTaskText6 Case 7 field_no = pjTaskText7 Case 8 field_no = pjTaskText8 Case 9 field_no = pjTaskText9 Case 10 field_no = pjTaskText10 Case 11 field_no = pjTaskEarlyStart Case 12 field_no = pjTaskTotalSlack Case 13 field_no = pjTaskText13 'cost per week End Select End Sub ‘*******************************Private Function to Convert MS project Time**************** Private Function GetDurDivisor() As Integer Select Case mnDefDurUnits Case pjMinute '0 minutes GetDurDivisor = 1 Case pjHour '1 hours GetDurDivisor = 60 Case pjDay '2 days GetDurDivisor = ActiveProject.HoursPerDay * 60 Case pjWeek '3 weeks GetDurDivisor = ActiveProject.HoursPerWeek * 60 End Select End Function
202
APPENDIX (A-II): VBA Code for the TSP (Undefined Start) Using Electimize (Original Version)
Sub TSP_Undefined_Start_Electimize_Original_Algorithm() Dim Tours() As Double Dim TourCost() As Double Dim Probab() As Double Dim Resist() As Double Dim Ires() As Double Dim Rworst() As Double Dim allcities() As Integer Dim best() As Integer Dim worst() As Integer Dim Volt As Double Dim Intensity, Intensity1 As Double Dim Temparray() As Double Dim Tempcities() As Integer Dim TopWires() As Double 'icludes the cost Dim Bestwire, Worstwire, Bestiteration, Worstiteration As Double '***********************************Define Parameters Needed********************************** msg = "How Many Iterations Do You Like to Generate ?" iterations = Int(Val(InputBox(msg, Title, ""))): If iterations = 0 Then End msg = "How Many Trials Do You like to Create ?" 'Wires' trials = Int(Val(InputBox(msg, Title, ""))): If trials = 0 Then End msg = "How Many Cities Are in the Tour ?" ncities = Int(Val(InputBox(msg, Title, ""))): If ncities = 0 Then End msg = "How Many Wires to Perform Sensitivity Analysis ?" Top = Int(Val(InputBox(msg, Title, ""))): If Top = 0 Then End ReDim Tours(trials, ncities + 1) ReDim TourCost(iterations, trials) 'Intensity ReDim Probab(ncities, ncities) ReDim Resist(iterations, trials) ReDim Ires(ncities, ncities) ' Internal Resistance ReDim allcities(ncities) ReDim Rworst(iterations) Dim sumprob, WireCost As Double ReDim Tempcities(ncities, 4) ReDim TopWires(Top, ncities + 2) 'Inclusdes the cost at the final cell countercell = 1 'For sheets (probability0) and (probability) countercellb = 1 ' For sheets (Tours) and (wires) counterx = 2 'for sheets (bes), (wors), (compare) counterc = 1 'for tours() Count = 1 Bestiteration = 1E+54 'best wire in all iterations Worstiteration = 0
203
'****************************************Iterations Start Here********************************** For i = 1 To ncities For j = 1 To ncities Ires(i, j) = 1 Next j Ires(i, i) = 0 'specifing zero probability for travelling from the same city to itself (zero diagonal) Next i For lm = 1 To Top TopWires(lm, ncities + 2) = 1E+50 + lm Next lm For X = 1 To iterations Bestwire = 1E+52 'best wire among all wires in ONE iterations Worstwire = 0 For lm = 1 To Top TopWires(lm, ncities + 2) = 1000 + lm Next lm '*******************************************Wires Generation Start Here********************************** For C = 1 To trials least = 1 sigma = 0 counter = 2 WireCost = 0 For i = 1 To ncities 'assignment of equal probability to all cities in the matrix For j = 1 To ncities 'which means Normalizing the probability of ALL CITIES in the Whole Matrix sigma = sigma + (Ires(i, j)) Next j Next i For io = 1 To ncities Worksheets("Probability0").Cells(io + countercell, 1).Value = io Worksheets("Ires").Cells(io + countercell, 1).Value = io For jm = 1 To ncities Worksheets("Probability0").Cells(countercell, jm + 1).Value = jm Worksheets("Ires").Cells(countercell, jm + 1).Value = jm Probab(io, jm) = (Ires(io, jm)) / sigma Worksheets("Probability0").Cells((io + countercell), (jm + 1)).Value = Probab(io, jm) Worksheets("ires").Cells((io + countercell), (jm + 1)).Value = Ires(io, jm) Next jm Next io a = Rnd: sumprob = 0 For i = 1 To ncities 'Randomly selecting the first city of all avaiable cities in the matrix
204
For j = 1 To ncities 'Worksheets("random").Cells(i + 1, j + 1).Value = a If a >= sumprob And a < sumprob + Probab(i, j) Then Worksheets("wires").Cells(C + countercellb, 2).Value = Worksheets("main").Cells(i + 1, j + 1).Value WireCost = WireCost + Worksheets("main").Cells(i + 1, j + 1).Value 'Worksheets("wires").Cells(c + 1, ncities + 2).Value = Worksheets("main").Cells(i + 1, j + 1).Value Worksheets("Tours").Cells(C + countercellb, 2).Value = i Tours(C, 1) = i Worksheets("Tours").Cells(C + countercellb, ncities + 2).Value = i Tours(C, ncities + 1) = i Worksheets("Tours").Cells(C + countercellb, 3).Value = j Tours(C, 2) = j city1 = i city = j 'MsgBox (i) GoTo 10 End If sumprob = sumprob + Probab(i, j) Next j Next i 10: For i = 1 To ncities 'Normalizing the probability of all cities on the same row sigma = 0 Worksheets("Probability").Cells(i + countercell, 1).Value = i For j = 1 To ncities Worksheets("Probability").Cells(countercell, j + 1).Value = j sigma = sigma + (Ires(i, j)) Next j For j = 1 To ncities Probab(i, j) = (Ires(i, j)) / sigma Worksheets("Probability").Cells(i + countercell, j + 1).Value = Probab(i, j) Next j Next i For i = 1 To (ncities - 2) a = Rnd: sumprob = 0 30: For j = 1 To ncities If a >= sumprob And a < sumprob + Probab(city, j) Then For d = 1 To ncities If j = Worksheets("Tours").Cells(C + countercellb, d + 1).Value Then GoTo 20 Next d counter = counter + 1 Worksheets("wires").Cells(C + countercellb, counter).Value = Worksheets("main").Cells(city + 1, j + 1).Value WireCost = WireCost + Worksheets("main").Cells(city + 1, j + 1).Value city = j Worksheets("Tours").Cells(C + countercellb, counter + 1).Value = city Tours(C, counter) = city
205
Exit For End If sumprob = sumprob + Probab(city, j) 20: Next j Next i If counter < ncities Then GoTo 30 If counter = ncities Then Worksheets("wires").Cells(C + countercellb, ncities + 1).Value = Worksheets("main").Cells(city + 1, city1 + 1).Value WireCost = WireCost + Worksheets("main").Cells(city + 1, city1 + 1).Value Worksheets("wires").Cells(C + countercellb, ncities + 3).Value = WireCost End If TourCost(X, C) = WireCost Worksheets("wirecost").Cells(X + 1, 1).Value = X Worksheets("wirecost").Cells(X + 1, C + 1).Value = TourCost(X, C) Volt = TourCost(1, 1) ^ 1.95 Worksheets("resistance").Cells(1, X).Value = Volt Resist(X, C) = Volt / TourCost(X, C) Worksheets("resistance").Cells(X + 1, 1).Value = X Worksheets("resistance").Cells(X + 1, C + 1).Value = Resist(X, C) '**********************************Selecting Top Best-********************************** For Kop = 1 To Top If least < TopWires(Kop, ncities + 2) Then least = TopWires(Kop, ncities + 2) ChangePosition = Kop End If Next Kop 'MsgBox (least) If TourCost(X, C) < least Then TopWires(ChangePosition, ncities + 2) = TourCost(X, C) For wop = 1 To ncities + 1 TopWires(ChangePosition, wop) = Tours(C, wop) Next wop End If '**********************************End of Selecting Top Best********************************** If TourCost(X, C) < Bestwire Then 'Recording BEST and WORST VALUEs Bestwire = TourCost(X, C) Sheets("Tours").Select Range(Cells(C + countercellb, 2), Cells(C + countercellb, ncities + 2)).Copy Sheets("Best").Select Range(Cells(counterx, 4), Cells(counterx, ncities + 4)).Select ActiveSheet.Paste ActiveSheet.Cells(counterx, 1).Value = X ActiveSheet.Cells(counterx, 2).Value = C ActiveSheet.Cells(counterx, 3).Value = TourCost(X, C) End If
206
If TourCost(X, C) > Worstwire Then Worstwire = TourCost(X, C) Sheets("Tours").Select Range(Cells(C + countercellb, 2), Cells(C + countercellb, ncities + 2)).Copy Sheets("worst").Select ActiveSheet.Range(Cells(counterx, 4), Cells(counterx, ncities + 4)).Select ActiveSheet.Paste ActiveSheet.Cells(counterx, 1).Value = X ActiveSheet.Cells(counterx, 2).Value = C ActiveSheet.Cells(counterx, 3).Value = TourCost(X, C) End If counterc = counterc + 1 Next C '**********************************End of Wire Fabrication********************************** For NM = 1 To trials For ty = 1 To ncities If Ires(Tours(NM, ty), Tours(NM, ty + 1)) < Resist(X, NM) / ncities Then Ires(Tours(NM, ty), Tours(NM, ty + 1)) = Ires(Tours(NM, ty), Tours(NM, ty + 1)) '+ Resist(X, NM) / ncities) / 2 End If Next ty Next NM If Bestwire < Bestiteration Then 'Storing best value and best wire identified Bestiteration = Bestwire Sheets("Best").Select Range(Cells(counterx, 4), Cells(counterx, ncities + 4)).Copy Sheets("Compare").Select ActiveSheet.Range(Cells(2, 5), Cells(2, ncities + 5)).Select ActiveSheet.Paste Worksheets("compare").Cells(2, 1).Value = Worksheets("best").Cells(counterx, 1).Value Worksheets("compare").Cells(2, 2).Value = Worksheets("best").Cells(counterx, 2).Value Worksheets("compare").Cells(2, 3).Value = "Best" Worksheets("compare").Cells(2, 4).Value = Worksheets("best").Cells(counterx, 3).Value End If If Worstwire > Worstiteration Then 'Storing worst value and best wire identified Worstiteration = Worstwire Sheets("Worst").Select Range(Cells(counterx, 4), Cells(counterx, ncities + 4)).Copy Sheets("Compare").Select ActiveSheet.Range(Cells(3, 5), Cells(3, ncities + 5)).Select ActiveSheet.Paste Worksheets("compare").Cells(3, 1).Value = Worksheets("Worst").Cells(counterx, 1).Value Worksheets("compare").Cells(3, 2).Value = Worksheets("Worst").Cells(counterx, 2).Value Worksheets("compare").Cells(3, 3).Value = "Worst" Worksheets("compare").Cells(3, 4).Value = Worksheets("worst").Cells(counterx, 3).Value End If 'Rworst(X) = Volt / Worstwire '**********************************SENSETIVITY ANALYSIS********************************** ReDim Temparray(ncities) Dim sigma2 As Double
207
Dim Sheetname As String Dim q As Integer Sheetname = X Worksheets.Add().Name = Sheetname Sheets("best").Select Range(Cells(counterx, 1), Cells(counterx, ncities + 5)).Copy Sheets(Sheetname).Select ActiveSheet.Range(Cells(1, 1), Cells(1, ncities + 5)).Select ActiveSheet.Paste counterm = 1 For d = 1 To Top sigma2 = 0 For sense = 1 To ncities Tempcost = 0 ActiveSheet.Range(Cells(1, 1), Cells(1, ncities + 5)).Copy ActiveSheet.Range(Cells(counterm + 3, 1), Cells(counterm + 3, ncities + 5)).Select ActiveSheet.Paste For swap = 2 To ncities + 1 If ActiveSheet.Cells(counterm + 3, swap + 3).Value = TopWires(d, sense + 1) Then q = ActiveSheet.Cells(counterm + 3, swap + 2).Value 'Original value to be replaced For sss = 1 To ncities + 1 If ActiveSheet.Cells(counterm + 3, sss + 3).Value = TopWires(d, sense) Then ActiveSheet.Cells(counterm + 3, sss + 3).Value = q End If Next sss ActiveSheet.Cells(counterm + 3, swap + 2).Value = TopWires(d, sense) 'ActiveSheet.Cells(counterm + 3, swap + 3).Value = ActiveSheet.Cells(counterm + 3, sense + 3).Value Tempcities(sense, 1) = ActiveSheet.Cells(counterm + 3, swap + 2).Value Tempcities(sense, 2) = ActiveSheet.Cells(counterm + 3, swap + 3).Value 'Exit For If swap = 2 Then ActiveSheet.Cells(counterm + 3, ncities + 4) = ActiveSheet.Cells(counterm + 3, 4) End If End If Next swap ActiveSheet.Cells(counterm + 3, 4) = ActiveSheet.Cells(counterm + 3, ncities + 4) For z = 1 To ncities tempcity = Sheets(Sheetname).Cells(counterm + 3, z + 3) tempcity1 = Sheets(Sheetname).Cells(counterm + 3, z + 4) Tempcost = Tempcost + Worksheets("main").Cells(tempcity + 1, tempcity1 + 1).Value Next z Sheets(Sheetname).Cells(counterm + 3, 3) = Tempcost
208
'*****************************************'UPDATING BEST VALUE************************************** If Tempcost < Bestiteration Or Tempcost = Bestiteration Then Bestiteration = Tempcost Sheets(Sheetname).Select Range(Cells(counterm + 3, 3), Cells(counterm + 3, ncities + 4)).Copy Worksheets("compare").Select Worksheets("compare").Cells(2, 4).Select ActiveSheet.Paste Worksheets("compare").Cells(2, 3).Value = "Duplicate" Sheets(Sheetname).Select Range(Cells(counterm + 3, 1), Cells(counterm + 3, 2)).Copy Worksheets("compare").Select Worksheets("compare").Cells(2, 1).Select ActiveSheet.Paste Sheets(Sheetname).Select Sheets(Sheetname).Select Range(Cells(counterm + 3, 3), Cells(counterm + 3, ncities + 4)).Copy Worksheets("compare").Select Worksheets("compare").Cells(2, 4).Select ActiveSheet.Paste Worksheets("Duplicate").Select Worksheets("Duplicate").Cells(Count, 4).Select ActiveSheet.Paste Worksheets("Duplicate").Cells(Count, 3).Value = "Duplicate" Worksheets("Compare").Cells(2, 3).Value = "Duplicate" Sheets(Sheetname).Select Range(Cells(counterm + 3, 1), Cells(counterm + 3, 2)).Copy Worksheets("compare").Select Worksheets("compare").Cells(2, 1).Select ActiveSheet.Paste Worksheets("Duplicate").Select Worksheets("Duplicate").Select Worksheets("Duplicate").Cells(Count, 1).Select ActiveSheet.Paste Sheets(Sheetname).Select Count = Count + 1 End If Temparray(sense) = ((Resist(X, d) / ncities) * (1 - ((Volt / Bestwire) - (Volt / Tempcost)) / (Volt / Bestwire))) sigma2 = sigma2 + Temparray(sense) Sheets(Sheetname).Cells(counterm + 3, ncities + 6) = Temparray(sense) counterm = counterm + 1 Next sense counterm = counterm + 1 '****************************************' UPDATING PROBABILITY************************************* For a = 1 To ncities tempcity = Tempcities(a, 1) tempcity1 = Tempcities(a, 2) Sheets("random").Cells(a, 1) = tempcity
209
Sheets("Random").Cells(a, 2) = tempcity1 If Ires(tempcity, tempcity1) < (Resist(X, d) * Temparray(a) / sigma2) Then Ires(tempcity, tempcity1) = (Resist(X, d) * Temparray(a) / sigma2) / 4 End If Next a Next d '******************************************' End of Sensitivity Analysis******************************** For LT = 1 To Top For k = 1 To ncities + 2 Sheets(Sheetname).Cells(counterm + 20 + LT, k + 4) = TopWires(LT, k) Next k Next LT countercell = countercell + ncities + 2 countercellb = countercellb + trials + 2 counterx = counterx + 1 Next X '******************************************' End of Iteration*************************************** End Sub
210
APPENDIX (A-III): VBA Code for the TSP (Defined Start) Using Electimize (Original Version)
Sub TSP_Defined_Start_Electimize_Original_Algorithm() Dim Tours() As Double Dim TourCost() As Double Dim Probab() As Double Dim Resist() As Double Dim Ires() As Double Dim Rworst() As Double Dim allcities() As Integer Dim best() As Integer Dim worst() As Integer Dim Volt As Double Dim Intensity, Intensity1 As Double Dim Temparray() As Double Dim Temparray2() As Double Dim Tempcities() As Integer Dim Sensitivity() As Integer Dim TopWires() As Double Dim Bestwire, Worstwire, Bestiteration, Worstiteration As Double '**************************************Define Parameters Needed***************************************** msg = "How Many Iterations Do You Like to Generate ?" iterations = Int(Val(InputBox(msg, Title, ""))): If iterations = 0 Then End msg = "How Many Trials Do You like to Create ?" 'Wires' trials = Int(Val(InputBox(msg, Title, ""))): If trials = 0 Then End msg = "How Many Cities Are in the Tour ?" ncities = Int(Val(InputBox(msg, Title, ""))): If ncities = 0 Then End msg = "How Many Best Wires to Perform Sensitivity Analysis ?" Top = Int(Val(InputBox(msg, Title, ""))): If Top = 0 Then End msg = "How Many Worst Wires to Perform Sensitivity Analysis ?" bottom = Int(Val(InputBox(msg, Title, ""))): 'If bottom = 0 Then End Start = Time ReDim Tours(trials, ncities + 1) ReDim TourCost(iterations, trials) 'Intensity ReDim Probab(ncities, ncities) ReDim Resist(iterations, trials) ReDim Ires(ncities, ncities) ' Internal Resistance ReDim allcities(ncities) ReDim Rworst(iterations) Dim sumprob, WireCost As Double ReDim Tempcities(ncities, 4) ReDim best(ncities + 2) ReDim worst(ncities + 1) ReDim Sensitivity(ncities, ncities + 1) ReDim TopWires(Top + bottom, ncities + 4) 'Inclusdes the distance at the final cell and resistance
211
Dim least, maximum As Double countercell = 1 'For sheets (probability0) and (probability) countercellb = 1 ' For sheets (Tours) and (wires) counterx = 2 'for sheets (best), (worst), (compare) counterc = 1 'for tours() 'city = 1 Count = 1 'counter for sheets(Duplicate) Bestiteration = 1E+54 'best wire in all iterations Worstiteration = 0 '******************************Main Iteration Start Here (Evolution)********************************* For i = 1 To ncities For j = 1 To ncities Ires(i, j) = 10 Next j Ires(i, i) = 0 'specifing zero probability for travelling from the same city to itself (zero diagonal) Next i For X = 1 To iterations Bestwire = 1E+52 'best wire among all wires in ONE iterations Worstwire = 0 AllwiresResistance = 0 For lm = 1 To Top TopWires(lm, ncities + 2) = 1000000000 + lm Next lm For ml = Top + 1 To Top + bottom TopWires(ml, ncities + 2) = 1 - ml Next ml '*****************************Wires Generation Start Here************************************ For C = 1 To trials least = 1 maximum = 1000000000 sigma = 0 counter = 2 WireCost = 0 For j = 1 To ncities 'assignment of equal probability to all cities in the ROW 1 sigma = sigma + (Ires(1, j)) Next j For jm = 1 To ncities Probab(1, jm) = (Ires(1, jm)) / sigma Next jm
212
Randomize a = randHW: sumprob = 0 city1 = 1 'Specifying first City as 1 10: Randomize For i = 2 To ncities 'Selecting the next city in the tour a = rand: sumprob = 0 30: For j = 1 To ncities For d = 1 To ncities If j = Tours(C, d) Then GoTo 20 Next d If a >= sumprob And a < sumprob + Probab(city, j) Then counter = counter + 1 WireCost = WireCost + Worksheets("main").Cells(city + 1, j + 1).Value city = j Tours(C, counter) = city Exit For End If sumprob = sumprob + Probab(city, j) 20: Next j Next i If counter < ncities Then GoTo 30 If counter = ncities Then WireCost = WireCost + Worksheets("main").Cells(city + 1, city1 + 1).Value End If TourCost(X, C) = WireCost Volt = TourCost(1, 1) ^ 1.5 Resist(X, C) = (Volt / TourCost(X, C)) / (iterations + 1 - X) AllwiresResistance = AllwiresResistance + Resist(X, C) '***************************Selecting Top Best Wires for Sensitivity Analysis********************* For Kop = 1 To Top If least < TopWires(Kop, ncities + 2) Then least = TopWires(Kop, ncities + 2) ChangePosition = Kop End If Next Kop If TourCost(X, C) < least Then TopWires(ChangePosition, ncities + 2) = TourCost(X, C) TopWires(ChangePosition, ncities + 3) = Volt / TourCost(X, C) TopWires(ChangePosition, ncities + 4) = C For wop = 1 To ncities + 1 TopWires(ChangePosition, wop) = Tours(C, wop) Next wop End If
213
'**********************************End of Selecting Top Best********************************** If TourCost(X, C) < Bestwire Then Bestwire = TourCost(X, C) For cc = 1 To ncities + 1 best(cc) = Tours(C, cc) Next cc best(ncities + 2) = C End If If TourCost(X, C) > Worstwire Then Worstwire = TourCost(X, C) For cd = 1 To ncities + 1 worst(cd) = Tours(C, cd) Next cd End If counterc = counterc + 1 Next C '**********************************End of Wire Fabrication*************************************** For dam = Top + 1 To Top + bottom 13: Yey = Int(randHW * trials): If Yey = 0 Or Yey = best(ncities + 2) Then GoTo 13 For fox = 1 To Top + bottom If Yey = TopWires(fox, ncities + 4) Then GoTo 13 Next fox For lam = 1 To ncities + 1 TopWires(dam, lam) = Tours(Yey, lam) Next lam TopWires(dam, ncities + 2) = TourCost(X, Yey) TopWires(dam, ncities + 3) = Volt / TourCost(X, Yey) TopWires(dam, ncities + 4) = Yey Next dam For NM = 1 To trials For ty = 1 To ncities Ires(Tours(NM, ty), Tours(NM, ty + 1)) = (Resist(X, NM) / ncities) 'Calculating initial local resistance ' Next ty Next NM If Bestwire < Bestiteration Then 'Storing best value and best wire identified Bestiteration = Bestwire Sheets("Compare").Cells(2, 1).Value = X Sheets("Compare").Cells(2, 2).Value = C For sd = 1 To ncities + 1 Sheets("Compare").Cells(2, sd + 4) = best(sd) Next sd Worksheets("compare").Cells(2, 3).Value = "Best" Worksheets("compare").Cells(2, 4).Value = Bestwire
214
ElseIf Bestwire = Bestiteration Then Bestiteration = Bestwire Sheets("Compare").Cells(4, 1).Value = X Sheets("Compare").Cells(4, 2).Value = C For sd = 1 To ncities + 1 Sheets("Compare").Cells(4, sd + 4) = best(sd) Next sd Worksheets("compare").Cells(4, 3).Value = "copyBest" Worksheets("compare").Cells(4, 4).Value = Bestwire End If If Worstwire > Worstiteration Then 'Storing worst value and worst wire identified Worstiteration = Worstwire Sheets("Compare").Cells(3, 1).Value = X Sheets("Compare").Cells(3, 2).Value = C For sm = 1 To ncities + 1 Sheets("Compare").Cells(3, sm + 4) = worst(sm) Next sm Worksheets("compare").Cells(3, 3).Value = "Worst" Worksheets("compare").Cells(3, 4).Value = Worstwire End If '*****************************************'SENSETIVITY ANALYSIS************************************* ReDim Temparray(ncities) ReDim Temparray2(ncities) Dim sigma2 As Double Dim q As Integer counterm = 1 For d = 1 To Top + bottom sigma2 = 0 For sense = 1 To ncities For bg = 1 To ncities + 1 Sensitivity(sense, bg) = best(bg) Next bg Tempcost = 0 For swap = 2 To ncities + 1 If TopWires(d, sense) = 1 Then ' ADDED to MAKE Sure It always Start with city1 Pot = Sensitivity(sense, swap) For dod = 1 To ncities + 1 If Sensitivity(sense, dod) = TopWires(d, sense + 1) Then Sensitivity(sense, dod) = Pot End If Next dod
215
Sensitivity(sense, swap) = TopWires(d, sense + 1) Sensitivity(sense, ncities + 1) = Sensitivity(sense, 1) GoTo 17 ElseIf Sensitivity(sense, swap) = TopWires(d, sense + 1) Then q = Sensitivity(sense, swap - 1) 'Original value to be replaced If q = 1 Then 'ADDED to MAKE Sure It always Start with 1 GoTo 17 End If For sss = 1 To ncities + 1 If Sensitivity(sense, sss) = TopWires(d, sense) Then Sensitivity(sense, sss) = q End If Next sss Sensitivity(sense, swap - 1) = TopWires(d, sense) If swap = 2 Then Sensitivity(sense, ncities + 1) = Sensitivity(sense, 1) End If End If Next swap 17: Sensitivity(sense, 1) = Sensitivity(sense, ncities + 1) For z = 1 To ncities tempcity = Sensitivity(sense, z) tempcity1 = Sensitivity(sense, z + 1) 'Sheets(Sheetname).Cells(counterm + 3, z + 4) Tempcost = Tempcost + Worksheets("main").Cells(tempcity + 1, tempcity1 + 1).Value Next z '*****************************************'UPDATING BEST VALUE************************************** If Tempcost < Bestiteration Or Tempcost = Bestiteration Then Bestiteration = Tempcost For tr = 1 To ncities + 1 Worksheets("Compare").Cells(2, tr + 4) = Sensitivity(sense, tr) Worksheets("Duplicate").Cells(Count, tr + 4) = Sensitivity(sense, tr) Next tr Worksheets("compare").Cells(2, 4).Value = Tempcost Worksheets("Duplicate").Cells(Count, 4).Value = Tempcost Worksheets("compare").Cells(2, 3).Value = "Duplicate" Worksheets("Duplicate").Cells(Count, 3).Value = "Duplicate" Worksheets("Duplicate").Cells(Count, 1).Value = X Worksheets("Duplicate").Cells(Count, 2).Value = C
216
Count = Count + 1 End If Temparray(sense) = ((TopWires(d, ncities + 3) / ncities) * (1 - (((Volt / Bestwire) - (Volt / Tempcost)) / (Volt / Bestwire)) / 2)) sigma2 = sigma2 + Temparray(sense) counterm = counterm + 1 Next sense '***************************************' UPDATING PROBABILITY************************************** For a = 1 To ncities tempcity = TopWires(d, a) 'Tours(d, a) tempcity1 = TopWires(d, a + 1) 'Tours(d, a + 1) 'Tours(d, a+1) Ires(tempcity, tempcity1) = ((TopWires(d, ncities + 3) * Temparray(a) / sigma2) + Ires(tempcity, tempcity1)) / 4 Next a Next d '****************************************' End of Sensitivity Analysis*************************************** countercell = countercell + ncities + 2 countercellb = countercellb + trials + 2 counterx = counterx + 1 For we = 1 To trials For yu = 1 To ncities + 1 Tours(we, yu) = 0 Next yu Next we Next X '***************************************' End of Iteration**************************************************** Last = Time duration = Last - Start Sheets("random").Cells(17, 1).Value = duration End Sub
217
APPENDIX (A-IV): VBA Code for the TSP (Defined Start) Using Electimize (Modified Version)
Sub TSP_Defined_Start_Electimize_Modified_Algorithm() Dim Tours() As Double Dim TourCost() As Double Dim Probab() As Double Dim SelectionProb() As Double Dim Resist() As Double Dim Ires() As Double Dim Rworst() As Double Dim allcities() As Integer Dim best() As Double Dim worst() As Integer Dim Volt As Double Dim Intensity, Intensity1 As Double Dim Temparray() As Double Dim Temparray2() As Double Dim Temporrarycost() As Double Dim Tempcities() As Integer Dim Sensitivity() As Integer Dim TopWires() As Double 'icludes the cost Dim Secondry() As Integer Dim Arraybestiteration() As Integer Dim countermatrix() As Double Dim counterheat() As Integer Dim counterrandom() As Integer Dim IresCummMatrix() As Double Dim Area() As Double Dim Bestwire, Worstwire, bestiteration, Worstiteration As Double '********************Define Parameters Needed******************** msg = "How Many Iterations Do You Like to Generate ?" iterations = Int(Val(InputBox(msg, Title, ""))): If iterations = 0 Then End msg = "How Many Trials Do You like to Create ?" 'Wires' trials = Int(Val(InputBox(msg, Title, ""))): If trials = 0 Then End msg = "How Many Cities Are in the Tour ?" ncities = Int(Val(InputBox(msg, Title, ""))): If ncities = 0 Then End msg = "How Many Best Wires to Perform Sensitivity Analysis ?" Top = Int(Val(InputBox(msg, Title, ""))): If Top = 0 Then End msg = "How Many Worst Wires to Perform Sensitivity Analysis ?" bottom = Int(Val(InputBox(msg, Title, ""))): 'If bottom = 0 Then End Start = Time ABC = Time ReDim Tours(trials, ncities + 3) ReDim TourCost(iterations, trials) 'Intensity ReDim Probab(ncities, ncities) ReDim SelectionProb(ncities, ncities) ReDim Resist(iterations, trials)
218
ReDim Ires(ncities, ncities) ' Internal Resistance ReDim allcities(ncities) ReDim Rworst(iterations) Dim sumprob, WireCost As Double ReDim Tempcities(ncities, 4) ReDim best(ncities + 2) ReDim worst(ncities + 1) ReDim Sensitivity(ncities, ncities + 1) ReDim TopWires(Top + bottom, ncities + 4) 'Inclusdes the cost at the final cell and resistance ReDim Secondry(ncities, 5) ReDim Arraybestiteration(ncities + 2) ReDim countermatrix(ncities, ncities) ReDim counterheat(ncities, ncities) ReDim counterrandom(ncities, ncities) ReDim IresCummMatrix(ncities, ncities) ReDim Area(ncities, ncities) Dim least, maximum As Double Dim total1, toal2 As Single: total1 = 0 countercell = 1 'For sheets (probability0) and (probability) countercellb = 1 ' For sheets (Tours) and (wires) counterx = 2 'for sheets (bes), (wors), (compare) counterc = 1 'for tours() 'city = 1 Count = 1 'counter for sheets(Duplicate) bestiteration = 1E+54 'best wire in all iterations Worstiteration = 0 '********************Main Iteration Start Here (Evolution)******************** For i = 1 To ncities total1 = total1 + i sigma5 = 0 For j = 1 To ncities sigma5 = sigma5 + Worksheets("main").Cells(i + 1, j + 1).Value Ires(i, j) = 100 '000 '100000 countermatrix(i, j) = 0 counterrandom(i, j) = 10 Next j Ires(i, i) = 0 Ires(i, 1) = 0 'specifing zero probability for travelling from the same city to itself (zero diagonal) counterrandom(i, i) = 0 counterrandom(i, 1) = 0 For jjk = 1 To ncities If Worksheets("main").Cells(i + 1, jjk + 1).Value = 0 Then GoTo 78 Area(i, jjk) = sigma5 / Worksheets("main").Cells(i + 1, jjk + 1).Value 78: Next jjk Next i heat = 210 yaz = 10
219
zay = 1 For x = 1 To iterations Bestwire = 1E+52 'best wire among all wires in ONE iterations Worstwire = 0 AllwiresResistance = 0 For lm = 1 To Top TopWires(lm, ncities + 2) = 1000000000 + lm Next lm For ml = Top + 1 To Top + bottom TopWires(ml, ncities + 2) = 1 - ml Next ml ABC2 = Time EAB1 = ABC2 - ABC For i = 1 To ncities 'assignment of equal probability to all cities in the ROW 1 sigma = 0 For j = 1 To ncities sigma = sigma + (Ires(i, j)) Next j For jm = 1 To ncities Probab(i, jm) = (Ires(i, jm)) / sigma Next jm Probab(i, i) = 0 Probab(i, 1) = 0 Next i '*****************************************Wires Generation Starts Here********************************* For C = 1 To trials total2 = 0 least = 1 maximum = 1000000000 sigma = 0 counter = 1 WireCost = 0 For pp = 1 To ncities For tt = 1 To ncities SelectionProb(pp, tt) = Probab(pp, tt) Next tt Next pp Tours(C, 1) = 1 Tours(C, ncities + 1) = 1 city1 = 1 city = 1
220
Randomize Timer For i = 2 To ncities a = Rnd: sumprob = 0: hit = 0 30: For j = 2 To ncities If a >= sumprob And a < sumprob + SelectionProb(city, j) Then For tou = 1 To ncities SelectionProb(tou, j) = 0 Next tou For lou = 1 To ncities sigma = 0 For ree = 1 To ncities sigma = sigma + SelectionProb(lou, ree) Next ree For tre = 1 To ncities If sigma = 0 Then Exit For 'SelectionProb(lou, tre) = 0 Else SelectionProb(lou, tre) = SelectionProb(lou, tre) / sigma End If Next tre Next lou counter = counter + 1 WireCost = WireCost + Worksheets("main").Cells(city + 1, j + 1).Value hit = j city = j Tours(C, i) = city Exit For End If 20: sumprob = sumprob + SelectionProb(city, j) Next j If hit = 0 Then GoTo 30 Next i If counter < ncities Then GoTo 30 If counter = ncities Then WireCost = WireCost + Worksheets("main").Cells(city + 1, city1 + 1).Value End If TourCost(x, C) = WireCost Volt = Round(TourCost(1, 1) ^ 2.1, 3) ' G=2.1 Resist(x, C) = Round((Volt / TourCost(x, C)) / 1, 3) AllwiresResistance = AllwiresResistance + Resist(x, C) '***************************Selecting Top Best Wires for Sensitivity Analysis************** For Kop = 1 To Top
221
If least < TopWires(Kop, ncities + 2) Then least = TopWires(Kop, ncities + 2) ChangePosition = Kop End If Next Kop If TourCost(x, C) < least Then TopWires(ChangePosition, ncities + 2) = TourCost(x, C) TopWires(ChangePosition, ncities + 3) = Volt / TourCost(x, C) TopWires(ChangePosition, ncities + 4) = C For wop = 1 To ncities + 1 TopWires(ChangePosition, wop) = Tours(C, wop) Next wop End If '-----------------------Selecting Worst Wires------------------------------------------------- For cop = Top + 1 To Top + bottom If maximum > TopWires(cop, ncities + 2) Then maximum = TopWires(cop, ncities + 2) ChangePos = cop End If Next cop If TourCost(x, C) > maximum Then TopWires(ChangePos, ncities + 2) = TourCost(x, C) TopWires(ChangePos, ncities + 3) = Volt / TourCost(x, C) For wop = 1 To ncities + 1 TopWires(ChangePos, wop) = Tours(C, wop) Next wop End If '***************************End of Selecting Best Wires for Sensitivity Analysis************** If TourCost(x, C) < Bestwire Then Bestwire = TourCost(x, C) For cc = 1 To ncities + 1 best(cc) = Tours(C, cc) Next cc best(ncities + 2) = C End If If TourCost(x, C) > Worstwire Then Worstwire = TourCost(x, C) For cd = 1 To ncities + 1 worst(cd) = Tours(C, cd) Next cd End If counterc = counterc + 1 Tours(C, ncities + 2) = C Tours(C, ncities + 3) = WireCost Next C
222
'**********************************End of Wire Fabrication********************************** For NM = 1 To trials Resist(x, NM) = Resist(x, NM) * (Bestwire / TourCost(x, NM)) 'Reduction of Resistance Due to the Heat Effect (Continous Reduction) For ty = 1 To ncities IresCummMatrix(Tours(NM, ty), Tours(NM, ty + 1)) = (Resist(x, NM) / ncities) * Area(Tours(NM, ty), Tours(NM, ty + 1)) + IresCummMatrix(Tours(NM, ty), Tours(NM, ty + 1)) / 1 '/ (30 + x) ' 55 ' (iterations + 1 - X) countermatrix(Tours(NM, ty), Tours(NM, ty + 1)) = countermatrix(Tours(NM, ty), Tours(NM, ty + 1)) + 1 counterheat(Tours(NM, ty), Tours(NM, ty + 1)) = counterheat(Tours(NM, ty), Tours(NM, ty + 1)) + 1 Next ty Next NM For NM = 1 To trials For ty = 1 To ncities ' Initial Calculation of Local Resistance Ires(Tours(NM, ty), Tours(NM, ty + 1)) = Resist(x, NM) / ncities * Area(Tours(NM, ty), Tours(NM, ty + 1)) + Ires(Tours(NM, ty), Tours(NM, ty + 1)) Ires(ty, ty) = 0 Ires(ty, 1) = 0 Next ty Next NM If Bestwire < bestiteration Then 'Storing best value and best wire identified bestiteration = Bestwire For Lmk = 1 To ncities + 1 Arraybestiteration(Lmk) = best(Lmk) Next Lmk ElseIf Bestwire = bestiteration Then bestiteration = Bestwire For Lmk = 1 To ncities + 1 Arraybestiteration(Lmk) = best(Lmk) Next Lmk End If If Worstwire > Worstiteration Then 'Storing worst value and best wire identified Worstiteration = Worstwire End If '*****************************************'SENSETIVITY ANALYSIS******************************** ReDim Temparray(ncities) ReDim Temparray2(ncities) ReDim Temporrarycost(ncities) Dim sigma2 As Double Dim q As Integer counterm = 1
223
For d = 1 To Top + bottom sigma2 = 0 For sense = 1 To ncities For bg = 1 To ncities + 1 ' Specifying the Type of Control Wire to Use throughout the iterations If x > 189 Then Sensitivity(sense, bg) = Arraybestiteration(bg) ElseIf x > 0 And x < 190 Then Sensitivity(sense, bg) = best(bg) End If Next bg Tempcost = 0 For swap = 2 To ncities + 1 If TopWires(d, sense) = 1 Then ' ADDED to MAKE Sure It always Start with 1 Pot = Sensitivity(sense, swap) For dod = 1 To ncities + 1 If Sensitivity(sense, dod) = TopWires(d, sense + 1) Then Sensitivity(sense, dod) = Pot Secondry(sense, 1) = Sensitivity(sense, dod - 1) Secondry(sense, 2) = Pot toll = dod Exit For End If Next dod Sensitivity(sense, swap) = TopWires(d, sense + 1) Sensitivity(sense, ncities + 1) = Sensitivity(sense, 1) Secondry(sense, 3) = Sensitivity(sense, toll + 1) Secondry(sense, 4) = Sensitivity(sense, swap) Secondry(sense, 5) = Sensitivity(sense, swap + 1) GoTo 17 ElseIf Sensitivity(sense, swap) = TopWires(d, sense + 1) Then q = Sensitivity(sense, swap - 1) 'Original value to be replaced If q = 1 Then 'ADDED to MAKE Sure It always Start with 1 Secondry(sense, 1) = 1 Secondry(sense, 2) = 1 Secondry(sense, 3) = 1 Secondry(sense, 4) = 1 Secondry(sense, 5) = 1 GoTo 17 End If For sss = 1 To ncities + 1 If Sensitivity(sense, sss) = TopWires(d, sense) Then Sensitivity(sense, sss) = q Secondry(sense, 1) = Sensitivity(sense, sss - 1)
224
Secondry(sense, 2) = q toll = sss End If Next sss Sensitivity(sense, swap - 1) = TopWires(d, sense) Secondry(sense, 3) = Sensitivity(sense, toll + 1) Secondry(sense, 4) = Sensitivity(sense, swap - 2) 'TopWires(d, sense - 1) Secondry(sense, 5) = TopWires(d, sense) End If Next swap 17: Sensitivity(sense, 1) = Sensitivity(sense, ncities + 1) For z = 1 To ncities tempcity = Sensitivity(sense, z) tempcity1 = Sensitivity(sense, z + 1) Tempcost = Tempcost + Worksheets("main").Cells(tempcity + 1, tempcity1 + 1).Value Next z Temporrarycost(sense) = Tempcost '*****************************************'UPDATING BEST VALUE************************************** If Tempcost < bestiteration Or Tempcost <= 33522 Then bestiteration = Tempcost For opt = 1 To ncities + 1 Arraybestiteration(opt) = Sensitivity(sense, opt) Next opt Arraybestiteration(ncities + 2) = 1980 For tr = 1 To ncities + 1 Worksheets("Duplicate").Cells(Count, tr + 4) = Sensitivity(sense, tr) Next tr Worksheets("Duplicate").Cells(Count, 4).Value = Tempcost Worksheets("Duplicate").Cells(Count, 1).Value = x Count = Count + 1 End If If x > 189 Then 'Calculating Sigma for Normalizing Probabilities After Resistance Update Temparray(sense) = Round(((TopWires(d, ncities + 3) / ncities) * Bestwire / TopWires(d, ncities + 2) * (1 - (((Volt / bestiteration) - (Volt / Tempcost)) / (Volt / bestiteration)) / 1)), 4) ElseIf x > 0 And x < 190 Then Temparray(sense) = Round(((TopWires(d, ncities + 3) / ncities) * Bestwire / TopWires(d, ncities + 2) * (1 - (((Volt / Bestwire) - (Volt / Tempcost)) / (Volt / Bestwire)) / 1)), 4) End If sigma2 = sigma2 + Temparray(sense) counterm = counterm + 1 Next sense
225
'**************************************' UPDATING PROBABILITY************************************** For a = 1 To ncities tempcity = TopWires(d, a) 'Tours(d, a) tempcity1 = TopWires(d, a + 1) 'Tours(d, a + 1) 'Tours(d, a+1) If x > 189 Then ' Updating resistance for the four relationships changed in the tour Ires(tempcity, tempcity1) = Ires(tempcity, tempcity1) + (TopWires(d, ncities + 3) * (Bestwire / TopWires(d, ncities + 2)) * Temparray(a) / sigma2) * Area(tempcity, tempcity1) - (TopWires(d, ncities + 3) * (Bestwire / TopWires(d, ncities + 2)) / ncities) * Area(tempcity, tempcity1) If Secondry(a, 1) = Secondry(a, 2) Then GoTo 79 ElseIf Secondry(a, 2) = Secondry(a, 3) Then GoTo 79 ElseIf Secondry(a, 4) = Secondry(a, 5) Then GoTo 79 End If Ires(Secondry(a, 1), Secondry(a, 2)) = Ires(Secondry(a, 1), Secondry(a, 2)) + Volt / Temporrarycost(a) / ncities * Area(Secondry(a, 1), Secondry(a, 2)) - ((Volt / bestiteration) / ncities) * Area(Secondry(a, 1), Secondry(a, 2)) Ires(Secondry(a, 2), Secondry(a, 3)) = Ires(Secondry(a, 2), Secondry(a, 3)) + Volt / Temporrarycost(a) / ncities * Area(Secondry(a, 2), Secondry(a, 3)) - ((Volt / bestiteration) / ncities) * Area(Secondry(a, 2), Secondry(a, 3)) Ires(Secondry(a, 4), Secondry(a, 5)) = Ires(Secondry(a, 4), Secondry(a, 5)) + Volt / Temporrarycost(a) / ncities * Area(Secondry(a, 4), Secondry(a, 5)) - ((Volt / bestiteration) / ncities) * Area(Secondry(a, 4), Secondry(a, 5)) 79: ElseIf x > 0 And x < 190 Then 'Same Update Using Different Control Wire Ires(tempcity, tempcity1) = Ires(tempcity, tempcity1) + (TopWires(d, ncities + 3) * (Bestwire / TopWires(d, ncities + 2) * Temparray(a) / sigma2) * Area(tempcity, tempcity1) - TopWires(d, ncities + 3) * (Bestwire / TopWires(d, ncities + 2)) / ncities) * Area(tempcity, tempcity1) If Secondry(a, 1) = Secondry(a, 2) Then GoTo 790 ElseIf Secondry(a, 2) = Secondry(a, 3) Then GoTo 790 ElseIf Secondry(a, 4) = Secondry(a, 5) Then GoTo 790 End If Ires(Secondry(a, 1), Secondry(a, 2)) = Ires(Secondry(a, 1), Secondry(a, 2)) + Volt / Temporrarycost(a) / ncities * Area(Secondry(a, 1), Secondry(a, 2)) - ((Volt / Bestwire) / ncities) * Area(Secondry(a, 1), Secondry(a, 2)) Ires(Secondry(a, 2), Secondry(a, 3)) = Ires(Secondry(a, 2), Secondry(a, 3)) + Volt / Temporrarycost(a) / ncities * Area(Secondry(a, 2), Secondry(a, 3)) - ((Volt / Bestwire) / ncities) * Area(Secondry(a, 2), Secondry(a, 3)) Ires(Secondry(a, 4), Secondry(a, 5)) = Ires(Secondry(a, 4), Secondry(a, 5)) + Volt / Temporrarycost(a) / ncities * Area(Secondry(a, 4), Secondry(a, 5)) - ((Volt / Bestwire) / ncities) * Area(Secondry(a, 4), Secondry(a, 5)) 790: End If Next a
226
Next d '***************************************' End of Sensitivity Analysis*************************************** countercell = countercell + ncities + 2 countercellb = countercellb + trials + 2 counterx = counterx + 1 For gg = 1 To ncities For Pe = 1 To 5 Secondry(gg, Pe) = 1 Next Pe Next gg Worksheets("compare").Cells(1, 12) = x ActiveWorkbook.Save Sheets("compare").Cells(yaz, zay).Value = bestiteration zay = zay + 1 If zay = 22 Then yaz = yaz + 1 zay = 1 End If '***********************************' Applying Heat Factor (Periodic Reduction)************************** For fg = 1 To ncities For gh = 1 To ncities If counterheat(fg, gh) > 10000 Then Ires(fg, gh) = Ires(fg, gh) * 0.4 'MsgBox (Ires(fg, gh)) counterheat(fg, gh) = 0 End If ' Next gh Next fg For we = 1 To trials 'Disassembling Wires For yu = 1 To ncities + 1 Tours(we, yu) = 0 Next yu Next we Next x '******************************************' End of Iteration*************************************** Last = Time 'Storing Data in Excel Sheets duration = Last - Start Sheets("random").Cells(17, 1).Value = duration Sheets("compare").Cells(1, 1).Value = bestiteration For tyu = 1 To ncities + 2 Worksheets("compare").Cells(4, tyu + 3) = Arraybestiteration(tyu) Next tyu ActiveWorkbook.Save End Sub
227
APPENDIX (A-V): VBA Code for the TCTP Using Electimize (Modified Version)
Public nDurDivisor As Integer Public mnDefDurUnits As Integer Sub TCT_Electimize_Modified() Dim Wires() As Double Dim WireValue() As Double Dim Probab() As Double Dim SelectionProb() As Double Dim Resist() As Double Dim Ires() As Double Dim best() As Double Dim worst() As Integer Dim Volt As Double Dim Intensity, Intensity1 As Double Dim Temparray() As Double Dim Temparray2() As Double Dim Temporrarycost() As Double Dim Sensitivity() As Integer Dim TopWires() As Double 'icludes the cost Dim Arraybestiteration() As Integer Dim countermatrix() As Double Dim counterheat() As Integer Dim counterrandom() As Integer Dim IresCummMatrix() As Double Dim Area() As Double Dim options() As Integer Dim BestWire, Worstwire, bestiteration, Worstiteration As Double Dim Secondry() As Integer Dim ntasks, NumberofIterations As Integer Dim otask As Object '***********************************Define Parameters of Excel Sheets********************************** Dim xlapp As Object Set xlapp = CreateObject("excel.application") FileName = "G:\E-Documents\Research\TCT\recorder.xls" '"c:\Ahuja.xls" xlapp.Application.DisplayAlerts = False xlapp.Application.Workbooks.Open FileName xlapp.Application.Visible = True '**************************************Define Parameters Needed**************************************** msg = "How Many Iterations Do You Like to Generate ?" Iterations = Int(Val(InputBox(msg, title, ""))): If Iterations = 0 Then End msg = "How Many Trials Do You like to Create ?" 'Wires' trials = Int(Val(InputBox(msg, title, ""))): If trials = 0 Then End msg = "How Many Activities Are in the Tour ?" ntasks = Int(Val(InputBox(msg, title, ""))): If ntasks = 0 Then End msg = "How Many Best Wires to Perform Sensitivity Analysis ?" Top = Int(Val(InputBox(msg, title, ""))): If Top = 0 Then End msg = "How Many Worst Wires to Perform Sensitivity Analysis ?"
228
bottom = Int(Val(InputBox(msg, title, ""))): 'If bottom = 0 Then End msg = "What is the desired minimum duration (days) ?" deadline = Int(Val(InputBox(msg, title, "110"))): If deadline = 0 Then End msg = "What is the total indirect cost per day ($) ?" indirect = Int(Val(InputBox(msg, title, "500"))) msg = "What is the Daily Penalty for exceeding the deadline ($) ?" penalty = Int(Val(InputBox(msg, title, "0"))) msg = "What is the Daily Incentive for speedy construction ($) ?" incentive = Int(Val(InputBox(msg, title, "0"))) ntasks = ActiveProject.Tasks.count start = Time ABC = Time ReDim Wires(trials, ntasks + 3) ReDim WireValue(Iterations, trials) 'Wire cost = Intensity ReDim Probab(ntasks, 5) ReDim SelectionProb(ntasks, 5) ReDim Resist(Iterations, trials) ReDim Ires(ntasks, 5) ' Internal Resistance Dim sumprob, WireCost As Double ReDim best(ntasks + 2) ReDim worst(ntasks + 1) ReDim Sensitivity(ntasks, ntasks) ReDim TopWires(Top + bottom, ntasks + 4) 'Inclusdes the cost at the final cell and resistance ReDim Arraybestiteration(ntasks + 2) ReDim countermatrix(ntasks, 5) ReDim counterheat(ntasks, 5) ReDim counterrandom(ntasks, 5) ReDim IresCummMatrix(ntasks, 5) ReDim Area(ntasks, 5) ReDim options(ntasks) As Integer ReDim Secondry(ncities, 5) Dim least, maximum, a, ACost, ATime As Double Dim total1, toal2 As Single: total1 = 0 countercell = 1 'For sheets (probability0) and (probability) countercellb = 1 ' For sheets (Wires) and (wires) counterx = 2 'for sheets (bes), (wors), (compare) counterc = 1 'for Wires() 'city = 1 count = 1 'counter for sheets(Duplicate) bestiteration = 1E+54 'best wire in all iterations Worstiteration = 0 '****************************Preparing Excel Sheet to Record Data ************************************** NumberofIterations = Iterations xlapp.Workbooks("recorder.xls").Worksheets("record").Cells(7, 7).Value = Iterations xlapp.Workbooks("recorder.xls").Worksheets("record").Cells(7, 8).Value = trials xlapp.Workbooks("recorder.xls").Worksheets("record").Cells(7, 9).Value = ntasks
229
xlapp.Workbooks("recorder.xls").Worksheets("record").Cells(7, 10).Value = Top xlapp.Workbooks("recorder.xls").Worksheets("record").Cells(7, 11).Value = bottom mnDefDurUnits = ActiveProject.DefaultDurationUnits nDurDivisor = GetDurDivisor() For Each otask In ActiveProject.Tasks 'Counting methods of construction for each task For K = 1 To 5 Call get_field_id(K * 2 - 1) If Val(otask.GetField(FieldID:=field_no)) > 0 Then counter = counter + 1 options(otask) = counter Else Exit For End If Next K counter = 0 Next otask For i = 1 To ntasks 'Assignment of initial resistance Ires sigma5 = 0 For j = 1 To options(i) Call get_field_id(j * 2) ACost = (Val(ActiveProject.Tasks(i).GetField(FieldID:=field_no))) Call get_field_id(j * 2 - 1) 'Time ATime = (Val(ActiveProject.Tasks(i).GetField(FieldID:=field_no))) sigma5 = sigma5 + ACost / ATime Ires(i, j) = 1000 '50000 '100 '000 '100000 Next j For jjk = 1 To options(i) 'Area calculations Call get_field_id(jjk * 2) 'Cost ACost = (Val(ActiveProject.Tasks(i).GetField(FieldID:=field_no))) Call get_field_id(jjk * 2 - 1) 'Time ATime = (Val(ActiveProject.Tasks(i).GetField(FieldID:=field_no))) Area(i, jjk) = ACost / ATime / sigma5 '1 'sigma5 / (Val(ActiveProject.Tasks(i).GetField(FieldID:=field_no))) Next jjk Next i yaz = 10 zay = 1 Tempcounter = 1 '**************************************EVOLUTION STARTS HERE************************************** For x = 1 To Iterations BestWire = 1E+52 'best wire among all wires in ONE iterations Worstwire = 0 For lm = 1 To Top TopWires(lm, ntasks + 2) = 1000000000 + lm Next lm For ml = Top + 1 To Top + bottom
230
TopWires(ml, ntasks + 2) = 1 - ml Next ml For i = 1 To ntasks 'assignment of equal probability to all options of the same activity sigma = 0 xlapp.Workbooks("recorder.xls").Worksheets("Probability").Cells(Tempcounter + i, 1).Value = i For j = 1 To options(i) Ires(i, j) = Ires(i, j) '* Area(i, j) sigma = sigma + Ires(i, j) Next j For jm = 1 To options(i) Probab(i, jm) = Ires(i, jm) / sigma xlapp.Workbooks("recorder.xls").Worksheets("Probability").Cells(Tempcounter + i, jm + 1).Value = Probab(i, jm) xlapp.Workbooks("recorder.xls").Worksheets("Probability").Cells(Tempcounter, jm + 1).Value = jm Next jm Next i Tempcounter = Tempcounter + 19 '**************************************Wires Generation Starts Here************************************** For c = 1 To trials least = 1 maximum = 1000000000 sigma = 0 counter = 1 WireCost = 0 directcost = 0 Randomize Timer For i = 1 To ntasks a = Rnd: sumprob = 0 For j = 1 To options(i) If a >= sumprob And a < sumprob + Probab(i, j) Then Call get_field_id(j * 2) 'Cost 'MsgBox ((Val(ActiveProject.Tasks(i).GetField(FieldID:=field_no)))) directcost = directcost + (Val(ActiveProject.Tasks(i).GetField(FieldID:=field_no))) Wires(c, i) = j Exit For End If sumprob = sumprob + Probab(i, j) Next j Next i For oi = 1 To ntasks Call get_field_id(Wires(c, oi) * 2 - 1) taskduration = Val(ActiveProject.Tasks(oi).GetField(FieldID:=field_no)) * GetDurDivisor ActiveProject.Tasks(oi).duration = taskduration Next oi 'MsgBox ("a" & ActiveProject.duration \ GetDurDivisor)
231
WireCost = directcost + indirect * ActiveProject.duration \ GetDurDivisor 'MsgBox (WireCost) WireValue(x, c) = WireCost Volt = Round(WireValue(1, 1) ^ 1.2, 3) '- Round(WireValue(1, 1), 3) ' ' Resist(x, c) = Round((Volt / WireValue(x, c)) / 1, 3) '/ (30 + x) '55(iterations + 1 - X) '---------------------------------------------Selecting Top Best------------------------------- For Kop = 1 To Top If least < TopWires(Kop, ntasks + 2) Then least = TopWires(Kop, ntasks + 2) ChangePosition = Kop End If Next Kop If WireValue(x, c) < least Then TopWires(ChangePosition, ntasks + 2) = WireValue(x, c) TopWires(ChangePosition, ntasks + 3) = Volt / WireValue(x, c) TopWires(ChangePosition, ntasks + 4) = c For wop = 1 To ntasks + 1 TopWires(ChangePosition, wop) = Wires(c, wop) Next wop End If '---------------------------------------------------------Selecting Worst Wires------------------------------- For cop = Top + 1 To Top + bottom If maximum > TopWires(cop, ntasks + 2) Then maximum = TopWires(cop, ntasks + 2) ChangePos = cop End If Next cop If WireValue(x, c) > maximum Then TopWires(ChangePos, ntasks + 2) = WireValue(x, c) TopWires(ChangePos, ntasks + 3) = Volt / WireValue(x, c) For wop = 1 To ntasks + 1 TopWires(ChangePos, wop) = Wires(c, wop) Next wop End If '---------------------------------------------End of Selecting Top Best------------------------------- If WireValue(x, c) < BestWire Then BestWire = WireValue(x, c) For cc = 1 To ntasks + 1 best(cc) = Wires(c, cc) xlapp.Workbooks("recorder.xls").Worksheets("best").Cells(counterx + 1, cc + 4).Value = Wires(c, cc) Next cc best(ntasks + 2) = c xlapp.Workbooks("recorder.xls").Worksheets("best").Cells(counterx + 1, cc).Value = x xlapp.Workbooks("recorder.xls").Worksheets("best").Cells(counterx + 1, cc + 1).Value = c xlapp.Workbooks("recorder.xls").Worksheets("best").Cells(counterx + 1, cc + 2).Value = BestWire End If If WireValue(x, c) > Worstwire Then Worstwire = WireValue(x, c)
232
For cd = 1 To ntasks + 1 worst(cd) = Wires(c, cd) xlapp.Workbooks("recorder.xls").Worksheets("worst").Cells(counterx + 1, cd + 4).Value = Wires(c, cd) Next cd xlapp.Workbooks("recorder.xls").Worksheets("worst").Cells(counterx + 1, cd).Value = x xlapp.Workbooks("recorder.xls").Worksheets("worst").Cells(counterx + 1, cd + 1).Value = c xlapp.Workbooks("recorder.xls").Worksheets("worst").Cells(counterx + 1, cd + 2).Value = Worstwire End If counterc = counterc + 1 Wires(c, ntasks + 2) = c Wires(c, ntasks + 3) = WireCost Next c '*******************************************End of Wires Generation ************************************** For NM = 1 To trials Resist(x, NM) = Resist(x, NM) * (BestWire / WireValue(x, NM)) ' Continous Reduction of Resistance Due to Heat Next NM For NM = 1 To trials ' Initial Calculation of Local Resistance (Rlm) For ty = 1 To ntasks Ires(ty, Wires(NM, ty)) = Resist(x, NM) * Area(ty, Wires(NM, ty)) / ntasks + Ires(ty, Wires(NM, ty)) counterheat(ty, Wires(NM, ty)) = counterheat(ty, Wires(NM, ty)) + 1 Next ty Next NM If BestWire < bestiteration Then bestiteration = BestWire xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(2, 1).Value = x xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(2, 2).Value = c xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(2, 3).Value = bestiteration For lmk = 1 To ntasks Arraybestiteration(lmk) = best(lmk) xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(2, lmk + 5) = best(lmk) Next lmk xlapp.Workbooks("recorder.xls").Worksheets("compare").Cells(2, 4).Value = "Best" ElseIf BestWire = bestiteration Then bestiteration = BestWire xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(4, 1).Value = x xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(4, 2).Value = c For sd = 1 To ntasks Arraybestiteration(sd) = best(sd) xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(4, sd + 4) = best(sd) Next sd xlapp.Workbooks("recorder.xls").Worksheets("compare").Cells(4, 3).Value = "copyBest"
233
xlapp.Workbooks("recorder.xls").Worksheets("compare").Cells(4, 4).Value = BestWire End If If Worstwire > Worstiteration Then Worstiteration = Worstwire xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(3, 1).Value = x xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(3, 2).Value = c xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(3, 3).Value = Worstiteration For sm = 1 To ntasks + 1 xlapp.Workbooks("recorder.xls").Worksheets("Compare").Cells(4, sm + 5) = worst(sm) Next sm xlapp.Workbooks("recorder.xls").Worksheets("compare").Cells(3, 4).Value = "Worst" End If '*******************************************'SENSETIVITY ANALYSIS******************************* ReDim Temparray(ntasks) ReDim Temparray2(ntasks) ReDim Temporrarycost(ntasks) Dim sigma2, Tempcost, Tempdirectcost As Double 'Dim Sheetname As String Dim q As Integer counterm = 1 For D = 1 To Top + bottom 'Selecting Topwires sigma2 = 0 For sense = 1 To ntasks 'Selecting first Task in the Topwires Tempcost = 0 Tempdirectcost = 0 For bg = 1 To ntasks 'This loop to select the control wire (comparison wire) If x > Round(NumberofIterations - NumberofIterations * 0.1 - 1, 0) Then Sensitivity(sense, bg) = Arraybestiteration(bg) ElseIf x > 0 And x < Round(NumberofIterations * 0.9, 0) Then Sensitivity(sense, bg) = best(bg) End If Next bg Sensitivity(sense, sense) = TopWires(D, sense) 'Substituting the options of the Top wire in the Control Wire For z = 1 To ntasks ' Calculating Cost Call get_field_id(Sensitivity(sense, z) * 2) Tempdirectcost = Tempdirectcost + (Val(ActiveProject.Tasks(z).GetField(FieldID:=field_no))) Call get_field_id(Sensitivity(sense, z) * 2 - 1)
234
taskduration = Val(ActiveProject.Tasks(z).GetField(FieldID:=field_no)) * GetDurDivisor ActiveProject.Tasks(z).duration = taskduration Next z Tempcost = Tempdirectcost + indirect * ActiveProject.duration \ GetDurDivisor Temporrarycost(sense) = Tempcost ' **************************************** UPDATING BEST VALUE********************************* If Tempcost < bestiteration Or Tempcost <= 161270 Then bestiteration = Tempcost For opt = 1 To ntasks Arraybestiteration(opt) = Sensitivity(sense, opt) Next opt Arraybestiteration(ntasks + 2) = 1980 xlapp.Workbooks("recorder.xls").Worksheets("Duplicate").Cells(count, tr + 4) = Sensitivity(sense, tr) Next tr xlapp.Workbooks("recorder.xls").Worksheets("Duplicate").Cells(count, 4).Value = Tempcost xlapp.Workbooks("recorder.xls").Worksheets("Duplicate").Cells(count, 1).Value = x count = count + 1 End If ' *********************************** Calculating Sigma Rsistance r*lm ********************************* If x > Round(NumberofIterations - NumberofIterations * 0.1 - 1, 0) Then Temparray(sense) = Round(((TopWires(D, ntasks + 3) / ntasks) * BestWire / TopWires(D, ntasks + 2) * (1 - (((Volt / bestiteration) - (Volt / Tempcost)) / (Volt / bestiteration)) / 1)), 4) ElseIf x > 0 And x < Round(NumberofIterations * 0.9, 0) Then Temparray(sense) = Round(((TopWires(D, ntasks + 3) / ntasks) * BestWire / TopWires(D, ntasks + 2) * (1 - (((Volt / BestWire) - (Volt / Tempcost)) / (Volt / BestWire)) / 1)), 4) End If sigma2 = sigma2 + Temparray(sense) counterm = counterm + 1 Next sense ' **************************************** UPDATING Resistance r^lm********************************* For a = 1 To ntasks Ires(a, TopWires(D, a)) = Ires(a, TopWires(D, a)) + (TopWires(D, ntasks + 3) * (BestWire / TopWires(D, ntasks + 2)) * Temparray(a) / sigma2) * Area(a, TopWires(D, a)) - (TopWires(D, ntasks + 3) * (BestWire / TopWires(D, ntasks + 2)) / ntasks) * Area(a, TopWires(D, a)) Next a Next D ' **************************************** End of Sensitivity Analysis********************************* countercell = countercell + ntasks + 2 countercellb = countercellb + trials + 2 counterx = counterx + 1 xlapp.Workbooks("recorder.xls").Worksheets("record").Cells(1, 12) = x xlapp.Workbooks("recorder.xls").Worksheets("record").Cells(yaz, zay).Value = bestiteration zay = zay + 1
235
If zay = 22 Then yaz = yaz + 1 zay = 1 End If For fg = 1 To ntasks 'Accounting for heat effect due to overuse of parts (Periodic Heat Effect)( For gh = 1 To options(fg) If counterheat(fg, gh) > 200 Then Ires(fg, gh) = Ires(fg, gh) * 0.6 ' Heat Factor =0.6 counterheat(fg, gh) = 0 End If ' Next gh Next fg For we = 1 To trials For yu = 1 To ntasks + 1 Wires(we, yu) = 0 Next yu Next we Next x ' **************************************** End of Iteration********************************* last = Time duration = last - start xlapp.Workbooks("recorder.xls").Worksheets("random").Cells(17, 1).Value = duration xlapp.Workbooks("recorder.xls").Worksheets("record").Cells(1, 1).Value = bestiteration For tyu = 1 To ntasks + 2 xlapp.Workbooks("recorder.xls").Worksheets("compare").Cells(4, tyu + 3) = Arraybestiteration(tyu) Next tyu xlapp.Workbooks("recorder.xls").Save End Sub ************************* Function to retrieve data stored in MS Project ********************************* Sub get_field_id(nof) Select Case nof Case 1 field_no = pjTaskText1 Case 2 field_no = pjTaskText2 Case 3 field_no = pjTaskText3 Case 4 field_no = pjTaskText4 Case 5 field_no = pjTaskText5 Case 6 field_no = pjTaskText6 Case 7 field_no = pjTaskText7
236
Case 8 field_no = pjTaskText8 Case 9 field_no = pjTaskText9 Case 10 field_no = pjTaskText10 End Select End Sub ******************************* Function to convert time used by MS project***************************** Private Function GetDurDivisor() As Integer Select Case mnDefDurUnits Case pjMinute '0 minutes GetDurDivisor = 1 Case pjHour '1 hours GetDurDivisor = 60 Case pjDay '2 days GetDurDivisor = ActiveProject.HoursPerDay * 60 Case pjWeek '3 weeks GetDurDivisor = ActiveProject.HoursPerWeek * 60 End Select End Function
237
APPENDIX (A-VI): VBA Code for the SLPP Using Electimize (Modified Version)
Public Availabilitymatrix() As Integer Public SitePlan() As Integer Public info() As Integer Public Wires() As Double Public WireValue() As Double Public centroids() As Double Public nfacilities, nrows, ncolumns As Integer Public Iterations, trials, C, X As Integer Sub SiteLayout_Electimize_Modified() Dim centroids() As Double Dim Probab() As Double Dim SelectionProb() As Double Dim Resist() As Double Dim Ires() As Double Dim best() As Double Dim worst() As Integer Dim Temparray() As Double Dim Temporrarycost() As Double Dim Sensitivity() As Integer Dim TopWires() As Double 'icludes the cost Dim Secondry() As Integer Dim Arraybestiteration() As Integer Dim counterheat() As Integer Dim Area() As Double Dim FacilityWidth() As Integer Dim FacilityLength() As Integer Dim Bestwire, Worstwire, bestiteration, Worstiteration As Double Dim ncells, Iterations As Integer Dim Intensity, Intensity1 As Double Dim Volt As Double Dim sumprob, WireCost As Double Dim least, maximum As Double Dim total1, toal2 As Single: total1 = 0 Dim Tr, TTr As Integer '***************************************Definition of Parameters ******************************************* ncells = 255 nfacilities = 8 nrows = 17 ncolumns = 15 countercell = 1 'For sheets (probability0) and (probability) countercellb = 1 ' For sheets (wires) and (wires) counterx = 2 'for sheets (bes), (wors), (compare) counterc = 1 'for wires() Count = 1 'counter for sheets(Duplicate) bestiteration = 1E+54 'best wire in all iterations
238
Worstiteration = 0 msg = "How Many Iterations Do You Like to Generate ?" Iterations = Int(Val(InputBox(msg, Title, ""))): If Iterations = 0 Then End msg = "How Many Trials Do You like to Create ?" 'Wires' trials = Int(Val(InputBox(msg, Title, ""))): If trials = 0 Then End 'msg = "How Many Facilities Are in the Tour ?" 'nFacilities = Int(Val(InputBox(msg, Title, ""))): If nfacilities = 0 Then End msg = "How Many Best Wires to Perform Sensitivity Analysis ?" Top = Int(Val(InputBox(msg, Title, ""))): If Top = 0 Then End msg = "How Many Worst Wires to Perform Sensitivity Analysis ?" bottom = Int(Val(InputBox(msg, Title, ""))): 'If bottom = 0 Then End Start = Time ReDim Wires(trials, nfacilities + 3) ReDim WireValue(Iterations, trials) 'Intensity ReDim Probab(nfacilities, ncells) ReDim SelectionProb(nfacilities, ncells) ReDim Resist(Iterations, trials) ReDim Ires(nfacilities, ncells) ' Internal Resistance ReDim Tempcities(nfacilities, 4) ReDim best(nfacilities + 2) ReDim worst(nfacilities + 1) ReDim Sensitivity(nfacilities, nfacilities + 2) ReDim TopWires(Top + bottom, nfacilities + 4) 'Inclusdes the cost at the final cell and resistance ReDim Secondry(nfacilities, 5) ReDim Arraybestiteration(nfacilities + 2) ReDim counterheat(nfacilities, ncells) ReDim Area(nfacilities, ncells) ReDim FacilityWidth(nfacilities) ReDim FacilityLength(nfacilities) ReDim Availabilitymatrix(nfacilities, ncells) ReDim SitePlan(nrows, ncolumns) ReDim info(nfacilities, 2) ReDim centroids(nfacilities + 9, 2) '*******************************Retrieving Data Stored in Excel Sheets*********************************** For it = 9 To 17 centroids(it, 1) = Worksheets("info").Cells(it + 1, 10) centroids(it, 2) = Worksheets("info").Cells(it + 1, 11) Next it For i = 1 To nfacilities info(i, 1) = Worksheets("info").Cells(i + 1, 7) 'Width info(i, 2) = Worksheets("info").Cells(i + 1, 8) 'Length For j = 1 To ncells If Worksheets("availability").Cells(i + 1, j + 1) = 0 Then Ires(i, j) = 0 Else
239
Ires(i, j) = 100 ' 50000 '100 '000 '100000 End If Next j For jjk = 1 To ncells Area(i, jjk) = 1 ' sigma5 / Worksheets("main").Cells(i + 1, jjk + 1).Value '/ 100 Next jjk Next i yaz = 10 zay = 1 '*********************************************Iterations Start Here ***************************************** For X = 1 To Iterations Bestwire = 1E+52 'best wire among all wires in ONE iterations Worstwire = 0 For LM = 1 To Top TopWires(LM, nfacilities + 2) = 1000000000 + LM Next LM For ml = Top + 1 To Top + bottom TopWires(ml, nfacilities + 2) = 1 - ml Next ml For i = 1 To nfacilities 'Calculation of SELECTION PROBABILITY of the location of a Facility sigma = 0 For j = 1 To ncells sigma = sigma + (Ires(i, j)) Next j For jm = 1 To ncells Probab(i, jm) = (Ires(i, jm)) / sigma Next jm Next i '========================= Wires Fabrication Starts Here ======================== For C = 1 To trials least = 1 maximum = 1000000000 sigma = 0 Cost = 0 For PP = 1 To nfacilities For TT = 1 To ncells SelectionProb(PP, TT) = Probab(PP, TT) Availabilitymatrix(PP, TT) = Worksheets("availability").Cells(PP + 1, TT + 1) Next TT Next PP For ia = 1 To nrows For ja = 1 To ncolumns SitePlan(ia, ja) = Worksheets("plan").Cells(ia + 4, ja + 4) Next ja
240
Next ia Randomize Timer For i = 1 To nfacilities a = Rnd: sumprob = 0: hit = 0 30: For j = 1 To ncells If a >= sumprob And a < sumprob + SelectionProb(i, j) Then '****Placing the selected Facility on the Site Plan***** Frow = Int(j / ncolumns) + 1 'row position Fcolumn = j - Int(j / ncolumns) * ncolumns 'column position For ib = 1 To info(i, 1) ' width For jb = 1 To info(i, 2) ' length SitePlan(Frow + jb - 1, Fcolumn + ib - 1) = i '* 10 Next jb Next ib '*************************End******************** For ir = 1 To nfacilities For jr = 1 To nrows For kr = 1 To ncolumns If SitePlan(jr, kr) > 0 Then '******Checking Position of Fisxed Facilities Availabilitymatrix(ir, (jr - 1) * ncolumns + kr) = 0 Else: Availabilitymatrix(ir, (jr - 1) * ncolumns + kr) = 1 End If For Tr = 1 To info(ir, 1) '********Checking if the Width would interfere with any fixed facility For TTr = 1 To info(ir, 2) '********Checking if the Length would interfere with any fixed facility If jr + TTr - 1 > 17 Or kr + Tr - 1 > 15 Then GoTo 90 If SitePlan(jr + TTr - 1, kr + Tr - 1) > 0 Then Availabilitymatrix(ir, (jr - 1) * ncolumns + kr) = 0 End If 90: Next TTr Next Tr Next kr Next jr Next ir '--------------------------------------------------------------- For tou = i To nfacilities For jc = 1 To ncells If Availabilitymatrix(tou, jc) = 0 Then SelectionProb(tou, jc) = 0 End If Next jc
241
Next tou centroids(i, 1) = info(i, 1) / 2 - 1 + j - Int(j / ncolumns) * ncolumns '+ start column centroids(i, 2) = info(i, 2) / 2 - 1 + Int(j / ncolumns) + 1 '+ start row For lou = i To nfacilities ' updating Selection Probability after Placing Every Facility sigma3 = 0 For ree = 1 To ncells sigma3 = sigma3 + SelectionProb(lou, ree) Next ree For tre = 1 To ncells If sigma3 = 0 Then Exit For 'SelectionProb(lou, tre) = 0 Else SelectionProb(lou, tre) = SelectionProb(lou, tre) / sigma3 End If Next tre Next lou Wires(C, i) = j Exit For End If sumprob = sumprob + SelectionProb(i, j) Next j Next i '***************************Calculation of Travel Distance (objective Function)************************** For iy = 1 To 17 'nfacilities For jy = 1 To 17 distance = ((centroids(iy, 1) - centroids(jy, 1)) ^ 2 + (centroids(iy, 2) - centroids(jy, 2)) ^ 2) ^ 0.5 Cost = Cost + distance * Worksheets("proximity").Cells(iy + 1, jy + 1) Next jy Next iy '--------------------------------------------------------------- WireValue(X, C) = Cost Volt = Round(WireValue(1, 1) ^ 2.1, 3) '- Round(Wirevalue(1, 1), 3) ' ' Resist(X, C) = Round((Volt / WireValue(X, C)) / 1, 3) '/ (30 + x) '55(iterations + 1 - X) '---------------------------------------------Selecting Best Wires------------------------------- For Kop = 1 To Top If least < TopWires(Kop, nfacilities + 2) Then least = TopWires(Kop, nfacilities + 2) ChangePosition = Kop End If Next Kop If WireValue(X, C) < least Then TopWires(ChangePosition, nfacilities + 2) = WireValue(X, C) TopWires(ChangePosition, nfacilities + 3) = Volt / WireValue(X, C)
242
TopWires(ChangePosition, nfacilities + 4) = C For wop = 1 To nfacilities TopWires(ChangePosition, wop) = Wires(C, wop) Next wop End If '----------------------------------------------Selecting Worst Wires----------------------------- For cop = Top + 1 To Top + bottom If maximum > TopWires(cop, nfacilities + 2) Then maximum = TopWires(cop, nfacilities + 2) ChangePos = cop End If Next cop If WireValue(X, C) > maximum Then TopWires(ChangePos, nfacilities + 2) = WireValue(X, C) TopWires(ChangePos, nfacilities + 3) = Volt / WireValue(X, C) For wop = 1 To nfacilities TopWires(ChangePos, wop) = Wires(C, wop) Next wop End If '---------------------------------------------End of Selecting Best and Worst Wires------------------------------- If WireValue(X, C) < Bestwire Then Bestwire = WireValue(X, C) For cc = 1 To nfacilities best(cc) = Wires(C, cc) Next cc best(nfacilities + 2) = C End If If WireValue(X, C) > Worstwire Then Worstwire = WireValue(X, C) For cd = 1 To nfacilities worst(cd) = Wires(C, cd) Next cd End If counterc = counterc + 1 Wires(C, nfacilities + 2) = C Wires(C, nfacilities + 3) = WireCost Next C '============================== End of Wire Fabricatioon======================= For nm = 1 To trials 'Adjusting the Resistance Relative to the Biggest Resistance Resist(X, nm) = Resist(X, nm) * (Bestwire / WireValue(X, nm)) For ty = 1 To nfacilities Ires(ty, Wires(nm, ty)) = Resist(X, nm) / nfacilities * Area(ty, Wires(nm, ty)) + Ires(ty, Wires(nm, ty)) Next ty Next nm
243
If Bestwire < bestiteration Then bestiteration = Bestwire For Lmk = 1 To nfacilities + 1 Arraybestiteration(Lmk) = best(Lmk) Next Lmk ElseIf Bestwire = bestiteration Then bestiteration = Bestwire For Lmk = 1 To nfacilities + 1 Arraybestiteration(Lmk) = best(Lmk) Next Lmk End If If Worstwire > Worstiteration Then Worstiteration = Worstwire End If '============================ -SENSETIVITY ANALYSIS======================= ReDim Temparray(nfacilities) ReDim Temporrarycost(nfacilities) Dim sigma2 As Double Dim xcell, ycell, Flag As Integer counterm = 1 For d = 1 To Top + bottom sigma2 = 0 For sense = 1 To nfacilities For bg = 1 To nfacilities If X > Round(Iterations * 0.9 - 1, 0) Then Sensitivity(sense, bg) = Arraybestiteration(bg) centroids(bg, 1) = info(bg, 1) / 2 - 1 + Sensitivity(sense, bg) - Int(Sensitivity(sense, bg) / ncolumns) * ncolumns '+ start column centroids(bg, 2) = info(bg, 2) / 2 - 1 + Int(Sensitivity(sense, bg) / ncolumns) + 1 '+ start row Flag = 0 ElseIf X > 0 And X < Round(Iterations * 0.9, 0) Then Sensitivity(sense, bg) = best(bg) centroids(bg, 1) = info(bg, 1) / 2 - 1 + Sensitivity(sense, bg) - Int(Sensitivity(sense, bg) / ncolumns) * ncolumns '+ start column centroids(bg, 2) = info(bg, 2) / 2 - 1 + Int(Sensitivity(sense, bg) / ncolumns) + 1 '+ start row Flag = 1 End If Next bg For DS = 1 To nrows ' Placing Fixed Facilities For rt = 1 To ncolumns SitePlan(DS, rt) = Worksheets("plan").Cells(DS + 4, rt + 4) Next rt Next DS
244
For LM = 1 To nfacilities ' Placing Arraybestiteration Facilities Hrow = Int(Arraybestiteration(LM) / ncolumns) + 1 'row position Hcolumn = Arraybestiteration(LM) - Int(Arraybestiteration(LM) / ncolumns) * ncolumns 'column position For iu = 1 To info(LM, 1) ' width For ju = 1 To info(LM, 2) ' length SitePlan(Hrow + ju - 1, Hcolumn + iu - 1) = LM '* 10 Next ju Next iu Next LM Tempcost = 0 xcell = Int(TopWires(d, sense) / ncolumns) + 1 ycell = TopWires(d, sense) - Int(TopWires(d, sense) / ncolumns) * ncolumns '***************************Checks for Avaialability due to Sensitivity Analysis************************ If Sensitivity(sense, sense) = TopWires(d, sense) Then '******Checking Feasibility of Solution (Repitition) If Flag = 0 Then Temporrarycost(sense) = Bestwire Tempcost = Bestwire * 1.2 ElseIf Flag = 1 Then Temporrarycost(sense) = bestiteration Tempcost = bestiteration * 1.2 End If GoTo 77 End If If SitePlan(xcell, ycell) > 0 And SitePlan(xcell, ycell) <> sense Then 'TopWires(d, sense) Then '******Checking Feasibility of Solution (availability of cells 'Multiplied by 1.2 to maximize the cost and make the cell selection less probable If Flag = 0 Then Temporrarycost(sense) = Bestwire * 1.2 Tempcost = Bestwire * 1.2 ElseIf Flag = 1 Then Temporrarycost(sense) = bestiteration * 1.2 Tempcost = bestiteration * 1.2 End If GoTo 77 End If For T = 1 To info(sense, 1) '********Checking if the Width would interfere with any fixed facility For TT = 1 To info(sense, 2) '********Checking if the Length would interfere with any fixed facility If SitePlan(xcell + TT - 1, ycell + T - 1) > 0 And SitePlan(xcell + TT - 1, ycell + T - 1) <> sense Then 'Multiplied by 1.2 to maximize the cost and make the cell selection less probable If Flag = 0 Then Temporrarycost(sense) = Bestwire * 1.2 Tempcost = Bestwire * 1.2 ElseIf Flag = 1 Then
245
Temporrarycost(sense) = bestiteration * 1.2 Tempcost = bestiteration * 1.2 End If GoTo 77 End If Next TT Next T '***********************************************End of Checks ************************************ 'Deleting the original position of the facility trow = Int(Sensitivity(sense, sense) / ncolumns) + 1 'row position tcolumn = Sensitivity(sense, sense) - Int(Sensitivity(sense, sense) / ncolumns) * ncolumns 'column position For iy = 1 To info(sense, 1) ' width For jy = 1 To info(sense, 2) ' length SitePlan(trow + jy - 1, tcolumn + iy - 1) = 0 '* 10 Next jy Next iy Sensitivity(sense, sense) = TopWires(d, sense) 'Substituting the Location of the Top wire in the Control Wire centroids(sense, 1) = info(sense, 1) / 2 - 1 + TopWires(d, sense) - Int(TopWires(d, sense) / ncolumns) * ncolumns '+ start column centroids(sense, 2) = info(sense, 2) / 2 - 1 + Int(TopWires(d, sense) / ncolumns) + 1 '+ start row 'Placing the facility at the new position trow = Int(Sensitivity(sense, sense) / ncolumns) + 1 'row position tcolumn = Sensitivity(sense, sense) - Int(Sensitivity(sense, sense) / ncolumns) * ncolumns 'column position For iy = 1 To info(sense, 1) ' width For jy = 1 To info(sense, 2) ' length SitePlan(trow + jy - 1, tcolumn + iy - 1) = sense '* 10 Next jy Next iy '****************************************Calculation of r*lm ******************************************* For iw = 1 To 17 'nfacilities For jw = 1 To 17 distance = ((centroids(iw, 1) - centroids(jw, 1)) ^ 2 + (centroids(iw, 2) - centroids(jw, 2)) ^ 2) ^ 0.5 Tempcost = Tempcost + distance * Worksheets("proximity").Cells(iw + 1, jw + 1) Next jw Next iw 77: Temporrarycost(sense) = Tempcost '******************** UPDATING BEST VALUE ******************** If Tempcost < bestiteration Then 'Or Tempcost <= 22230 bestiteration = Tempcost For opt = 1 To nfacilities Arraybestiteration(opt) = Sensitivity(sense, opt) Next opt
246
Arraybestiteration(nfacilities + 2) = 1980 For Tr = 1 To nfacilities + 2 Worksheets("Duplicate").Cells(Count, Tr + 4) = Sensitivity(sense, Tr) Next Tr Worksheets("Duplicate").Cells(Count, 4).Value = Tempcost Worksheets("Duplicate").Cells(Count, 1).Value = X Count = Count + 1 End If If X > Round(Iterations * 0.9 - 1, 0) Then Temparray(sense) = Round(((TopWires(d, nfacilities + 3) / nfacilities) * Bestwire / TopWires(d, nfacilities + 2) * (1 - (((Volt / bestiteration) - (Volt / Tempcost)) / (Volt / bestiteration)) / 1)), 4) ElseIf X > 0 And X < Round(Iterations * 0.9, 0) Then Temparray(sense) = Round(((TopWires(d, nfacilities + 3) / nfacilities) * Bestwire / TopWires(d, nfacilities + 2) * (1 - (((Volt / Bestwire) - (Volt / Tempcost)) / (Volt / Bestwire)) / 1)), 4) End If sigma2 = sigma2 + Temparray(sense) counterm = counterm + 1 Next sense For iw = 1 To 17 Worksheets("site plan").Cells(iw + 25, 1) = centroids(iw, 1) Worksheets("site plan").Cells(iw + 25, 2) = centroids(iw, 2) Next iw '************************** UPDATING PROBABILITY **************************************** For a = 1 To nfacilities If X > Round(Iterations * 0.9 - 1, 0) Then Ires(a, TopWires(d, a)) = Ires(a, TopWires(d, a)) + (TopWires(d, nfacilities + 3) * (Bestwire / TopWires(d, nfacilities + 2)) * Temparray(a) / sigma2) * Area(a, TopWires(d, a)) - (TopWires(d, nfacilities + 3) * (Bestwire / TopWires(d, nfacilities + 2)) / nfacilities) * Area(a, TopWires(d, a)) ElseIf X > 0 And X < Round(Iterations * 0.9, 0) Then Ires(a, TopWires(d, a)) = Ires(a, TopWires(d, a)) + (TopWires(d, nfacilities + 3) * (Bestwire / TopWires(d, nfacilities + 2) * Temparray(a) / sigma2) * Area(a, TopWires(d, a)) - TopWires(d, nfacilities + 3) * (Bestwire / TopWires(d, nfacilities + 2)) / nfacilities) * Area(a, TopWires(d, a)) End If Next a Next d ''**************************Storing Data in Excel********************************************* countercell = countercell + nfacilities + 2 countercellb = countercellb + trials + 2 counterx = counterx + 1 Worksheets("compare").Cells(1, 12) = X Worksheets("compare").Cells(7, 7) = Iterations Worksheets("compare").Cells(7, 8) = trials Worksheets("compare").Cells(7, 9) = Top Worksheets("compare").Cells(7, 10) = bottom
247
ActiveWorkbook.Save Sheets("compare").Cells(yaz, zay).Value = bestiteration zay = zay + 1 If zay = 22 Then yaz = yaz + 1 zay = 1 End If For fg = 1 To nfacilities For gh = 1 To ncells If counterheat(fg, gh) > 9000 Then Ires(fg, gh) = Ires(fg, gh) * 0.55 'MsgBox (Ires(fg, gh)) counterheat(fg, gh) = 0 End If ' Next gh Next fg For we = 1 To trials For yu = 1 To nfacilities + 1 Wires(we, yu) = 0 Next yu Next we Next X '**************************************************End of iteration***************************************** Last = Time duration = Last - Start Sheets("random").Cells(17, 1).Value = duration Sheets("compare").Cells(1, 1).Value = bestiteration Sheets("Random").Cells(1, 1) = EAB Sheets("Random").Cells(2, 1) = EAB2 Sheets("Random").Cells(3, 1) = EAB3 Sheets("Random").Cells(4, 1) = EAB4 For tyu = 1 To nfacilities + 2 Worksheets("compare").Cells(4, tyu + 3) = Arraybestiteration(tyu) Next tyu Worksheets("compare").Cells(4, tyu + 3) = bestiteration '======================= DRAWING SITE LAYOUT ============================ Worksheets("centroids").Range("A1:AE23").Copy Worksheets("site plan").Paste For V = 1 To nfacilities xrow = Int(Arraybestiteration(V) / ncolumns) + 1 ycolumn = Arraybestiteration(V) - Int(Arraybestiteration(V) / ncolumns) * ncolumns For TT = 1 To info(V, 2) Worksheets("site plan").Cells(xrow + 4 + TT, ycolumn + 4) = V For T = 1 To info(V, 1) Worksheets("site plan").Cells(xrow + 4 + TT, ycolumn + 3 + T) = V
248
Next T Next TT Next V '===================== End DRAWING SITE LAYOUT ========================== ActiveWorkbook.Save End Sub
249
APPENDIX B: PROBLEM DATA AND SOME RESULTS
250
APPENDIX (B-I): Data for Ulysses16 TSP
1. Coordinates of Cities
City X Y1 38.24 20.422 39.57 26.153 40.56 25.324 36.26 23.125 33.48 10.546 37.56 12.197 38.42 13.118 37.52 20.449 41.23 9.1
10 41.17 13.0511 36.08 -5.2112 38.47 15.1313 38.15 15.3514 37.51 15.1715 35.49 14.3216 39.36 19.56
Coordinates
251
2. Geographical Distance Matrix
City 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 0 509.0 501.0 312.0 1019.0 736.0 656.0 60.0 1039.0 726.0 2314.0 479.0 448.0 479.0 619.0 150.02 509.0 0 126.0 474.0 1526.0 1226.0 1133.0 532.0 1449.0 1122.0 2789.0 958.0 941.0 978.0 1127.0 542.03 501.0 126.0 0 541.0 1516.0 1184.0 1084.0 536.0 1371.0 1045.0 2728.0 913.0 904.0 946.0 1115.0 499.04 312.0 474.0 541.0 0 1157.0 980.0 919.0 271.0 1333.0 1029.0 2553.0 751.0 704.0 720.0 783.0 455.05 1019.0 1526.0 1516.0 1157.0 0 478.0 583.0 996.0 858.0 855.0 1504.0 677.0 651.0 600.0 401.0 1033.06 736.0 1226.0 1184.0 980.0 478.0 0 115.0 740.0 470.0 379.0 1581.0 271.0 289.0 261.0 308.0 687.07 656.0 1133.0 1084.0 919.0 583.0 115.0 0 667.0 455.0 288.0 1661.0 177.0 216.0 207.0 343.0 592.08 60.0 532.0 536.0 271.0 996.0 740.0 667.0 0 1066.0 759.0 2320.0 493.0 454.0 479.0 598.0 206.09 1039.0 1449.0 1371.0 1333.0 858.0 470.0 455.0 1066.0 0 328.0 1387.0 591.0 650.0 656.0 776.0 933.010 726.0 1122.0 1045.0 1029.0 855.0 379.0 288.0 759.0 328.0 0 1697.0 333.0 400.0 427.0 622.0 610.011 2314.0 2789.0 2728.0 2553.0 1504.0 1581.0 1661.0 2320.0 1387.0 1697.0 0 1838.0 1868.0 1841.0 1789.0 2248.012 479.0 958.0 913.0 751.0 677.0 271.0 177.0 493.0 591.0 333.0 1838.0 0 68.0 105.0 336.0 417.013 448.0 941.0 904.0 704.0 651.0 289.0 216.0 454.0 650.0 400.0 1868.0 68.0 0 52.0 287.0 406.014 479.0 978.0 946.0 720.0 600.0 261.0 207.0 479.0 656.0 427.0 1841.0 105.0 52.0 0 237.0 449.015 619.0 1127.0 1115.0 783.0 401.0 308.0 343.0 598.0 776.0 622.0 1789.0 336.0 287.0 237.0 0 636.016 150.0 542.0 499.0 455.0 1033.0 687.0 592.0 206.0 933.0 610.0 2248.0 417.0 406.0 449.0 636.0 0
3. Euclidian Distance Matrix
City 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161 0 5.8823 5.4215 3.3482 10.9669 8.2580 7.3122 0.7203 11.7082 7.9311 25.7209 5.2950 5.0708 5.3005 6.6912 1.41212 5.8823 0 1.2919 4.4874 16.7559 14.1040 13.0906 6.0668 17.1306 13.1973 31.5536 11.0748 10.8930 11.1716 12.5138 6.59333 5.4215 1.2919 0 4.8301 16.3883 13.4684 12.3961 5.7494 16.2338 12.2852 30.8569 10.4021 10.2571 10.5983 12.1122 5.88374 3.3482 4.4874 4.8301 0 12.8835 11.0070 10.2404 2.9614 14.8749 11.2033 28.3306 8.2900 7.9966 8.0477 8.8336 4.72065 10.9669 16.7559 16.3883 12.8835 0 4.4010 5.5685 10.6926 7.8826 8.0893 15.9632 6.7800 6.7041 6.1382 4.2812 10.76736 8.2580 14.1040 13.4684 11.0070 4.4010 0 1.2594 8.2501 4.7976 3.7110 17.4628 3.0776 3.2146 2.9804 2.9702 7.58667 7.3122 13.0906 12.3961 10.2404 5.5685 1.2594 0 7.3850 4.8965 2.7507 18.4688 2.0206 2.2562 2.2520 3.1700 6.51818 0.7203 6.0668 5.7494 2.9614 10.6926 8.2501 7.3850 0 11.9315 8.2422 25.6904 5.3943 5.1288 5.2700 6.4479 2.03969 11.7082 17.1306 16.2338 14.8749 7.8826 4.7976 4.8965 11.9315 0 3.9505 15.2085 6.6316 6.9677 7.1192 7.7586 10.6258
10 7.9311 13.1973 12.2852 11.2033 8.0893 3.7110 2.7507 8.2422 3.9505 0 18.9562 3.4083 3.7961 4.2297 5.8202 6.756911 25.7209 31.5536 30.8569 28.3306 15.9632 17.4628 18.4688 25.6904 15.2085 18.9562 0 20.4799 20.6639 20.4301 19.5389 24.986212 5.2950 11.0748 10.4021 8.2900 6.7800 3.0776 2.0206 5.3943 6.6316 3.4083 20.4799 0 0.3883 0.9608 3.0881 4.518513 5.0708 10.8930 10.2571 7.9966 6.7041 3.2146 2.2562 5.1288 6.9677 3.7961 20.6639 0.3883 0 0.6648 2.8525 4.380414 5.3005 11.1716 10.5983 8.0477 6.1382 2.9804 2.2520 5.2700 7.1192 4.2297 20.4301 0.9608 0.6648 0 2.1916 4.763915 6.6912 12.5138 12.1122 8.8336 4.2812 2.9702 3.1700 6.4479 7.7586 5.8202 19.5389 3.0881 2.8525 2.1916 0 6.514216 1.4121 6.5933 5.8837 4.7206 10.7673 7.5866 6.5181 2.0396 10.6258 6.7569 24.9862 4.5185 4.3804 4.7639 6.5142 0
252
APPENDIX (B-II): Data for bayg29 TSP
1. Coordinates of Cities
City X Y1 1150 17602 630 16603 40 20904 750 11005 750 20306 1030 20707 1650 6508 1490 16309 790 2260
10 710 131011 840 55012 1170 230013 970 134014 510 70015 750 90016 1280 120017 230 59018 460 86019 1040 95020 590 139021 830 177022 490 50023 1840 124024 1260 150025 1280 79026 490 213027 1460 142028 1260 191029 360 1980
Coordinates
253
2. Geographical Distance Matrix
City 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291 0 97 205 139 86 60 220 65 111 115 227 95 82 225 168 103 266 205 149 120 58 257 152 52 180 136 82 34 1452 97 0 129 103 71 105 258 154 112 65 204 150 87 176 137 142 204 148 148 49 41 211 226 116 197 89 153 124 743 205 129 0 219 125 175 386 269 134 184 313 201 215 267 248 271 274 236 272 160 151 300 350 239 322 78 276 220 604 139 103 219 0 167 182 180 162 208 39 102 227 60 86 34 96 129 69 58 60 120 119 192 114 110 192 136 173 1735 86 71 125 167 0 51 296 150 42 131 268 88 131 245 201 175 275 218 202 119 50 281 238 131 244 51 166 95 696 60 105 175 182 51 0 279 114 56 150 278 46 133 266 214 162 302 242 203 146 67 300 205 111 238 98 139 52 1207 220 258 386 180 296 279 0 178 328 206 147 308 172 203 165 121 251 216 122 231 249 209 111 169 72 338 144 237 3318 65 154 269 162 150 114 178 0 169 151 227 133 104 242 182 84 290 230 146 165 121 270 91 48 158 200 39 64 2109 111 112 134 208 42 56 328 169 0 172 309 68 169 286 242 208 315 259 240 160 90 322 260 160 281 57 192 107 90
10 115 65 184 39 131 150 206 151 172 0 140 195 51 117 72 104 153 93 88 25 85 152 200 104 139 154 134 149 13511 227 204 313 102 268 278 147 227 309 140 0 320 146 64 68 143 106 88 81 159 219 63 216 187 88 293 191 258 27212 95 150 201 227 88 46 308 133 68 195 320 0 174 311 258 196 347 288 243 192 113 345 222 144 274 124 165 71 15313 82 87 215 60 131 133 172 104 169 51 146 174 0 144 86 57 189 128 71 71 82 176 150 56 114 168 83 115 16014 225 176 267 86 245 266 203 242 286 117 64 311 144 0 61 165 51 32 105 127 201 36 254 196 136 260 212 258 23415 168 137 248 34 201 214 165 182 242 72 68 258 86 61 0 106 110 56 49 91 153 91 197 136 94 225 151 201 20516 103 142 271 96 175 162 121 84 208 104 143 196 57 165 106 0 215 159 64 126 128 190 98 53 78 218 48 127 21417 266 204 274 129 275 302 251 290 315 153 106 347 189 51 110 215 0 61 155 157 235 47 305 243 186 282 261 300 25218 205 148 236 69 218 242 216 230 259 93 88 288 128 32 56 159 61 0 105 100 176 66 253 183 146 231 203 239 20419 149 148 272 58 202 203 122 146 240 88 81 243 71 105 49 64 155 105 0 113 152 127 150 106 52 235 112 179 22120 120 49 160 60 119 146 231 165 160 25 159 192 71 127 91 126 157 100 113 0 79 163 220 119 164 135 152 153 11421 58 41 151 120 50 67 249 121 90 85 219 113 82 201 153 128 235 176 152 79 0 236 201 90 195 90 127 84 9122 257 211 300 119 281 300 209 270 322 152 63 345 176 36 91 190 47 66 127 163 236 0 273 226 148 296 238 291 26923 152 226 350 192 238 205 111 91 260 200 216 222 150 254 197 98 305 253 150 220 201 273 0 112 130 286 74 155 29124 52 116 239 114 131 111 169 48 160 104 187 144 56 196 136 53 243 183 106 119 90 226 112 0 130 178 38 75 18025 180 197 322 110 244 238 72 158 281 139 88 274 114 136 94 78 186 146 52 164 195 148 130 130 0 281 120 205 27026 136 89 78 192 51 98 338 200 57 154 293 124 168 260 225 218 282 231 235 135 90 296 286 178 281 0 213 145 3627 82 153 276 136 166 139 144 39 192 134 191 165 83 212 151 48 261 203 112 152 127 238 74 38 120 213 0 94 21728 34 124 220 173 95 52 237 64 107 149 258 71 115 258 201 127 300 239 179 153 84 291 155 75 205 145 94 0 16229 145 74 60 173 69 120 331 210 90 135 272 153 160 234 205 214 252 204 221 114 91 269 291 180 270 36 217 162 0
254
APPENDIX (B-III): Data for att48 TSP
1. Coordinates of Cities
City X Y1 6734 14532 2233 103 5530 14244 401 8415 3082 16446 7608 44587 7573 37168 7265 12689 6898 1885
10 1112 204911 5468 260612 5989 287313 4706 267414 4612 203515 6347 268316 6107 66917 7611 518418 7462 359019 7732 472320 5900 356121 4483 336922 6101 111023 5199 218224 1633 280925 4307 232226 675 100627 7555 481928 7541 398129 3177 75630 7352 450631 7545 280132 3245 330533 6426 317334 4608 119835 23 221636 7248 377937 7762 459538 7392 224439 3484 282940 6271 213541 4985 14042 1916 156943 7280 489944 7509 323945 10 267646 6807 299347 5185 325848 3023 1942
Coordinates
255
2. Best Solutions Obtained Using Electimize No. Value
1 1 8 38 31 44 18 7 28 6 37 19 27 17 43 30 36 46 33 20 47 21 32 39 48 5 42 24 10 45 35 4 26 2 29 34 41 16 22 3 23 14 25 13 11 12 15 40 9 1 33,5242 1 8 38 31 44 18 7 28 6 37 19 27 17 43 30 36 46 33 20 47 21 32 39 5 48 42 24 10 45 35 4 26 2 29 34 41 16 22 3 23 14 25 13 11 12 15 40 9 1 33,7733 1 8 38 31 44 18 7 28 6 37 19 27 17 43 30 36 46 33 20 47 21 13 14 25 39 32 24 42 10 45 35 4 26 2 29 5 48 34 41 16 22 3 23 11 12 15 40 9 1 33,9054 1 8 38 31 44 7 28 6 37 19 27 17 43 30 36 18 46 33 20 47 21 32 39 5 48 42 10 24 45 35 4 26 2 29 34 41 16 22 3 23 14 25 13 11 12 15 40 9 1 34,0275 1 8 38 31 44 18 36 7 28 6 37 19 27 17 43 30 46 33 20 47 21 32 39 5 48 42 10 24 45 35 4 26 2 29 34 41 16 22 3 23 14 25 13 11 12 15 40 9 1 34,219
Best Tours for att48
256
APPENDIX C: MANUAL CALCULATIONS
257
APPENDIX (C-I): Manual Verification of the Site Layout Planning Optimum Solution Identified by Electimize
1. Facilities Centroids of the Optimum Site Layout Determined by
Electimize
X YField office 9.5 9Warehouse 10 11.5Reinforcing bars shop 1 9.5 7Reinforcing bars shop 2 3 15.5Excavated material 11 3Patch plant 6 12Subcontractor's office 5.5 9Formwork shop 8 12Project I 8.5 2Project J 8.5 5Project K 5.5 2Project L 1 12Project M 1 15.5Project N 6.5 15.5Project O 13 12
Project P 13 15.5Project Q 3.5 12
Centroids
258
2. Distance Between Facilities (X-axis)
I J K L M N O P QField office
Warehous
e
Rein. bars
1
Rein. bars
2Exc. mat.
Pat. plant
Sub. office
Formwork shop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 178.5 8.5 5.5 1 1 6.5 13 13 3.5 9.5 10 9.5 3 11 6 5.5 8
Formwork shop 17 8 0.25 0.25 6.25 49 49 2.25 25 25 20.25 2.25 4 2.25 25 9 4 6.25 0Subcontractor's office 16 5.5 9 9 0 20.25 20.25 1 56.25 56.25 4 16 20.25 16 6.25 30.25 0.25 0 6.25Patch plant 15 6 6.25 6.25 0.25 25 25 0.25 49 49 6.25 12.25 16 12.25 9 25 0 0.25 4Excavated material 14 11 6.25 6.25 30.25 100 100 20.25 4 4 56.25 2.25 1 2.25 64 0 25 30.25 9Reinforcing bars shop 2 13 3 30.25 30.25 6.25 4 4 12.25 100 100 0.25 42.25 49 42.25 0 64 9 6.25 25Reinforcing bars shop 1 12 9.5 1 1 16 72.25 72.25 9 12.25 12.25 36 0 0.25 0 42.25 2.25 12.25 16 2.25Warehouse 11 10 2.25 2.25 20.25 81 81 12.25 9 9 42.25 0.25 0 0.25 49 1 16 20.25 4Field office 10 9.5 1 1 16 72.25 72.25 9 12.25 12.25 36 0 0.25 0 42.25 2.25 12.25 16 2.25Project Q 9 3.5 25 25 4 6.25 6.25 9 90.25 90.25 0 36 42.25 36 0.25 56.25 6.25 4 20.25Project P 8 13 20.25 20.25 56.25 144 144 42.25 0 0 90.25 12.25 9 12.25 100 4 49 56.25 25Project O 7 13 20.25 20.25 56.25 144 144 42.25 0 0 90.25 12.25 9 12.25 100 4 49 56.25 25Project N 6 6.5 4 4 1 30.25 30.25 0 42.25 42.25 9 9 12.25 9 12.25 20.25 0.25 1 2.25Project M 5 1 56.25 56.25 20.25 0 0 30.25 144 144 6.25 72.25 81 72.25 4 100 25 20.25 49Project L 4 1 56.25 56.25 20.25 0 0 30.25 144 144 6.25 72.25 81 72.25 4 100 25 20.25 49Project K 3 5.5 9 9 0 20.25 20.25 1 56.25 56.25 4 16 20.25 16 6.25 30.25 0.25 0 6.25Project J 2 8.5 0 0 9 56.25 56.25 4 20.25 20.25 25 1 2.25 1 30.25 6.25 6.25 9 0.25Project I 1 8.5 0 0 9 56.25 56.25 4 20.25 20.25 25 1 2.25 1 30.25 6.25 6.25 9 0.25
Distance Between All Facilites on the X-axis
X-CentroidFacility
259
3. Distance Between Facilities (Y-axis)
I J K L M N O P QField office
Warehous
e
Rein. bars
1
Rein. bars
2Exc. mat.
Pat. plant
Sub. office
Formwork shop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 172 5 2 12 15.5 15.5 12 15.5 12 12 9 12 3 15.5 7 11.5 9
Formwork shop 17 12 100 49 100 0 12.25 12.25 0 12.25 0 0 9 0 81 12.25 25 0.25 9Subcontractor's office 16 9 49 16 49 9 42.25 42.25 9 42.25 9 9 0 9 36 42.25 4 6.25 0Patch plant 15 12 100 49 100 0 12.25 12.25 0 12.25 0 0 9 0 81 12.25 25 0.25 9Excavated material 14 3 1 4 1 81 156.3 156.3 81 156.3 81 81 36 81 0 156.3 16 72.25 36Reinforcing bars shop 2 13 15.5 182.3 110.3 182.3 12.25 0 0 12.25 0 12.25 12.25 42.25 12.25 156.3 0 72.25 16 42.25Reinforcing bars shop 1 12 7 25 4 25 25 72.25 72.25 25 72.25 25 25 4 25 16 72.25 0 20.25 4Warehouse 11 11.5 90.25 42.25 90.25 0.25 16 16 0.25 16 0.25 0.25 6.25 0.25 72.25 16 20.25 0 6.25Field office 10 9 49 16 49 9 42.25 42.25 9 42.25 9 9 0 9 36 42.25 4 6.25 0Project Q 9 12 100 49 100 0 12.25 12.25 0 12.25 0 0 9 0 81 12.25 25 0.25 9Project P 8 15.5 182.3 110.3 182.3 12.25 0 0 12.25 0 12.25 12.25 42.25 12.25 156.3 0 72.25 16 42.25Project O 7 12 100 49 100 0 12.25 12.25 0 12.25 0 0 9 0 81 12.25 25 0.25 9Project N 6 15.5 182.3 110.3 182.3 12.25 0 0 12.25 0 12.25 12.25 42.25 12.25 156.3 0 72.25 16 42.25Project M 5 15.5 182.3 110.3 182.3 12.25 0 0 12.25 0 12.25 12.25 42.25 12.25 156.3 0 72.25 16 42.25Project L 4 12 100 49 100 0 12.25 12.25 0 12.25 0 0 9 0 81 12.25 25 0.25 9Project K 3 2 0 9 0 100 182.3 182.3 100 182.3 100 100 49 100 1 182.3 25 90.25 49Project J 2 5 9 0 9 49 110.3 110.3 49 110.3 49 49 16 49 4 110.3 4 42.25 16Project I 1 2 0 9 0 100 182.3 182.3 100 182.3 100 100 49 100 1 182.3 25 90.25 49
Distance Between All Facilites on the Y-axis
Y-CentroidFacility
260
4. Euclidian Distance Between Facilities
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17Formwork shop 17 10.01 7.018 10.31 7 7.826 3.808 5 6.103 4.5 1.5 3.606 1.5 10.3 4.61 5.385 2.55 3Subcontractor's office 16 7.616 5 7 5.408 7.906 6.576 8.078 9.925 3.606 5 4.5 5 6.5 8.515 2.062 2.5 2.5Patch plant 15 10.31 7.433 10.01 5 6.103 3.536 7 7.826 2.5 3.5 5 3.5 9.487 6.103 5 0.707 3.606Excavated material 14 2.693 3.202 5.59 13.45 16.01 13.29 9.22 12.66 11.72 9.124 6.083 9.124 8 12.5 6.403 10.12 6.708Reinforcing bars shop 2 13 14.58 11.85 13.73 4.031 2 3.5 10.59 10 3.536 7.382 9.552 7.382 12.5 8 9.014 4.717 8.201Reinforcing bars shop 1 12 5.099 2.236 6.403 9.862 12.02 9.014 6.103 9.192 7.81 5 2.062 5 7.632 8.631 3.5 6.021 2.5Warehouse 11 9.618 6.671 10.51 9.014 9.849 5.315 3.041 5 6.519 0.707 2.5 0.707 11.01 4.123 6.021 4.5 3.202Field office 10 7.071 4.123 8.062 9.014 10.7 7.159 4.61 7.382 6.708 3 0.5 3 8.846 6.671 4.031 4.717 1.5Project Q 9 11.18 8.602 10.2 2.5 4.301 4.61 9.5 10.12 0 6 7.159 6 9.014 8.276 5.59 2.062 5.408Project P 8 14.23 11.42 15.44 12.5 12 6.5 3.5 0 10.12 4.95 7.159 4.95 16.01 2 11.01 8.5 8.201Project O 7 10.97 8.322 12.5 12 12.5 7.382 0 3.5 9.5 3.5 4.243 3.5 13.45 4.031 8.602 7.517 5.831Project N 6 13.65 10.69 13.54 6.519 5.5 0 7.382 6.5 4.61 4.61 7.382 4.61 12.98 4.5 8.515 4.123 6.671Project M 5 15.44 12.9 14.23 3.5 0 5.5 12.5 12 4.301 9.192 11.1 9.192 12.66 10 9.862 6.021 9.552Project L 4 12.5 10.26 10.97 0 3.5 6.519 12 12.5 2.5 8.5 9.487 8.5 9.22 10.59 7.071 4.528 7.616Project K 3 3 4.243 0 10.97 14.23 13.54 12.5 15.44 10.2 10.77 8.322 10.77 2.693 14.58 5.025 9.5 7.433Project J 2 3 0 4.243 10.26 12.9 10.69 8.322 11.42 8.602 7.071 4.272 7.071 5.852 10.79 3.202 7.159 4.031Project I 1 0 3 3 12.5 15.44 13.65 10.97 14.23 11.18 10.05 7.159 10.05 5.59 13.73 5.59 9.962 7.018
Distance
Euclidean Distance Between All Facilites
261
5. Proximity Matrix
I J K L M N O P QField office
Warehous
e
Rein. bars
1
Rein. bars
2Exc. mat.
Pat. plant
Sub. office
Formwork shop
Σ(Distance x Proximity)
Formwork shop 17 20 20 20 20 20 20 60 20 20 2 20 0 0 0 0 0 1,506.62Subcontractor's office 16 6 6 6 6 6 6 6 6 6 0 0 0 0 0 0 366.69Patch plant 15 100 200 100 400 300 100 500 400 300 2 0 0 0 0 15,090.66Excavated material 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00Reinforcing bars shop 2 13 0 0 0 20 40 60 0 0 20 4 4 0 509.07Reinforcing bars shop 1 12 20 20 20 0 0 0 20 20 0 2 4 598.92Warehouse 11 4 6 4 2 4 6 20 4 2 10 310.79Field office 10 2 2 6 10 2 2 20 4 2 331.76Project Q 9 0 0 0 0 0 0 0 0 0.00Project P 8 0 0 0 0 0 0 0 0.00Project O 7 0 0 0 0 0 0 0.00Project N 6 0 0 0 0 0 0.00Project M 5 0 0 0 0 0.00Project L 4 0 0 0 0.00Project K 3 0 0 0.00Project J 2 0 0.00Project I 1 0 0.00
Total Travel Distance (Objective Function) = 18,714.52
Proximity Matrix
Proximity Matrix
262
6. Optimum Site Layout
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
11 2 3 4 5 6 7 8 9 10 11 12 13 14 15
216 17 18 19 20 21 22 23 24 25 28 29 30
331 32 33 34 35 36 37 38 39 40 43 44 45
446 47 48 49 50 51 52 53 54 55 58 59 60
561 62 63 64 65 66 67 68 69 70 73 74 75
676 77 78 79 80 81 82 83 84 85 86 87 88 89 90
791 92 93 94 95 96 97 98 102 103 104 105
8106 107 108 109 110 111 112 113 117 118 119 120
9121 122 123 124 128 132 133 134 135
10136 137 138 139 143 147 148 149 150
11151 152 153 154 155 162 163 164 165
12166 167 168 169 170 177 178 179 180
13181 182 183 184 185 192 193 194 195
14196 197 198 199 200 205 206 207 208 209 210
15211 212 215 216 217 218 219 220 221 222 223 224 225
16226 227 230 231 232 233 234 235 236 237 238 239 240
17241 242 245 246 247 248 249 250 251 252 253 254 255
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
IK
J
QL
M N
O
P
Excav. Material
Rein. Bar Shop 1
Field OfficeSub. Office
Patch Plant
Form. Shop
Ware-house
Rein. Bar
Shop 2
263
LIST OF REFERENCES
Abdel-Raheem, M. (2006). Cash Management: A Computer-based Framework for Maximizing Profit Using Evolutionary Algorithms. M.Sc. Thesis, Faculty of Engineering, Cairo University, Giza, Egypt.
Abdel-Raheem, M., and Khalafallah, A. (2009). “Framework for a Multi-Level Evolutionary Algorithm for Construction Optimization.” Proceedings of the 23rd European Conference on Modeling and Simulation (ECMS 2009), June 9 – 12, Madrid, Spain.
Ahmed, Z. (2010). “Genetic Algorithm for the Traveling Salesman Problem using Sequential Constructive Crossover Operator.” International Journal of Biometric and Bioinformatics, Computer Science Journals, Vol. 3, No. 6, 96-105.
Ahuja, H. N. (1983). Project Management: Techniques in Planning and Controlling Construction Projects. John Wiley & Sons, USA.
Aguilar, J. (2004). “A General Ant Colony Model to Solve Combinatorial Optimization Problems.” Revista Colombiana De Computacion, Vol. 2, No.1, 7-18.
Applegate, D. L.; Bixby, R. E.; Chvátal, V.; Cook, W. J. (2006), “The Traveling Salesman Problem: A Computational Study.” Princeton University Press, ISBN 978-0-691-12993-8 .
Arora, S. (1998), "Polynomial time approximation schemes for Euclidean traveling salesman and other geometric problems", Journal of the ACM, Vol.5, 753–782.
Austin, Scott (1990), “An introduction to genetic algorithms”, AI Expert, Vol.5 No.3, p.48-53.
Blondel, V., and Tsitsiklis, J. (2000). “Complexity of stability and controllability of elementary hybrid system.” PP 1-21.
Chan, K.C., and Tansri, H. (1994). “ A study of Genetic Crossover Operations on the Facilities Layout Problem.” Computers & Industrial Engineering, Vol. 26, Issue 3, 537-550.
Christodoulou, S. (2005). “Scheduling Construction Activities Using Ant Colony Optimization.” Proceedings of the Tenth International Conference on Civil, Structural, and Environmental Engineering Computing, Civil-Comp Press, Stirling, Scotland, 1-12.
264
Cook, Damon. (2000). Evolved and Timed Ants: Optimizing the Parameters of a Time-Based Ant System Approach to the Traveling Salesman Problem Using a Genetic Algorithm. Honors Undergraduate Thesis, Computer Science Department, New Mexico State University, USA.
Cormen, T. H.; Leiserson, C. E.; Rivest, R. L.; Stein, C. (2001), "The traveling-salesman problem", Introduction to Algorithms (2nd ed.), MIT Press and McGraw-Hill, pp. 1027–1033, ISBN 0-262-03293-7 .
Dorigo, M., and Stutzle, T. (2004). “Ant Colony Optimization.” MIT Press, USA.
Dorigo, Marco, and Gambardella, M., Luca (1997). “Ant colonies for the travelling salesman problem.” Journal of Biosystems, Elsevier, Vol. 43, 73-81.
Dantzig, G. B.; Fulkerson, R.; Johnson, S. M. (1954), "Solution of a large-scale traveling salesman problem", Operations Research 2: 393–410 .
Elazouni, A.M., and Metwally, G. (2005). “Finance-Based Scheduling: Tool to Maximize Project Profit Using Improved Genetic Algorithms.” Journal of Construction Engineering and Management, ASCE, Vol. 131, No.4, 400-412.
Elbeltagi, E. (2005). “Using Ant Colony Optimization For Time-Cost Trade-Off In Construction.” Eleventh Colloquium on Structural and Geotechnical Engineering, Ain Shams University, Cairo, Egypt.
Elbeltagi, E., Hegazy, T., and Grierson, D. (2005). “Comparison among five evolutionary-based optimization algorithms.” Advanced Engineering Informatics, Elsevier, 43-55.
El-Rayes, K., and Kandil, A. (2005). “Time-Cost-Quality Trade-Off Analysis for Highway Construction.” Journal of Construction Engineering and Management, ASCE, Vol. 131, No.4, 477-486.
Eusuff, Muzaffar; Lansey, Kevin; Pasha, Fayzul (2006). “Shuffled frog-leaping algorithm: a memetic meta-heuristic for discrete optimization.” Journal of Engineering Optimization, Taylor and Francis Ltd, Vol. 38, No. 2, 129-154.
FANG L.; CHEN P.; and LIU, S. (2007). “Particle Swarm Optimization with Simulated Annealing for TSP.” Proceedings of the 6th WSEAS International Conference on Artificial Intelligence, Knowledge Engineering and Data Bases. Corfu Island, Greece, 206-210.
Feng, C.W., Liu, L., and Burns, S. (1997). “Using Genetic Algorithms To Solve Construction Time-Cost Trade-Off Problems.” Journal of Computing in Civil Engineering, ASCE, Vol. 11, No.3, 184-189.
265
Forrest, S. (1993). Genetic algorithms: Principles of adaptation applied to computation. Science 261, Aug. 13, 872-878
Goldberg, D.E. (1989). “Genetic Algorithms in Search, Optimization, and Machine Learning.” Addison –Wesely Publishing Company, Inc., New York.
Garey, M. R.; Johnson, D. S. (1979), " Computers and Intractability: A Guide to the Theory of NP-Completeness, W.H. Freeman, pp. 211–212, ISBN 0-7167-1045-5 .
Gutin, G.; Punnen, A. P. (2006), The Traveling Salesman Problem and Its Variations, Springer, ISBN 0-387-44459-9 .
Gutin, G.; Yeo, A.; Zverovich, A. (2002), "Traveling salesman should not be greedy: domination analysis of greedy-type heuristics for the TSP", Discrete Applied Mathematics 117 (1–3).
Haidar, A., Naoum, S., Howes, R., and Tah, J. (1999). “Genetic Algorithms Application And Testing For Equipment Selection.” Journal of Construction Engineering and Management, ASCE, Vol. 125, No.1, 32-40.
Halpin, D.W., and Woodhead, R.W. (1998). “ Construction Management.” John Wiley & Sons, USA.
Hegazy, T. Course Notes. Computer-Based Project Management. Civil Engineering Departement, University of Waterloo, Ontario, Canada. 2000.
Hegazy, T., and Elbeltagi, E. (1999). “EvoSite: An Evolution-Based Model for Site Layout Planning.“ Journal of Computing in Civil Engineering, ASCE, 13 (3), 198-206
Hegazy, T., and Ersahin, T. (2001). “Simplified Spreadsheet Solutions. II: Overall Schedule Optimization.” Journal of Construction Engineering and Management, ASCE, Vol. 127, No.6, 469-475.
Hegazy, T., and Wassed, N. (2001). “Simplified Spreadsheet Solutions. II: Overall Schedule Optimization.” Journal of Construction Engineering and Management, ASCE, Vol. 127, No.3, 183-191.
Hwee, N.G., and Tiong, R.L.K. (2002). “Model on cash flow forecasting and risk analysis for contracting firms.” International Journal of Project Management, Elsevier, PP 351-363.
Jalali, M.R., Afshar, A., and Marino, M.A. (2006). “Reservoir Operation by Ant Colony Optimization Algorithms.” Iranian Journal of Science &Technology, Vol.90, No. B1.
266
Jepson, W.B. (1969). “Financial Control of Construction and Reducing the Element of Risk.” Contract Journal, 24 April, 862-864.
Johnson, D. S.; McGeoch, L. A. (1997), "The Traveling Salesman Problem: A Case Study in Local Optimization", in Aarts, E. H. L.; Lenstra, J. K., Local Search in Combinatorial Optimisation, John Wiley and Sons Ltd, pp. 215–310 .
Khalafallah, A. (2006). “Optimal Construction Site Layout Planning for Airport Expansion Projects,” PhD. Dissertation, Department of Civil and Environmental Engineering, University of Illinois at Urbana-Champaign, USA, October 2006.
Khalafallah, A., and El-Rayes, K. (2006) "Optimizing Airport Construction Site Layouts to Minimize Wildlife Hazards," Journal of Management in Engineering, ASCE, 22(4), 176-185.
Khalafallah, A., Elshennawy, A., and Youssef, N. (2009). “Cost, Quality and Effectiveness of Material and Non-Material Models in Contractor Quality Control System,” Florida Department of Transportation, January 2009.
Kennedy, J. (1999). “Small Worlds and Mega-Minds: Effects of Neighborhood Topology on Particle Swarm Performance.” Proceeding of the 1999 Conference on Evolutionary Computation, 1931-1938.
Kennedy, J.; Eberhart, R.C. (2001). “Swarm Intelligence”. Morgan Kaufmann, ISBN 1-55860-595-9
Lawler, E. L.; Lenstra, J. K.; Rinnooy Kan, A. H. G.; Shmoys, D. B. (1985), The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization, John Wiley & Sons, ISBN 0-471-90413-9 .
Leu, S.S., and Yang, C.H. (1999). “ GA-Based Multicriteria Optimal Model For Construction Scheduling.” Journal of Construction Engineering and Management, ASCE, Vol. 125, No.6, 420-427.
Lu, M. (2002). “Enhancing Project Evaluation and Review Technique Simulation through Artificial Neural Network-based Input Modeling.” Journal of Construction Engineering and Management, ASCE, Vol. 128, No.5, 438-445.
Maier, H.R., Simpson, A.R., Zecchin, A.C., Foong, W. K., Phang, K.Y., Seah, H. Y., and Tan, C.L. (2003). “Ant Colony Optimization for Design of Water Distribution Systems.” Journal of Water Resource Planning and Management, ASCE, Vol.129, No.3, 200-209.
M.C. Fonseca and P.J. Fleming (1995). “An overview of Evolutionary Algorithms in Multiobjective Optimization.” Evolutionary Computation, MIT Press, Vol. 3, 1–16.
267
Moscato, Pablo (1989), On Evolution, Search, Optimization, Genetic Algorithms and Martial Arts: Towards Memetic Algorithms, Caltech Concurrent Computation Program, C3P Report 826, (1989).
Park, H.K., and Russell, J.S. (2002).”Cash Flow Forecasting Model Using Moving
Weights of Cost Categories for General Contractors on Jobsite.” First International Conference in the 21st Century, Florida International University, Miami, Florida.
Rosenkrantz, Daniel J.; Stearns, Richard E.; Lewis, Philip M., II (1977), "An Analysis of Several Heuristics for the Traveling Salesman Problem", SIAM Journal on Computing, 563–581.
Shimomura, S.; Sugimoto M.; Haraguchi T.; Matsushita H.; and Nishio Y. (2010). “Investigation of Ant Colony Optimization with Intelligent and Dull Ants.” Proceedings of International Workshop on Nonlinear Circuits, Communication and Signal Processing NCSP'10. Waikiki, Hawaii, 17-20.
Shyu, S.J., Yin, P., and Lin, B.M.T. (2004). “An Ant Colony Optimization Algorithm for the Minimum Weight Vertex Cover Problem.” Annals of Operation Research, Kluwer Academic Publishers, Vol. 131, 283-304.
Solimanpur, M., Vart, P., and Shankar, R. (2004). “Ant colony optimization algorithm to the inter-cell layout problem in cellular manufacturing.” European Journal Of Operational Research, Elsevier, Vol.157, 592 -606.
Walshaw, Chris (2000), A Multilevel Approach to the Travelling Salesman Problem, CMS Press .
Wang, H., Jhuang, C., Su, Y., and Su, T. (2005). “An Immunity-based Ant Colony Optimization algorithm for Solving TSP.” Proceedings of IEEE ICSS2005 International Conference On Systems & Signals. Kaohsiung, Taiwan, 772-775.
Winstone, Wayne L. (1993). “Operations Research Applications and algorithms.” Duxbury Press, California.
Wolpert, D. H. and W. G. Macready (1995). No free-lunch theorems for search. Technical Report 95-02-010, Santa Fe Institute.
Wu, S.A, and Banzhaf, W. (1998). “Introduction to Special Issues: Variable-length Representation and Noncoding Segments for Evolutionary Algorithms”, Evolutionary Computation, MIT Press, Vol. 4.
Yang, S., and Branke, j. (2005). “Evolutionary algorithms for dynamic optimization problems: workshop preface.” Genetic And Evolutionary
268
Computation Conference, Proceedings of the 2005 workshops on Genetic and evolutionary computation, Washington, D.C
Zehng, D.X.M., Ng, S., and Kumaraswamy, M.M (2005). “Applying Pareto Ranking and Niche Formation to Genetic Algorithm-Based Multiobjective Time-Cost Optimization.” Journal of Construction Engineering and Management, ASCE, Vol. 131, No.1, 81-91.