SlideShare a Scribd company logo
arXiv:1003.1409v1 [math.OC] 6 Mar 2010 
Firefly Algorithm, Stochastic Test Functions and Design 
Optimisation 
Xin-She Yang 
Department of Engineering, University of Cambridge, 
Trumpington Street, Cambridge CB2 1PZ, UK 
Email: xy227@cam.ac.uk 
March 9, 2010 
Abstract 
Modern optimisation algorithms are often metaheuristic, and they are very promising in solv-ing 
NP-hard optimization problems. In this paper, we show how to use the recently developed 
Firefly Algorithm to solve nonlinear design problems. For the standard pressure vessel design 
optimisation, the optimal solution found by FA is far better than the best solution obtained 
previously in literature. In addition, we also propose a few new test functions with either sin-gularity 
or stochastic components but with known global optimality, and thus they can be used 
to validate new optimisation algorithms. Possible topics for further research are also discussed. 
To cite this paper as follows: Yang, X. S., (2010) ‘Firefly Algorithm, Stochastic Test Functions 
and Design Optimisation’, Int. J. Bio-Inspired Computation, Vol. 2, No. 2, pp.78–84. 
1 Introduction 
Most optimization problems in engineering are nonlinear with many constraints. Consequently, to 
find optimal solutions to such nonlinear problems requires efficient optimisation algorithms (Deb 
1995, Baeck et al 1997, Yang 2005). In general, optimisation algorithms can be classified into two 
main categories: deterministic and stochastic. Deterministic algorithms such as hill-climbing will 
produce the same set of solutions if the iterations start with the same initial guess. On the other 
hand, stochastic algorithms often produce different solutions even with the same initial starting 
point. However, the final results, though slightly different, will usually converge to the same optimal 
solutions within a given accuracy. 
Deterministic algorithms are almost all local search algorithms, and they are quite efficient in 
finding local optima. However, there is a risk for the algorithms to be trapped at local optima, while 
the global optima are out of reach. A common practice is to introduce some stochastic component 
to an algorithm so that it becomes possible to jump out of such locality. In this case, algorithms 
become stochastic. 
Stochastic algorithms often have a deterministic component and a random component. The 
stochastic component can take many forms such as simple randomization by randomly sampling the 
search space or by random walks. Most stochastic algorithms can be considered as metaheuristic, 
and good examples are genetic algorithms (GA) (Holland 1976, Goldberg 1989) and particle swarm 
optimisation (PSO) (Kennedy and Eberhart 1995, Kennedy et al 2001). Many modern metaheuristic 
algorithms were developed based on the swarm intelligence in nature (Kennedy and Eberhart 1995, 
Dorigo and St¨utzle 2004). New modern metaheuristic algorithms are being developed and begin to 
show their power and efficiency. For example, the Firefly Algorithm developed by the author shows 
its superiority over some traditional algorithms (Yang 2009, Yang 2009, Lukasik and Zak 2009). 
The paper is organized as follows: we will first briefly outline the main idea of the Firefly 
Algorithm in Section 2, and we then describe a few new test functions with singularity and/or 
1
randomness in Section 3. In Section 4, we will use FA to find the optimal solution of a pressure 
vessel design problem. Finally, we will discuss the topics for further studies. 
2 Firefly Algorithm and its Implementation 
2.1 Firefly Algorithm 
The Firefly Algorithm was developed by the author (Yang 2008, Yang 2009), and it was based on 
the idealized behaviour of the flashing characteristics of fireflies. For simplicity, we can idealize these 
flashing characteristics as the following three rules 
• all fireflies are unisex so that one firefly is attracted to other fireflies regardless of their sex; 
• Attractiveness is proportional to their brightness, thus for any two flashing fireflies, the less 
brighter one will move towards the brighter one. The attractiveness is proportional to the 
brightness and they both decrease as their distance increases. If no one is brighter than a 
particular firefly, it moves randomly; 
• The brightness or light intensity of a firefly is affected or determined by the landscape of the 
objective function to be optimised. 
For a maximization problem, the brightness can simply be proportional to the objective function. 
Other forms of brightness can be defined in a similar way to the fitness function in genetic algorithms 
or the bacterial foraging algorithm (BFA) (Gazi and Passino 2004). 
In the FA, there are two important issues: the variation of light intensity and formulation of the 
attractiveness. For simplicity, we can always assume that the attractiveness of a firefly is determined 
by its brightness or light intensity which in turn is associated with the encoded objective function. 
In the simplest case for maximum optimization problems, the brightness I of a firefly at a particular 
location x can be chosen as I(x) / f(x). However, the attractiveness
is relative, it should be seen 
in the eyes of the beholder or judged by the other fireflies. Thus, it should vary with the distance 
rij between firefly i and firefly j. As light intensity decreases with the distance from its source, and 
light is also absorbed in the media, so we should allow the attractiveness to vary with the degree of 
absorption. 
In the simplest form, the light intensity I(r) varies with the distance r monotonically and expo-nentially. 
That is 
I = I0e−
r, (1) 
where I0 is the original light intensity and 
 is the light absorption coefficient. As a firefly’s at-tractiveness 
is proportional to the light intensity seen by adjacent fireflies, we can now define the 
attractiveness
of a firefly by
=
0e−
r2 
, (2) 
where
0 is the attractiveness at r = 0. It is worth pointing out that the exponent 
r can be 
replaced by other functions such as 
rm when m > 0. Schematically, the Firefly Algorithm (FA) 
can be summarised as the pseudo code. 
2
Firefly Algorithm 
Objective function f(x), x = (x1, ..., xd)T 
Initialize a population of fireflies xi (i = 1, 2, ..., n) 
Define light absorption coefficient 
 
while (t <MaxGeneration) 
for i = 1 : n all n fireflies 
for j = 1 : i all n fireflies 
Light intensity Ii at xi is determined by f(xi) 
if (Ij > Ii) 
Move firefly i towards j in all d dimensions 
end if 
Attractiveness varies with distance r via exp[−
r] 
Evaluate new solutions and update light intensity 
end for j 
end for i 
Rank the fireflies and find the current best 
end while 
Postprocess results and visualization 
The distance between any two fireflies i and j at xi and xj can be the Cartesian distance 
rij = ||xi−xj ||2 or the `2-norm. For other applications such as scheduling, the distance can be time 
delay or any suitable forms, not necessarily the Cartesian distance. 
The movement of a firefly i is attracted to another more attractive (brighter) firefly j is deter-mined 
by 
xi = xi +
0e−
r2 
ij (xj − xi) + i, (3) 
where the second term is due to the attraction, while the third term is randomization with the vector 
of random variables i being drawn from a Gaussian distribution. 
For most cases in our implementation, we can take
0 = 1,  2 [0, 1], and 
 = 1. In addition, 
if the scales vary significantly in different dimensions such as −105 to 105 in one dimension while, 
say, −10−3 to 103 along others, it is a good idea to replace  by Sk where the scaling parameters 
Sk(k = 1, ..., d) in the d dimensions should be determined by the actual scales of the problem of 
interest. 
In essence, the parameter 
 characterizes the variation of the attractiveness, and its value is 
crucially important in determining the speed of the convergence and how the FA algorithm behaves. 
In theory, 
 2 [0,1), but in practice, 
 = O(1) is determined by the characteristic/mean length Sk 
of the system to be optimized. In one extreme when 
 ! 0, the attractiveness is constant
=
0. 
This is equivalent to saying that the light intensity does not decrease in an idealized sky. Thus, a 
flashing firefly can be seen anywhere in the domain. Thus, a single (usually global) optimum can 
easily be reached. This corresponds to a special case of particle swarm optimization (PSO). In fact, 
if the inner loop for j is removed and Ij is replaced by the current global best g, FA essentially 
becomes the standard PSO, and, subsequently, the efficiency of this special case is the same as that 
of PSO. On the other hand, if 
 ! 1, we have

More Related Content

What's hot

Improved Firefly Algorithm for Unconstrained Optimization Problems
Improved Firefly Algorithm for Unconstrained Optimization ProblemsImproved Firefly Algorithm for Unconstrained Optimization Problems
Improved Firefly Algorithm for Unconstrained Optimization ProblemsEditor IJCATR
 
Firefly Algorithm, Levy Flights and Global Optimization
Firefly Algorithm, Levy Flights and Global OptimizationFirefly Algorithm, Levy Flights and Global Optimization
Firefly Algorithm, Levy Flights and Global OptimizationXin-She Yang
 
Firefly Algorithms for Multimodal Optimization
Firefly Algorithms for Multimodal OptimizationFirefly Algorithms for Multimodal Optimization
Firefly Algorithms for Multimodal OptimizationXin-She Yang
 
nature inspired algorithms
nature inspired algorithmsnature inspired algorithms
nature inspired algorithmsGaurav Goel
 
Modified Discrete Firefly Algorithm Combining Genetic Algorithm for Traveling...
Modified Discrete Firefly Algorithm Combining Genetic Algorithm for Traveling...Modified Discrete Firefly Algorithm Combining Genetic Algorithm for Traveling...
Modified Discrete Firefly Algorithm Combining Genetic Algorithm for Traveling...TELKOMNIKA JOURNAL
 
Bat Algorithm: Literature Review and Applications
Bat Algorithm: Literature Review and ApplicationsBat Algorithm: Literature Review and Applications
Bat Algorithm: Literature Review and ApplicationsXin-She Yang
 
Bat algorithm and applications
Bat algorithm and applicationsBat algorithm and applications
Bat algorithm and applicationsMd.Al-imran Roton
 
A Hybrid Bat Algorithm
A Hybrid Bat AlgorithmA Hybrid Bat Algorithm
A Hybrid Bat AlgorithmXin-She Yang
 
Bat Algorithm for Multi-objective Optimisation
Bat Algorithm for Multi-objective OptimisationBat Algorithm for Multi-objective Optimisation
Bat Algorithm for Multi-objective OptimisationXin-She Yang
 
The Chaos and Stability of Firefly Algorithm Adjacent Individual
The Chaos and Stability of Firefly Algorithm Adjacent IndividualThe Chaos and Stability of Firefly Algorithm Adjacent Individual
The Chaos and Stability of Firefly Algorithm Adjacent IndividualTELKOMNIKA JOURNAL
 
Whale optimizatio algorithm
Whale optimizatio algorithmWhale optimizatio algorithm
Whale optimizatio algorithmAhmed Fouad Ali
 
Metaheuristic Algorithms: A Critical Analysis
Metaheuristic Algorithms: A Critical AnalysisMetaheuristic Algorithms: A Critical Analysis
Metaheuristic Algorithms: A Critical AnalysisXin-She Yang
 
Bat Algorithm: Literature Review and Applications
Bat Algorithm: Literature Review and ApplicationsBat Algorithm: Literature Review and Applications
Bat Algorithm: Literature Review and ApplicationsXin-She Yang
 
Cuckoo Search Algorithm: An Introduction
Cuckoo Search Algorithm: An IntroductionCuckoo Search Algorithm: An Introduction
Cuckoo Search Algorithm: An IntroductionXin-She Yang
 
Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms Xin-She Yang
 
Ant Colony Optimization: The Algorithm and Its Applications
Ant Colony Optimization: The Algorithm and Its ApplicationsAnt Colony Optimization: The Algorithm and Its Applications
Ant Colony Optimization: The Algorithm and Its Applicationsadil raja
 

What's hot (20)

Improved Firefly Algorithm for Unconstrained Optimization Problems
Improved Firefly Algorithm for Unconstrained Optimization ProblemsImproved Firefly Algorithm for Unconstrained Optimization Problems
Improved Firefly Algorithm for Unconstrained Optimization Problems
 
Firefly Algorithm, Levy Flights and Global Optimization
Firefly Algorithm, Levy Flights and Global OptimizationFirefly Algorithm, Levy Flights and Global Optimization
Firefly Algorithm, Levy Flights and Global Optimization
 
Firefly Algorithms for Multimodal Optimization
Firefly Algorithms for Multimodal OptimizationFirefly Algorithms for Multimodal Optimization
Firefly Algorithms for Multimodal Optimization
 
nature inspired algorithms
nature inspired algorithmsnature inspired algorithms
nature inspired algorithms
 
Firefly algorithm
Firefly algorithmFirefly algorithm
Firefly algorithm
 
Modified Discrete Firefly Algorithm Combining Genetic Algorithm for Traveling...
Modified Discrete Firefly Algorithm Combining Genetic Algorithm for Traveling...Modified Discrete Firefly Algorithm Combining Genetic Algorithm for Traveling...
Modified Discrete Firefly Algorithm Combining Genetic Algorithm for Traveling...
 
Firefly algorithm
Firefly algorithmFirefly algorithm
Firefly algorithm
 
Bat Algorithm: Literature Review and Applications
Bat Algorithm: Literature Review and ApplicationsBat Algorithm: Literature Review and Applications
Bat Algorithm: Literature Review and Applications
 
Bat algorithm and applications
Bat algorithm and applicationsBat algorithm and applications
Bat algorithm and applications
 
A Hybrid Bat Algorithm
A Hybrid Bat AlgorithmA Hybrid Bat Algorithm
A Hybrid Bat Algorithm
 
Bat Algorithm for Multi-objective Optimisation
Bat Algorithm for Multi-objective OptimisationBat Algorithm for Multi-objective Optimisation
Bat Algorithm for Multi-objective Optimisation
 
Bat Algorithm
Bat AlgorithmBat Algorithm
Bat Algorithm
 
Bat algorithm
Bat algorithmBat algorithm
Bat algorithm
 
The Chaos and Stability of Firefly Algorithm Adjacent Individual
The Chaos and Stability of Firefly Algorithm Adjacent IndividualThe Chaos and Stability of Firefly Algorithm Adjacent Individual
The Chaos and Stability of Firefly Algorithm Adjacent Individual
 
Whale optimizatio algorithm
Whale optimizatio algorithmWhale optimizatio algorithm
Whale optimizatio algorithm
 
Metaheuristic Algorithms: A Critical Analysis
Metaheuristic Algorithms: A Critical AnalysisMetaheuristic Algorithms: A Critical Analysis
Metaheuristic Algorithms: A Critical Analysis
 
Bat Algorithm: Literature Review and Applications
Bat Algorithm: Literature Review and ApplicationsBat Algorithm: Literature Review and Applications
Bat Algorithm: Literature Review and Applications
 
Cuckoo Search Algorithm: An Introduction
Cuckoo Search Algorithm: An IntroductionCuckoo Search Algorithm: An Introduction
Cuckoo Search Algorithm: An Introduction
 
Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms
 
Ant Colony Optimization: The Algorithm and Its Applications
Ant Colony Optimization: The Algorithm and Its ApplicationsAnt Colony Optimization: The Algorithm and Its Applications
Ant Colony Optimization: The Algorithm and Its Applications
 

Viewers also liked

Fireflies english powerpoint!!!
Fireflies english powerpoint!!!Fireflies english powerpoint!!!
Fireflies english powerpoint!!!willayyy
 
Particle Swarm Optimization Matlab code Using 50, 5000 Swarms
Particle Swarm Optimization Matlab code Using 50, 5000 SwarmsParticle Swarm Optimization Matlab code Using 50, 5000 Swarms
Particle Swarm Optimization Matlab code Using 50, 5000 SwarmsRaza Shamsi
 
Analysis of Nature-Inspried Optimization Algorithms
Analysis of Nature-Inspried Optimization AlgorithmsAnalysis of Nature-Inspried Optimization Algorithms
Analysis of Nature-Inspried Optimization AlgorithmsXin-She Yang
 
Flower Pollination Algorithm (matlab code)
Flower Pollination Algorithm (matlab code)Flower Pollination Algorithm (matlab code)
Flower Pollination Algorithm (matlab code)Xin-She Yang
 
Integrated Science M3 Pollination
Integrated Science M3 PollinationIntegrated Science M3 Pollination
Integrated Science M3 PollinationeLearningJa
 
Bat algorithm explained. slides ppt pptx
Bat algorithm explained. slides ppt pptxBat algorithm explained. slides ppt pptx
Bat algorithm explained. slides ppt pptxMahdi Atawneh
 
fertilization in plants
fertilization in plantsfertilization in plants
fertilization in plantsUMMACHA
 
Writing Fast MATLAB Code
Writing Fast MATLAB CodeWriting Fast MATLAB Code
Writing Fast MATLAB CodeJia-Bin Huang
 

Viewers also liked (16)

Fireflies 1
Fireflies 1Fireflies 1
Fireflies 1
 
Firefly algorithm
Firefly algorithmFirefly algorithm
Firefly algorithm
 
Fireflies
FirefliesFireflies
Fireflies
 
Firefly
FireflyFirefly
Firefly
 
Fireflies english powerpoint!!!
Fireflies english powerpoint!!!Fireflies english powerpoint!!!
Fireflies english powerpoint!!!
 
Particle Swarm Optimization Matlab code Using 50, 5000 Swarms
Particle Swarm Optimization Matlab code Using 50, 5000 SwarmsParticle Swarm Optimization Matlab code Using 50, 5000 Swarms
Particle Swarm Optimization Matlab code Using 50, 5000 Swarms
 
Analysis of Nature-Inspried Optimization Algorithms
Analysis of Nature-Inspried Optimization AlgorithmsAnalysis of Nature-Inspried Optimization Algorithms
Analysis of Nature-Inspried Optimization Algorithms
 
Flower Pollination Algorithm (matlab code)
Flower Pollination Algorithm (matlab code)Flower Pollination Algorithm (matlab code)
Flower Pollination Algorithm (matlab code)
 
BAT Algorithm
BAT AlgorithmBAT Algorithm
BAT Algorithm
 
Cuckoo search
Cuckoo searchCuckoo search
Cuckoo search
 
Integrated Science M3 Pollination
Integrated Science M3 PollinationIntegrated Science M3 Pollination
Integrated Science M3 Pollination
 
Bat algorithm explained. slides ppt pptx
Bat algorithm explained. slides ppt pptxBat algorithm explained. slides ppt pptx
Bat algorithm explained. slides ppt pptx
 
fertilization in plants
fertilization in plantsfertilization in plants
fertilization in plants
 
Writing Fast MATLAB Code
Writing Fast MATLAB CodeWriting Fast MATLAB Code
Writing Fast MATLAB Code
 
Flower pollination
Flower pollinationFlower pollination
Flower pollination
 
Cuckoo search algorithm
Cuckoo search algorithmCuckoo search algorithm
Cuckoo search algorithm
 

Similar to Firefly Algorithm, Stochastic Test Functions and Design Optimisation

Firefly Algorithm for Unconstrained Optimization
Firefly Algorithm for Unconstrained OptimizationFirefly Algorithm for Unconstrained Optimization
Firefly Algorithm for Unconstrained OptimizationIOSR Journals
 
Research on Chaotic Firefly Algorithm and the Application in Optimal Reactive...
Research on Chaotic Firefly Algorithm and the Application in Optimal Reactive...Research on Chaotic Firefly Algorithm and the Application in Optimal Reactive...
Research on Chaotic Firefly Algorithm and the Application in Optimal Reactive...TELKOMNIKA JOURNAL
 
Eagle Strategy Using Levy Walk and Firefly Algorithms For Stochastic Optimiza...
Eagle Strategy Using Levy Walk and Firefly Algorithms For Stochastic Optimiza...Eagle Strategy Using Levy Walk and Firefly Algorithms For Stochastic Optimiza...
Eagle Strategy Using Levy Walk and Firefly Algorithms For Stochastic Optimiza...Xin-She Yang
 
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTIONA COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTIONijsc
 
A Comparison of Particle Swarm Optimization and Differential Evolution
A Comparison of Particle Swarm Optimization and Differential EvolutionA Comparison of Particle Swarm Optimization and Differential Evolution
A Comparison of Particle Swarm Optimization and Differential Evolutionijsc
 
lost_valley_search.pdf
lost_valley_search.pdflost_valley_search.pdf
lost_valley_search.pdfmanuelabarca9
 
APPLICATION OF PARTICLE SWARM OPTIMIZATION TO MICROWAVE TAPERED MICROSTRIP LINES
APPLICATION OF PARTICLE SWARM OPTIMIZATION TO MICROWAVE TAPERED MICROSTRIP LINESAPPLICATION OF PARTICLE SWARM OPTIMIZATION TO MICROWAVE TAPERED MICROSTRIP LINES
APPLICATION OF PARTICLE SWARM OPTIMIZATION TO MICROWAVE TAPERED MICROSTRIP LINEScseij
 
Application of particle swarm optimization to microwave tapered microstrip lines
Application of particle swarm optimization to microwave tapered microstrip linesApplication of particle swarm optimization to microwave tapered microstrip lines
Application of particle swarm optimization to microwave tapered microstrip linescseij
 
Optimal Estimations of Photometric Redshifts and SED Fitting Parameters
Optimal Estimations of Photometric Redshifts and SED Fitting ParametersOptimal Estimations of Photometric Redshifts and SED Fitting Parameters
Optimal Estimations of Photometric Redshifts and SED Fitting Parametersjulia avez
 
AN IMPROVED MULTIMODAL PSO METHOD BASED ON ELECTROSTATIC INTERACTION USING NN...
AN IMPROVED MULTIMODAL PSO METHOD BASED ON ELECTROSTATIC INTERACTION USING NN...AN IMPROVED MULTIMODAL PSO METHOD BASED ON ELECTROSTATIC INTERACTION USING NN...
AN IMPROVED MULTIMODAL PSO METHOD BASED ON ELECTROSTATIC INTERACTION USING NN...ijaia
 
BP219 class 4 04 2011
BP219 class 4 04 2011BP219 class 4 04 2011
BP219 class 4 04 2011waddling
 
Optimization Of Fuzzy Bexa Using Nm
Optimization Of Fuzzy Bexa Using NmOptimization Of Fuzzy Bexa Using Nm
Optimization Of Fuzzy Bexa Using NmAshish Khetan
 
Parellelism in spectral methods
Parellelism in spectral methodsParellelism in spectral methods
Parellelism in spectral methodsRamona Corman
 
Bp219 2011
Bp219 2011Bp219 2011
Bp219 2011waddling
 

Similar to Firefly Algorithm, Stochastic Test Functions and Design Optimisation (20)

Firefly Algorithm for Unconstrained Optimization
Firefly Algorithm for Unconstrained OptimizationFirefly Algorithm for Unconstrained Optimization
Firefly Algorithm for Unconstrained Optimization
 
M01117578
M01117578M01117578
M01117578
 
Research on Chaotic Firefly Algorithm and the Application in Optimal Reactive...
Research on Chaotic Firefly Algorithm and the Application in Optimal Reactive...Research on Chaotic Firefly Algorithm and the Application in Optimal Reactive...
Research on Chaotic Firefly Algorithm and the Application in Optimal Reactive...
 
1308.3898 1
1308.3898 11308.3898 1
1308.3898 1
 
1308.3898
1308.38981308.3898
1308.3898
 
Eagle Strategy Using Levy Walk and Firefly Algorithms For Stochastic Optimiza...
Eagle Strategy Using Levy Walk and Firefly Algorithms For Stochastic Optimiza...Eagle Strategy Using Levy Walk and Firefly Algorithms For Stochastic Optimiza...
Eagle Strategy Using Levy Walk and Firefly Algorithms For Stochastic Optimiza...
 
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTIONA COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
A COMPARISON OF PARTICLE SWARM OPTIMIZATION AND DIFFERENTIAL EVOLUTION
 
A Comparison of Particle Swarm Optimization and Differential Evolution
A Comparison of Particle Swarm Optimization and Differential EvolutionA Comparison of Particle Swarm Optimization and Differential Evolution
A Comparison of Particle Swarm Optimization and Differential Evolution
 
10.1.1.2.9988
10.1.1.2.998810.1.1.2.9988
10.1.1.2.9988
 
lost_valley_search.pdf
lost_valley_search.pdflost_valley_search.pdf
lost_valley_search.pdf
 
APPLICATION OF PARTICLE SWARM OPTIMIZATION TO MICROWAVE TAPERED MICROSTRIP LINES
APPLICATION OF PARTICLE SWARM OPTIMIZATION TO MICROWAVE TAPERED MICROSTRIP LINESAPPLICATION OF PARTICLE SWARM OPTIMIZATION TO MICROWAVE TAPERED MICROSTRIP LINES
APPLICATION OF PARTICLE SWARM OPTIMIZATION TO MICROWAVE TAPERED MICROSTRIP LINES
 
Application of particle swarm optimization to microwave tapered microstrip lines
Application of particle swarm optimization to microwave tapered microstrip linesApplication of particle swarm optimization to microwave tapered microstrip lines
Application of particle swarm optimization to microwave tapered microstrip lines
 
Optimal Estimations of Photometric Redshifts and SED Fitting Parameters
Optimal Estimations of Photometric Redshifts and SED Fitting ParametersOptimal Estimations of Photometric Redshifts and SED Fitting Parameters
Optimal Estimations of Photometric Redshifts and SED Fitting Parameters
 
AN IMPROVED MULTIMODAL PSO METHOD BASED ON ELECTROSTATIC INTERACTION USING NN...
AN IMPROVED MULTIMODAL PSO METHOD BASED ON ELECTROSTATIC INTERACTION USING NN...AN IMPROVED MULTIMODAL PSO METHOD BASED ON ELECTROSTATIC INTERACTION USING NN...
AN IMPROVED MULTIMODAL PSO METHOD BASED ON ELECTROSTATIC INTERACTION USING NN...
 
BP219 class 4 04 2011
BP219 class 4 04 2011BP219 class 4 04 2011
BP219 class 4 04 2011
 
Optimization Of Fuzzy Bexa Using Nm
Optimization Of Fuzzy Bexa Using NmOptimization Of Fuzzy Bexa Using Nm
Optimization Of Fuzzy Bexa Using Nm
 
Parellelism in spectral methods
Parellelism in spectral methodsParellelism in spectral methods
Parellelism in spectral methods
 
Report
ReportReport
Report
 
Bp219 2011
Bp219 2011Bp219 2011
Bp219 2011
 
Bp219 2011-4.13
Bp219 2011-4.13Bp219 2011-4.13
Bp219 2011-4.13
 

More from Xin-She Yang

A Biologically Inspired Network Design Model
A Biologically Inspired Network Design ModelA Biologically Inspired Network Design Model
A Biologically Inspired Network Design ModelXin-She Yang
 
Multiobjective Bat Algorithm (demo only)
Multiobjective Bat Algorithm (demo only)Multiobjective Bat Algorithm (demo only)
Multiobjective Bat Algorithm (demo only)Xin-She Yang
 
Bat algorithm (demo)
Bat algorithm (demo)Bat algorithm (demo)
Bat algorithm (demo)Xin-She Yang
 
Nature-Inspired Metaheuristic Algorithms
Nature-Inspired Metaheuristic AlgorithmsNature-Inspired Metaheuristic Algorithms
Nature-Inspired Metaheuristic AlgorithmsXin-She Yang
 
Metaheuristics and Optimiztion in Civil Engineering
Metaheuristics and Optimiztion in Civil EngineeringMetaheuristics and Optimiztion in Civil Engineering
Metaheuristics and Optimiztion in Civil EngineeringXin-She Yang
 
A Biologically Inspired Network Design Model
A Biologically Inspired Network Design ModelA Biologically Inspired Network Design Model
A Biologically Inspired Network Design ModelXin-She Yang
 
Introduction to Computational Mathematics (2nd Edition, 2015)
Introduction to Computational Mathematics (2nd Edition, 2015)Introduction to Computational Mathematics (2nd Edition, 2015)
Introduction to Computational Mathematics (2nd Edition, 2015)Xin-She Yang
 
Memetic Firefly algorithm for combinatorial optimization
Memetic Firefly algorithm for combinatorial optimizationMemetic Firefly algorithm for combinatorial optimization
Memetic Firefly algorithm for combinatorial optimizationXin-She Yang
 
Two-Stage Eagle Strategy with Differential Evolution
Two-Stage Eagle Strategy with Differential EvolutionTwo-Stage Eagle Strategy with Differential Evolution
Two-Stage Eagle Strategy with Differential EvolutionXin-She Yang
 
Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...
Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...
Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...Xin-She Yang
 
Are motorways rational from slime mould's point of view?
Are motorways rational from slime mould's point of view?Are motorways rational from slime mould's point of view?
Are motorways rational from slime mould's point of view?Xin-She Yang
 
Review of Metaheuristics and Generalized Evolutionary Walk Algorithm
Review of Metaheuristics and Generalized Evolutionary Walk AlgorithmReview of Metaheuristics and Generalized Evolutionary Walk Algorithm
Review of Metaheuristics and Generalized Evolutionary Walk AlgorithmXin-She Yang
 
Test Problems in Optimization
Test Problems in OptimizationTest Problems in Optimization
Test Problems in OptimizationXin-She Yang
 
Engineering Optimisation by Cuckoo Search
Engineering Optimisation by Cuckoo SearchEngineering Optimisation by Cuckoo Search
Engineering Optimisation by Cuckoo SearchXin-She Yang
 
A New Metaheuristic Bat-Inspired Algorithm
A New Metaheuristic Bat-Inspired AlgorithmA New Metaheuristic Bat-Inspired Algorithm
A New Metaheuristic Bat-Inspired AlgorithmXin-She Yang
 
Fractals in Small-World Networks With Time Delay
Fractals in Small-World Networks With Time DelayFractals in Small-World Networks With Time Delay
Fractals in Small-World Networks With Time DelayXin-She Yang
 
Chaos in Small-World Networks
Chaos in Small-World NetworksChaos in Small-World Networks
Chaos in Small-World NetworksXin-She Yang
 
Cellular Automata, PDEs and Pattern Formation
Cellular Automata, PDEs and Pattern FormationCellular Automata, PDEs and Pattern Formation
Cellular Automata, PDEs and Pattern FormationXin-She Yang
 
Biology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering OptimizationBiology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering OptimizationXin-She Yang
 
Harmony Search as a Metaheuristic Algorithm
Harmony Search as a Metaheuristic AlgorithmHarmony Search as a Metaheuristic Algorithm
Harmony Search as a Metaheuristic AlgorithmXin-She Yang
 

More from Xin-She Yang (20)

A Biologically Inspired Network Design Model
A Biologically Inspired Network Design ModelA Biologically Inspired Network Design Model
A Biologically Inspired Network Design Model
 
Multiobjective Bat Algorithm (demo only)
Multiobjective Bat Algorithm (demo only)Multiobjective Bat Algorithm (demo only)
Multiobjective Bat Algorithm (demo only)
 
Bat algorithm (demo)
Bat algorithm (demo)Bat algorithm (demo)
Bat algorithm (demo)
 
Nature-Inspired Metaheuristic Algorithms
Nature-Inspired Metaheuristic AlgorithmsNature-Inspired Metaheuristic Algorithms
Nature-Inspired Metaheuristic Algorithms
 
Metaheuristics and Optimiztion in Civil Engineering
Metaheuristics and Optimiztion in Civil EngineeringMetaheuristics and Optimiztion in Civil Engineering
Metaheuristics and Optimiztion in Civil Engineering
 
A Biologically Inspired Network Design Model
A Biologically Inspired Network Design ModelA Biologically Inspired Network Design Model
A Biologically Inspired Network Design Model
 
Introduction to Computational Mathematics (2nd Edition, 2015)
Introduction to Computational Mathematics (2nd Edition, 2015)Introduction to Computational Mathematics (2nd Edition, 2015)
Introduction to Computational Mathematics (2nd Edition, 2015)
 
Memetic Firefly algorithm for combinatorial optimization
Memetic Firefly algorithm for combinatorial optimizationMemetic Firefly algorithm for combinatorial optimization
Memetic Firefly algorithm for combinatorial optimization
 
Two-Stage Eagle Strategy with Differential Evolution
Two-Stage Eagle Strategy with Differential EvolutionTwo-Stage Eagle Strategy with Differential Evolution
Two-Stage Eagle Strategy with Differential Evolution
 
Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...
Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...
Accelerated Particle Swarm Optimization and Support Vector Machine for Busine...
 
Are motorways rational from slime mould's point of view?
Are motorways rational from slime mould's point of view?Are motorways rational from slime mould's point of view?
Are motorways rational from slime mould's point of view?
 
Review of Metaheuristics and Generalized Evolutionary Walk Algorithm
Review of Metaheuristics and Generalized Evolutionary Walk AlgorithmReview of Metaheuristics and Generalized Evolutionary Walk Algorithm
Review of Metaheuristics and Generalized Evolutionary Walk Algorithm
 
Test Problems in Optimization
Test Problems in OptimizationTest Problems in Optimization
Test Problems in Optimization
 
Engineering Optimisation by Cuckoo Search
Engineering Optimisation by Cuckoo SearchEngineering Optimisation by Cuckoo Search
Engineering Optimisation by Cuckoo Search
 
A New Metaheuristic Bat-Inspired Algorithm
A New Metaheuristic Bat-Inspired AlgorithmA New Metaheuristic Bat-Inspired Algorithm
A New Metaheuristic Bat-Inspired Algorithm
 
Fractals in Small-World Networks With Time Delay
Fractals in Small-World Networks With Time DelayFractals in Small-World Networks With Time Delay
Fractals in Small-World Networks With Time Delay
 
Chaos in Small-World Networks
Chaos in Small-World NetworksChaos in Small-World Networks
Chaos in Small-World Networks
 
Cellular Automata, PDEs and Pattern Formation
Cellular Automata, PDEs and Pattern FormationCellular Automata, PDEs and Pattern Formation
Cellular Automata, PDEs and Pattern Formation
 
Biology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering OptimizationBiology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering Optimization
 
Harmony Search as a Metaheuristic Algorithm
Harmony Search as a Metaheuristic AlgorithmHarmony Search as a Metaheuristic Algorithm
Harmony Search as a Metaheuristic Algorithm
 

Recently uploaded

2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edgePaco Orozco
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdfAhmedHussein950959
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdfKamal Acharya
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Aryaabh.arya
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerapareshmondalnita
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdfKamal Acharya
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Krakówbim.edu.pl
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdfKamal Acharya
 
Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdfKamal Acharya
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfAbrahamGadissa
 
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docxThe Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docxCenterEnamel
 
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data StreamKIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data StreamDr. Radhey Shyam
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industriesMuhammadTufail242431
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxwendy cai
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringC Sai Kiran
 
Scaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltageScaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltageRCC Institute of Information Technology
 
Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdfKamal Acharya
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwoodseandesed
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
 

Recently uploaded (20)

2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdf
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Kraków
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docxThe Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
The Ultimate Guide to External Floating Roofs for Oil Storage Tanks.docx
 
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data StreamKIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
 
Scaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltageScaling in conventional MOSFET for constant electric field and constant voltage
Scaling in conventional MOSFET for constant electric field and constant voltage
 
Pharmacy management system project report..pdf
Pharmacy management system project report..pdfPharmacy management system project report..pdf
Pharmacy management system project report..pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 

Firefly Algorithm, Stochastic Test Functions and Design Optimisation

  • 1. arXiv:1003.1409v1 [math.OC] 6 Mar 2010 Firefly Algorithm, Stochastic Test Functions and Design Optimisation Xin-She Yang Department of Engineering, University of Cambridge, Trumpington Street, Cambridge CB2 1PZ, UK Email: xy227@cam.ac.uk March 9, 2010 Abstract Modern optimisation algorithms are often metaheuristic, and they are very promising in solv-ing NP-hard optimization problems. In this paper, we show how to use the recently developed Firefly Algorithm to solve nonlinear design problems. For the standard pressure vessel design optimisation, the optimal solution found by FA is far better than the best solution obtained previously in literature. In addition, we also propose a few new test functions with either sin-gularity or stochastic components but with known global optimality, and thus they can be used to validate new optimisation algorithms. Possible topics for further research are also discussed. To cite this paper as follows: Yang, X. S., (2010) ‘Firefly Algorithm, Stochastic Test Functions and Design Optimisation’, Int. J. Bio-Inspired Computation, Vol. 2, No. 2, pp.78–84. 1 Introduction Most optimization problems in engineering are nonlinear with many constraints. Consequently, to find optimal solutions to such nonlinear problems requires efficient optimisation algorithms (Deb 1995, Baeck et al 1997, Yang 2005). In general, optimisation algorithms can be classified into two main categories: deterministic and stochastic. Deterministic algorithms such as hill-climbing will produce the same set of solutions if the iterations start with the same initial guess. On the other hand, stochastic algorithms often produce different solutions even with the same initial starting point. However, the final results, though slightly different, will usually converge to the same optimal solutions within a given accuracy. Deterministic algorithms are almost all local search algorithms, and they are quite efficient in finding local optima. However, there is a risk for the algorithms to be trapped at local optima, while the global optima are out of reach. A common practice is to introduce some stochastic component to an algorithm so that it becomes possible to jump out of such locality. In this case, algorithms become stochastic. Stochastic algorithms often have a deterministic component and a random component. The stochastic component can take many forms such as simple randomization by randomly sampling the search space or by random walks. Most stochastic algorithms can be considered as metaheuristic, and good examples are genetic algorithms (GA) (Holland 1976, Goldberg 1989) and particle swarm optimisation (PSO) (Kennedy and Eberhart 1995, Kennedy et al 2001). Many modern metaheuristic algorithms were developed based on the swarm intelligence in nature (Kennedy and Eberhart 1995, Dorigo and St¨utzle 2004). New modern metaheuristic algorithms are being developed and begin to show their power and efficiency. For example, the Firefly Algorithm developed by the author shows its superiority over some traditional algorithms (Yang 2009, Yang 2009, Lukasik and Zak 2009). The paper is organized as follows: we will first briefly outline the main idea of the Firefly Algorithm in Section 2, and we then describe a few new test functions with singularity and/or 1
  • 2. randomness in Section 3. In Section 4, we will use FA to find the optimal solution of a pressure vessel design problem. Finally, we will discuss the topics for further studies. 2 Firefly Algorithm and its Implementation 2.1 Firefly Algorithm The Firefly Algorithm was developed by the author (Yang 2008, Yang 2009), and it was based on the idealized behaviour of the flashing characteristics of fireflies. For simplicity, we can idealize these flashing characteristics as the following three rules • all fireflies are unisex so that one firefly is attracted to other fireflies regardless of their sex; • Attractiveness is proportional to their brightness, thus for any two flashing fireflies, the less brighter one will move towards the brighter one. The attractiveness is proportional to the brightness and they both decrease as their distance increases. If no one is brighter than a particular firefly, it moves randomly; • The brightness or light intensity of a firefly is affected or determined by the landscape of the objective function to be optimised. For a maximization problem, the brightness can simply be proportional to the objective function. Other forms of brightness can be defined in a similar way to the fitness function in genetic algorithms or the bacterial foraging algorithm (BFA) (Gazi and Passino 2004). In the FA, there are two important issues: the variation of light intensity and formulation of the attractiveness. For simplicity, we can always assume that the attractiveness of a firefly is determined by its brightness or light intensity which in turn is associated with the encoded objective function. In the simplest case for maximum optimization problems, the brightness I of a firefly at a particular location x can be chosen as I(x) / f(x). However, the attractiveness
  • 3. is relative, it should be seen in the eyes of the beholder or judged by the other fireflies. Thus, it should vary with the distance rij between firefly i and firefly j. As light intensity decreases with the distance from its source, and light is also absorbed in the media, so we should allow the attractiveness to vary with the degree of absorption. In the simplest form, the light intensity I(r) varies with the distance r monotonically and expo-nentially. That is I = I0e− r, (1) where I0 is the original light intensity and is the light absorption coefficient. As a firefly’s at-tractiveness is proportional to the light intensity seen by adjacent fireflies, we can now define the attractiveness
  • 5. =
  • 7. 0 is the attractiveness at r = 0. It is worth pointing out that the exponent r can be replaced by other functions such as rm when m > 0. Schematically, the Firefly Algorithm (FA) can be summarised as the pseudo code. 2
  • 8. Firefly Algorithm Objective function f(x), x = (x1, ..., xd)T Initialize a population of fireflies xi (i = 1, 2, ..., n) Define light absorption coefficient while (t <MaxGeneration) for i = 1 : n all n fireflies for j = 1 : i all n fireflies Light intensity Ii at xi is determined by f(xi) if (Ij > Ii) Move firefly i towards j in all d dimensions end if Attractiveness varies with distance r via exp[− r] Evaluate new solutions and update light intensity end for j end for i Rank the fireflies and find the current best end while Postprocess results and visualization The distance between any two fireflies i and j at xi and xj can be the Cartesian distance rij = ||xi−xj ||2 or the `2-norm. For other applications such as scheduling, the distance can be time delay or any suitable forms, not necessarily the Cartesian distance. The movement of a firefly i is attracted to another more attractive (brighter) firefly j is deter-mined by xi = xi +
  • 9. 0e− r2 ij (xj − xi) + i, (3) where the second term is due to the attraction, while the third term is randomization with the vector of random variables i being drawn from a Gaussian distribution. For most cases in our implementation, we can take
  • 10. 0 = 1, 2 [0, 1], and = 1. In addition, if the scales vary significantly in different dimensions such as −105 to 105 in one dimension while, say, −10−3 to 103 along others, it is a good idea to replace by Sk where the scaling parameters Sk(k = 1, ..., d) in the d dimensions should be determined by the actual scales of the problem of interest. In essence, the parameter characterizes the variation of the attractiveness, and its value is crucially important in determining the speed of the convergence and how the FA algorithm behaves. In theory, 2 [0,1), but in practice, = O(1) is determined by the characteristic/mean length Sk of the system to be optimized. In one extreme when ! 0, the attractiveness is constant
  • 11. =
  • 12. 0. This is equivalent to saying that the light intensity does not decrease in an idealized sky. Thus, a flashing firefly can be seen anywhere in the domain. Thus, a single (usually global) optimum can easily be reached. This corresponds to a special case of particle swarm optimization (PSO). In fact, if the inner loop for j is removed and Ij is replaced by the current global best g, FA essentially becomes the standard PSO, and, subsequently, the efficiency of this special case is the same as that of PSO. On the other hand, if ! 1, we have
  • 13. (r) ! (r), which is a Dirac -function. This means that the attractiveness is almost zero in the sight of other fireflies, or the fireflies are short-sighted. This is equivalent to the case where the fireflies fly in a very foggy region randomly. No other fireflies can be seen, and each firefly roams in a completely random way. Therefore, this corresponds to the completely random search method. So partly controls how the algorithm behaves. It is also possible to adjust so that multiple optima can be found at the same during iterations. 2.2 Numerical Examples From the pseudo code, it is relatively straightforward to implement the Firefly Algorithm using a popular programming language such as Matlab. We have tested it against more than a dozen test 3
  • 14. −5 0 5 −5 0 3 2 1 0 5 Figure 1: Four global maxima at (±1/2,±1/2). functions such as the Ackley function f(x) = −20 exp h − 1 5 vuut 1 d d X i=1 x2i i −exp[ 1 d d X i=1 cos(2xi)] + 20 + e, (4) which has a unique global minimum f = 0 at (0, 0, ..., 0). From a simple parameter studies, we concluded that, in our simulations, we can use the following values of parameters = 0.2, = 1, and
  • 15. 0 = 1. As an example, we now use the FA to find the global maxima of the following function f(x) = d X i=1 |xi| exp − d X i=1 x2i , (5) with the domain −10 xi 10 for all (i = 1, 2, ..., d) where d is the number of dimensions. This function has multiple global optima. In the case of d = 2, we have 4 equal maxima f = 1/pe 0.6065 at (1/2, 1/2), (1/2,−1/2), (−1/2, 1/2) and (−1/2,−1/2) and a unique global minimum at (0, 0). The four peaks are shown in Fig. 1, and these global maxima can be found using the implemented Firefly Algorithms after about 500 function evaluations. This corresponds to 25 fireflies evolving for 20 generations or iterations. The initial locations of 25 fireflies are shown Fig. 2 and their final locations after 20 iterations are shown in Fig. 3. We can see that the Firefly Algorithm is very efficient. Recently studies also confirmed its promising power in solving nonlinear constrained optimization tasks (Yang 2009, Lukasik and Zak 2009). 3 New Test Functions The literature about test functions is vast, often with different collections of test functions for validating new optimisation algorithms. Test functions such as Rosenbrock’s banana function and Ackley’s function mentioned earlier are well-known in the optimisation literature. Almost all these 4
  • 16. 5 0 −5 −5 0 5 Figure 2: Initial locations of 25 fireflies. 5 0 −5 −5 0 5 Figure 3: Final locations after 20 iterations. 5
  • 17. test functions are deterministic and smooth. In the rest of this paper, we first propose a few new test functions which have some singularity and/or stochastic components. Some of the formulated functions have stochastic components but their global optima are deterministic. Then, we will use the Firefly Algorithm to find the optimal solutions of some of these new functions. The first test function we have designed is a multimodal nonlinear function f(x) = he−Pd i=1 (xi/
  • 18. )2m − 2e−Pd i=1 (xi−)2i · d Y i=1 cos2 xi, m = 5, (6) which looks like a standing-wave function with a defect (see Fig. 4). It has many local minima and the unique global minimum f = −1 at x = (, , ..., ) for
  • 19. = 15 within the domain −20 xi 20 for i = 1, 2, ..., d. By using the Firefly Algorithm with 20 fireflies, it is easy to find the global minimum in just about 15 iterations. The results are shown in Fig. 5 and Fig. 6. As most test functions are smooth, the next function we have formulated is also multimodal but it has a singularity f(x) = d X i=1 |xi| · exp h − d X i=1 sin(x2i )i, (7) which has a unique global minimum f = 0 at x = (0, 0, ..., 0) in the domain −2 xi 2 where i = 1, 2, ..., d. At a first look, this function has some similarity with function (5) discussed earlier. However, this function is not smooth, and its derivatives are not well defined at the optimum (0, 0, ..., 0). The landscape of this forest-like function is shown in Fig. 7 and its 2D contour is displayed in Fig. 8. Almost all existing test functions are deterministic. Now let us design a test function with stochastic components f(x, y) = −5e−
  • 20. [(x−)2+(y−)2] K − Xj =1 K X i=1 ije−[(x−i)2+(y−j)2], (8) where ,
  • 21. 0 are scaling parameters, which can often be taken as =
  • 22. = 1. Here the random variables ij (i, j = 1, ...,K) obey a uniform distribution ij Unif[0,1]. The domain is 0 x, y K and K = 10. This function has K2 local valleys at grid locations and the fixed global minimum at x = (, ). It is worth pointing that the minimum fmin is random, rather than a fixed value; it may vary from −(K2 + 5) to −5, depending and
  • 23. as well as the random numbers drawn. For stochastic test functions, most deterministic algorithms such as hill-climbing would simply fail due to the fact that the landscape is constantly changing. However, metaheuristic algorithms could still be robust in dealing with such functions. The landscape of a realization of this stochastic function is shown in Fig. 9. Using the Firefly Algorithm, we can find the global minimum in about 15 iterations for n = 20 fireflies. That is, the total number of function evaluations is just 300. This is indeed very efficient and robust. The initial locations of the fireflies are shown in Fig. 10 and the final results are shown Fig.11. Furthermore, we can also design a relative generic stochastic function which is both stochastic and non-smooth f(x) = d X i=1 i
  • 24.
  • 25.
  • 26. xi
  • 27.
  • 28.
  • 29. i , −5 xi 5, (9) where i (i = 1, 2, ..., d) are random variables which are uniformly distributed in [0, 1]. That is, i Unif[0, 1]. This function has the unique minimum f = 0 at x = (0, 0, ..., 0) which is also singular. We found that for most problems n = 15 to 50 would be sufficient. For tougher problems, larger n can be used, though excessively large n should not be used unless there is no better alternative, as it is more computationally extensive for large n. 6
  • 30. −5 0 5 −5 0 5 1 0 −1 Figure 4: The standing wave function for two independent variables with the global minimum f = −1 at (, ). −5 0 5 6 4 2 0 −2 −4 −6 Figure 5: The initial locations of 20 fireflies. 7
  • 31. −5 0 5 6 4 2 0 −2 −4 −6 Figure 6: Final locations after 15 iterations. −5 0 5 −5 0 300 200 100 0 5 Figure 7: The landscape of function (7). 8
  • 32. 5 0 −5 −5 0 5 Figure 8: Contour of function (7). 0 5 10 0 5 0 −5 −10 10 Figure 9: The 2D Stochastic function for K = 10 with a unique global minimum at (, ), though the value of this global minimum is somewhat stochastic. 9
  • 33. 10 8 6 4 2 0 0 2 4 6 8 10 Figure 10: The initial locations of 20 fireflies. 10 8 6 4 2 0 0 2 4 6 8 10 Figure 11: The final locations of 20 fireflies after 15 iterations, converging into (, ). 10
  • 34. 4 Engineering Applications Now we can apply the Firefly Algorithm to carry out various design optimisation tasks. In principle, any optimization problems that can be solved by genetic algorithms and particle swarm optimisation can also be solved by the Firefly Algorithm. For simplicity to demonstrate its effectiveness in real-world optimisation, we use the FA to find the optimal solution of the standard but quite difficult pressure design optimisation problem. Pressure vessels are literally everywhere such as champagne bottles and gas tanks. For a given volume and working pressure, the basic aim of designing a cylindrical vessel is to minimize the total cost. Typically, the design variables are the thickness d1 of the head, the thickness d2 of the body, the inner radius r, and the length L of the cylindrical section (Coello 2000, Cagnina et al 2008). This is a well-known test problem for optimization and it can be written as minimize f(x) = 0.6224d1rL + 1.7781d2r2 +3.1661d21 L + 19.84d21 r, (10) subject to the following constraints g1(x) = −d1 + 0.0193r 0 g2(x) = −d2 + 0.00954r 0 g3(x) = −r2L − 4 3 r3 + 1296000 0 g4(x) = L − 240 0. (11) The simple bounds are 0.0625 d1, d2 99 × 0.0625, (12) and 10.0 r, L 200.0. (13) Recently, Cagnina et al (2008) used an efficient particle swarm optimiser to solve this problem and they found the best solution f 6059.714, (14) at x (0.8125, 0.4375, 42.0984, 176.6366). (15) This means the lowest price is about $6059.71. Using the Firefly Algorithm, we have found an even better solution with 40 fireflies after 20 iterations, and we have obtained x (0.7782, 0.3846, 40.3196, 200.0000)T, (16) with fmin 5885.33, (17) which is significantly lower or cheaper than the solution f 6059.714 obtained by Cagnina et al (2008). This clearly shows how efficient and effective the Firefly Algorithm could be. Obviously, further applications are highly needed to see how it may behave for solving various tough engineering optimistion problems. 5 Conclusions We have successfully used the Firefly Algorithm to carry out nonlinear design optimisation. We first validated the algorithms using some standard test functions. After designing some new test functions with singularity and stochastic components, we then used the FA to solve these unconstrained stochastic functions. We also applied it to find a better global solution to the pressure vessel design 11
  • 35. optimisation. The optimisation results imply that the Firefly Algorithm is potentially more powerful than other existing algorithms such as particle swarm optimisation. The convergence analysis of metaheuristic algorithms still requires some theoretical framework. At the moment, it still lacks of a general framework for such analysis. Fortunately, various studies started to propose a feasible measure for comparing algorithm performance. For example, Shilane et al (2008) suggested a framework for evaluating statistical performance of evolutionary algorithms. Obviously, more comparison studies are highly needed so as to identify the strength and weakness of current metaheuristic algorithms. Ultimately, even better optimisation algorithms may emerge. References [1] Baeck, T., Fogel, D. B., Michalewicz, Z. (1997) Handbook of Evolutionary Computation, Taylor Francis. [2] Cagnina, L. C., Esquivel, S. C., Coello, C. A. (2008) ‘Solving engineering optimization problems with the simple constrained particle swarm optimizer’, Informatica, 32, 319-326 (2008). [3] Coello, C. A. (2000) ‘Use of a self-adaptive penalty approach for engineering optimization prob-lems’, Computers in Industry, 41, 113-127. [4] Deb, K. (1995) Optimisation for Engineering Design, Prentice-Hall, New Delhi. [5] Dorigo, M. and St¨utzle, T. (2004) Ant Colony Optimization, MIT Press. [6] Gazi, K., and Passino, K. M. (2004) ‘Stability analysis of social foraging swarms’, IEEE Trans. Sys. Man. Cyber. Part B - Cybernetics, 34, 539-557. [7] Goldberg, D. E. (1989) Genetic Algorithms in Search, Optimisation and Machine Learning, Reading, Mass.: Addison Wesley. [8] Holland, J. H. (1975) Adaptation in Natural and Artificial Systems, University of Michigan Press, Ann Arbor. [9] Kennedy, J. and Eberhart, R. C. (1995) ‘Particle swarm optimization’, Proc. of IEEE Interna-tional Conference on Neural Networks, Piscataway, NJ. pp. 1942-1948. [10] Kennedy J., Eberhart R., Shi Y. (2001), Swarm intelligence, Academic Press. [11] Lukasik, S. and Zak, S. (2009) ‘Firefly algorithm for continuous constrained optimization tasks’, ICCCI 2009, Lecture Notes in Artificial Intelligence (Eds. N. T. Ngugen, R. Kowalczyk, S. M. Chen), 5796, pp. 97-100. [12] Shilane, D., Martikainen, J., Dudoit, S., Ovaska, S. J. (2008) ‘A general framework for statistical performance comparison of evolutionary computation algorithms’, Information Sciences: an Int. Journal, 178, 2870-2879. [13] Yang, X. S. (2005) ‘Biology-derived algorithms in engineering optimization’, in Handbook of Bioinspired Algorithms and Applications (eds S. Olarius A. Y. Zomaya), Chapman Hall / CRC. [14] Yang, X. S. (2008) Nature-Inspired Metaheuristic Algorithms, Luniver Press, UK. [15] Yang, X. S. (2009) ‘Firefly algorithms for multimodal optimization’, in: Stochastic Algorithms: Foundations and Appplications (Eds O. Watanabe and T. Zeugmann), SAGA 2009, Lecture Notes in Computer Science, 5792, Springer-Verlag, Berlin, pp. 169-178. 12