An Improved Firefly Algorithm Based on Newton's Law of ... · Algorithm based on Newton's law of...
Transcript of An Improved Firefly Algorithm Based on Newton's Law of ... · Algorithm based on Newton's law of...
-
An Improved Firefly Algorithm Based on
Newton's Law of Universal Gravitation
Yi lingzhi1, Xiao Weihong1, Yu Wenxin2, and Wang Genpin3
1 Hunan Province Cooperative Innovation Center for Wind Power Equipment and Energy Conversion, College of
Information Engineering, Xiangtan University. Xiangtan, Hunan province 411105, P. R. China 2
Hunan University of Science and Technology, Xiangtan, Hunan province 411201, P. R. China 3
Shenzhen Polytechnic, Shenzhen, Guangdong province 518000, P. R. China
E-mail: [email protected]
Abstract—Firefly Algorithm (FA) is a novel swarm
intelligence optimization algorithm. Due to the FA have low
precision defects, easily falling into local optimum value
when solving the global optimal value, an improved Firefly
Algorithm based on Newton's law of universal gravitation
was proposed in the paper. The proposed algorithm cites the
law of gravity, which builds a new evolutionary computation
model by using gravity as attractiveness between fireflies.
When the population falls into the local optimal region, the
proposed algorithm can improve firefly's diversity through
Gaussian mutation. Besides, the algorithm is convergent
with probability 1. With the experimental results on 4
standard test functions, the results show that the proposed
method is superior to FA in computational precision and
convergence rate.
Index Terms—optimal solution, Firefly Algorithm (FA),
gravity, Gaussian mutation
I. INTRODUCTION
Inspired by various natural phenomena in nature,
people put forward a series of intelligent optimization
algorithms to solve the complex optimization problem.
The swarm intelligence optimization algorithm includes:
ant colony optimization algorithm, particle swarm
optimization algorithm, artificial bee colony algorithm
and Firefly Algorithm [1]-[3]. In 2008, a Cambridge
scholar Yang proposed a swarm intelligence optimization
algorithm named Firefly Algorithm (FA) by studying the
mutual attraction and movement process of the fireflies
[4]. In this algorithm, attractiveness is proportional to
their brightness, thus for any two fireflies, the less
brighter one will move towards the brighter one. After
many groups of movements, all fireflies will be gathered
near the brightest fireflies, thus completing the final
search. Due to its simple structure, fewer parameters and
stronger searching ability, the algorithm has been
gradually applied in many fields, such as multi-modal
optimization problem, automatic control, price prediction
and image compression [5]-[8]. The application examples
show that FA can deal with optimization tasks more
naturally and efficiently, but some defects still exist in the
algorithm itself [9], [10]. Because the optimization ability
Manuscript received August 10, 2017; revised November 27, 2017.
of Firefly Algorithm depends on the interaction and
influence of fireflies, and the individual itself lacks the
mutation mechanism, so it is difficult for firefly particles
to jump out of the local optimum region. Especially in the
early stage of evolution, the super individuals in the
population tend to attract other individuals to gather
around them rapidly, which make the population diversity
decline greatly. At the late period of evolution, most of
the fireflies gathered near the optimal value, and the
population was prone to stagnation because of the loss of
further evolutionary power. In recent years, scholars have
made a lot of improvements on it.
Feng et al. proposed a kind of FA based on chaos
theory of population dynamics, which uses cubic
mapping chaos to initialize the firefly initial position and
achieves good results with better accuracy and faster
calculation speed [11]. Wang Mingbo et al. proposed a
new kind of swarm optimization based on simulated
annealing algorithm (MFA_SA) to overcome the
shortcoming of being easy to fall into local optimal
solution of the basic FA [12]. Gandomi et al. proposed a
new FA called FA with chaos (FAC), which introduced
different chaos maps into FA to adjust the control
parameters [13]. Fu Qiang et al. proposed a new FA
called FA based on improved evolutionism (IEFA) to
overcome the shortcoming of FA by increase the
attraction effect of the population optimal value on the
individual in the group [14].
In this paper, an improved Firefly Algorithm based on
Newton's law of universal gravitation was proposed to
solve the problems of FA. With the experimental results
on 4 standard test functions, the results show that this
method is superior to FA in computational precision and
convergence rate, and effectively solves the local
convergence of Firefly Algorithm.
II. FIREFLY ALGORITHM
In the Firefly Algorithm, there are two important issues:
brightness and attraction. The firefly brightness reflects
the location superiority and decides the moving direction.
The degree of attraction determines the firefly‟s moving
distance. The brightness and the degree of attraction are
constantly updated, so as to achieve the goal of
219© 2017 J. Adv. Inf. Technol.
Journal of Advances in Information Technology Vol. 8, No. 4, November 2017
doi: 10.12720/jait.8.4.219-224
-
optimization. Mathematical description of FA described
below [15], [16].
Relative brightness is defined by
0ij
rI I e
(1)
where: 0I is the original light intensity, it determined by
the objective function. is the light absorption
coefficient, and ijr stands for the spatial distance between
firefly i and j . The intensity will gradually weakened
with increasing distance ijr and media absorption, thus the
light absorption coefficient is set to reflect this
characteristic.
Attraction is defined by
0ij
re
(2)
where 0 is the original attraction value.
Location is updated by
( 1) ( ) ( ( ) ( )) ( 1/ 2)i i j ix t x t x t x t rand (3)
where: xi and yi is the position of firefly i and j in the
space, and t indicates generation index. The parameter is the step factor, which is a random number with the
range [0, 1]; rand is a random factor which is uniformly
distributed on [0,1]. (rand-1/2) is the disturbance term, which can enhance search range and prevent the situation
that particles fall into local best.
TABLE I. PSEUDO CODE OF THE BASIC STEPS OF THE LOGFA
Improved Firefly Algorithm based on Newton's law of
universal gravitation
Objective function )(xf , Tdxxx ),...,( 1
Generate initial population of fireflies ),...,2,1( nixi Calculate the quality im
at ix according to Eq.6;
while (t < MaxGeneration)
for i=1: N all N fireflies
for j=1: N all N fireflies
if ji mm
Move firefly i towards j ;
end if
Evaluate new solutions and update the quality im
end for i
end for j
Rank the fireflies and find the current global best solution
end while
Post-process the results
III. IMPROVED FIREFLY ALGORITHM BASED ON
NEWTON'S LAW OF UNIVERSAL GRAVITATION (LOGFA)
Although FA has been gradually applied in many
fields, but some defects still exist in the algorithm itself,
such as slow convergence speed, easiness to stagnation,
premature convergence and low precision. In order to
solve this problem, this paper has made two
improvements. Firstly, we build a new evolutionary
computation model by using gravity as attractiveness
between fireflies, which makes the optimization
algorithm not only keep the evolutionary advantage of the
original algorithm, but also improve the accuracy of the
algorithm and convergence ability. Especially, the
algorithm still has higher precision and convergence
ability when the search range and initial value are larger.
Secondly, when the population falls into the local optimal
region, we can improve firefly's diversity through
Gaussian mutation. The basic steps of the LOGFA are
summarized by the pseudo code listed in Table I. Specific
measures for improvement are as follows.
A. Gravitational Evolution Model of LOGFA
In the Gravitational evolutionary model, the attraction
between the firefly particles is gravitation, and the motion
of the particles follows a certain degree of dynamical law.
The object with the highest mass occupies the best
position, that is, target value is the best. Under the
influence of attraction, smaller objects move toward
greater objects. In order to balance the global searching
ability in the early stage of evolution and the fast
convergence of the later stage, perturbation term with
step size contraction is introduced in the process of
position updating. In the perturbation term, the step factor
is decreasing by generation. If the position function value
after the location update is worse than the original
position, replace the new position with the original
position to ensure the search time and the accuracy of the
solution. The specific definition is as follows:
The gravity between firefly i and j is defined by
2
(t) (t)i jij
ij
m mF G
r (4)
where: ijr stands for the spatial distance between firefly i
and j, and ijm indicates the quality of the firefly i. G is the
gravitational constant of the time t, which is defined by
2
0ijreGG
(5)
where 0G is the original gravitational constant.
The quality im is calculated by
)()(
)()(
iworstibest
iworstii
xfxf
xfxfm
(6)
where: )( ixf indicates the target fitness value of the
firefly i at ix . If it is to solve the minimum problem,
)(min)(},..,2,1{
ini
ibest xfxf
, )(max)(},..,2,1{
ini
iworst xfxf
.
Conversely, if it is to solve the maximum problem, then
)(max)(},..,2,1{
ini
ibest xfxf
, )(min)(},..,2,1{
ini
iworst xfxf
.
Location is updated by
*
)2
1(
2
1)()1(
)(
)(
randatxtx
tm
tFa
iii
i
iji
(7)
220© 2017 J. Adv. Inf. Technol.
Journal of Advances in Information Technology Vol. 8, No. 4, November 2017
-
where: rand is a random factor which is uniformly
distributed on [0, 1]. The parameter is the step factor, which is a random number with the range [0, 1]. The
parameter is the Step size contraction factor, which is a constant with the range [0.95, 1].
B. Gaussian Variation Strategy
If the firefly population does not evolve in many
iterations, it is judged that it has fallen into the local
optimal region. At this time, the Gaussian variation factor
is used to disturb the firefly population and restore its
evolutionary ability. Operation is as follows:
Firstly, all the fireflies in accordance with the size of
fitness sort. Then the worst firefly population is replaced
with the optimal firefly, resulting in an intermediate
population. Finally, the middle population is subjected to
Gaussian mutation [17] according to (8).
)1,0(Nxxx iii (8)
where )1,0(N is random vector for the Gaussian
distribution with mathematical expectation of 0 and
variance of 1.
In order to ensure that the individuals of the firefly
population are always searching effectively in the search
space, the domain constraints are processed for all the
firefly individuals. This measure can effectively pull the
individual back to the specified space when the individual
is out of the specified range. The domain constraint
processing is defined by
maxmax
minmin
xxx
xxxx
i
ii (9)
where: minx is the lower limit of the search space, and
maxx is the upper limit of the search space.
C. Convergence Analysis of LOGFA
In order to analyze the convergence of LOGFA, this
paper gives the analysis and proof based on the criteria
proposed by Solis [18].
Condition 1: )()),(( xfxDf , if S ,then
)()),(( fxDf ,
where: f is the target function, is the solution of the
algorithm in the iterative process. S is feasible solution
space, and ),( xD is the iterative result of the algorithm
at the 1t times.
Condition 2: 0)(, DvSD and 0))(1(
0
k
k Du .
where: )(Dv is the Lebesgue measure of D , )(Duk is the
probability measure ofthe algorithm‟s solution
in iteration k .
Theorem 1. Assume that f is measurable and
measurable space S is the measurable subset of nR . If the algorithm satisfies condition 1 and condition 2, then
1)(lim *
SXp kk
, that is, the algorithm is convergent
with probability 1. Where, *S is the global best position.
Theorem 2. LOGFA converges to the global optimal
solution with probability 1.
Proof.
According to the description of LOGFA, firefly after
each update position will not be worse than the original
position. If S , then )()),(( fxDf . In other
words, condition 1 is satisfied.
Assume that tkL is solution support set of firefly k in
the t-th iterative process. Fireflies are gathered in a
certain area with the increase of iteration times, and the
population was prone to stagnation because of the loss of
further evolutionary power. Therefore )(tkLv will
gradually decrease, then )()(1
SvSLvN
k
tk
, that is,
condition 2 is not satisfied. But the algorithm will
produces a variant solution when evolution stagnates, let
PLtk , then PLN
k
tk
1
. So SD , let 1)(01
N
kk Du ,
0])(1[lim))(1(10
kN
kk
kkk DuDu , that is to say
condition 2 is satisfied. Thus LOGFA converges to the
global optimal solution with probability 1. Proof is
completed.
IV. SIMULATION EXPERIMENT AND ANALYSIS
A. Standard Benchmark Functions
In order to verify the convergence speed and
optimization ability of LOGFA, 4 benchmark functions
are used for tests. All these functions are minimization
problems. The expressions of the 4 functions are given in
(10) to (13). The dimensions, the number of fireflies and
the global optimums of these functions are listed in Table
II.
22222222
2)4()4()4()4()4(1yxyxyxyx eeeef (10)
n
i
ixf1
22
(11)
)10)2cos(10(1
23
i
n
i
i xxf (12)
n
i
in
i
ii
xxf
11
24 )cos(
4000
11 (13)
B. Simulation Results and Analysis
This section will compare the standard Firefly
Algorithm, improved Firefly Algorithm based on
Newton's law of universal gravitation (LOGFA) and
221© 2017 J. Adv. Inf. Technol.
Journal of Advances in Information Technology Vol. 8, No. 4, November 2017
-
Firefly Algorithm based on improved evolutionism
(IEFA) using the 4 benchmark functions.
In following tests, the algorithm parameters are set as
follows:
MaxGeneration=200, 3.0 , 1,10 ,
97.0 , 10 G .
TABLE II. STANDARD BENCHMARK FUNCTIONS
Function name Function Dimensions Population number Global optimum
Fourpeaks 1f
2 20 -2
Sphere 2f 10 50 0
Rastrigin 3f 10 50 0
Griewank 4f
10 50 0
TABLE III. SIMULATION RESULTS OF FOUR FUNCTION
Function Algorithm Range Minimum Maximum Average Variance
Fourpeaks
FA (-5,5) -1.9999 -1.9998 -1.9999 2.4943E-09
(-50,50) -4.4069E-3
-8.08E-120 -2.9458E-4 9.3747E-07
IEFA
(-5,5) -2 -2 -2 0
(-50,50) -2 -9.73E-34 -1.2292 0.7723
LOGFA
(-5,5) -2 -2 -2 0
(-50,50) -2 -2 -2 0
Sphere
FA
(-10,10) 101.1423 170.0588 131.6443 300.9770
(-100,100) 5694.2374 19575.1563 12906.5488 14249138.45
IEFA
(-10,10) 4.1978 47.0799 26.5774 146.6322
(-100,100) 2504.7592 13066.0866 6169.1311 5231248.87
LOGFA
(-10,10) 2.34E-12 9.78E-05 5.0927E-06 4.5247E-10
(-100,100) 2.02E-11 4.23E-04 2.8840E-05 9.1340E-09
Rastrigin
FA
(-5,5) 2.5681 47.1232 26.0191 196.1422
(-10,10) 1.52E+02 2.09E+02 187.1096 251.0512
IEFA
(-5,5) 1.42E-11 5.49E-05 5.7586E-06 2.07995E-10
(-10,10) 5.70E-06 18.2706 3.4905 23.9473
LOGFA
(-5,5) 1.60E-11 1.35E-06 1.6683E-07 1.53986E-13
(-10,10) 9.04E-09 1.90E-04 2.0478E-05 2.0384E-09
Griewank
FA
(-5,5)
4.036E-03 4.3112E-01 1.8701E-01 3.1864E-02
(-50,50) 1.4688 2.0702 1.8217 2.7158E-02
IEFA
(-5,5) 1.55E-13 2.01E-06 2.0495E-07 2.8973E-13
(-50,50) 0.4811 1.4830 0.9613 7.8882E-02
LOGFA
(-5,5) 1.12E-14 1.63E-08 1.9630E-09 2.3288E-17
(-50,50) 9.49E-12 2.44E-07 2.8929E-08 3.8471E-15
Each algorithm will run 20 times independently for
each test function. The average value of each function,
the optimal solution, the worst solution and the variance
are obtained. The specific calculation results are shown in
Table III. The evolution curves of the four test functions
are shown in Fig. 1 to Fig. 4.
As we can see from Table III: By comparing the
desired minimum number of iterations, the maximum
number of iterations and the average number of iterations,
we can conclude that LOGFA shows greater evolutionary
optimization than FA, it has better robustness and
adaptability. LOGFA is only one or two high accuracy
than IEFA when the search range is small. However,
when the search range becomes larger, LOGFA can still
achieve high accuracy, showing a strong stability. At this
moment, IEFA accuracy is relatively low.
As we can see from Fig. 1 to Fig. 4: FA appeared the
phenomenon of premature convergence, and the precision
is not high. The convergence speed of IEFA and LOGFA
is very fast, and it is very good to avoid falling into the
local optimal region. However, the convergence accuracy
of LOGFA is higher.
222© 2017 J. Adv. Inf. Technol.
Journal of Advances in Information Technology Vol. 8, No. 4, November 2017
-
Figure 1.
Evolution curves of fourpeaks.
Figure 2.
Evolution curves of sphere.
Figure.3
evolution curves of rastrigi.
Figure 4.
Evolution curves of griewank.
In general, LOGFA has better ability to search the
optimal value than the other two algorithms, and the
accuracy of the optimal value is higher, which shows
strong global optimization ability and higher search
precision. Additionally, LOGFA has better robustness,
adaptability and stability.
V.CONCLUSIONS
Due to the FA have low precision defects, easily
falling into local optimum value when solving the global
optimal value, an improved Firefly Algorithm based on
Newton's law of universal gravitation was proposed in
this paper. The experimental results show that LOGFA
has the best accuracy and stability, which can balance the
global and local search capability well, and overcome the
shortcomings of the basic Firefly Algorithm. It is can be
applied to complex industrial process optimization, such
as power plant optimal control, to solve actual
engineering problems with high profits.
ACKNOWLEDGEMENT
This work was supported by the National Natural
Science Foundation of China (61572416),Hunan
Provincial Natural science Zhuzhou United foundation
(2016JJ5033), JCYJ2016042911221382)”, Key discipline
of Hunan Province „Information and Communication
Engineering‟ in „12th Five Year Plan‟. Hunan University
of Science and Technology Doctor Startup Fund Grant
No.E51664. Hunan Provincial Department of Education
Science Research Project Grant No.16C0639.
REFERENCES
[1] I. Fister, X. S. Yang, et al., “Modified Firefly Algorithm using quaternion representation,” Expert Systems with Applications, vol.
40, no. 18, pp. 7220-7230, 2013.
[2] X. S. Yang, “Firefly Algorithm,” Lévy Flights and Global Optimization, vol. 20, pp. 209-218, 2010.
[3] A. H. Gandomi, X. S. Yang, and A. H. Alavi, “Mixed variable structural optimization using Firefly Algorithm,” Computers &
Structures, vol. 89, no. 23-24, pp. 2325-2336, 2011.
[4] X. S. Yang, “Stochastic test functions and design optimisation,” International Journal of Bio-Inspired Computation, vol. 2, no. 2,
pp. 78-84, 2010.
[5] S. Cao, J. Wang, X. Gu, A Wireless Sensor Network Location Algorithm Based on Firefly Algorithm, AsiaSim, 2012, pp. 18-26.
[6] L. D. S. Coelho and V. C. Mariani, “Firefly Algorithm approach based on chaotic Tinkerbell map applied to multivariable PID
controller tuning,” Computers & Mathematics with Applications,
vol. 64, no. 8, pp. 2371-2382, 2012.
[7] A. Kazem, E. Sharifi, et al., “Support vector regression with chaos-based Firefly Algorithm for stock market price forecasting,”
Applied Soft Computing, vol. 13, no. 2, pp. 947-958, 2013.
[8] M. H. Horng, “Vector quantization using the Firefly Algorithm for image compression,” Expert Systems with Applications An
International Journal, vol. 39, no. 1, pp. 1078-1091, 2012.
[9] M. Y. Cheng, Z. W. Ni, et al., “Overview on glowworm swarm optimization or Firefly Algorithm,” Computer Science, 2015.
[10] X. S. Yang, “Multiobjective Firefly Algorithm for continuous optimization,” Engineering with Computers, 2013.
[11] Y. Feng, J. Liu, and H. E. Yichao, “Chaos-based dynamic population Firefly Algorithm,” Journal of Computer Applications,
vol. 33, no. 3, pp. 796-792, 2013.
[12] Wang M, Qiang F U, Tong N, et al. “Multi-group Firefly Algorithm based on simulated annealing mechanism,” Journal of
Computer Applications, 2015.
223© 2017 J. Adv. Inf. Technol.
Journal of Advances in Information Technology Vol. 8, No. 4, November 2017
-
[13] A. H. Gandomi, X. S. Yang, et al., “Firefly Algorithm with chaos,” Communications in Nonlinear Science & Numerical
Simulation, vol. 18, no. 1, pp. 89-98, 2013.
[14] F. U. Qiang, N. Tong, et al., “Firefly Algorithm based on improved evolutionism,” Computer Science, 2014.
[15] W. Li, “Study on leapfrog Firefly Algorithm and its application in the radio spectrum allocation,” Microcomputer & Its Applications,
2015.
[16] C. P. Liu and Y. E. Chun-Ming, “Firefly Algorithm with chaotic search strategy,” Journal of Systems & Management, 2013.
[17] W. Xia, M. X. Cheng, and M. D. Liu, “Improved ISPO algorithm based on Gaussian mutation,” Application Research of Computers,
vol. 30, no. 4, pp. 986-985, 2013.
[18] F. J. Solis and R. J. B. Wets “Minimization by random search techniques,” Mathematics of Operations Research, vol. 6, no. 1,
pp. 19-30, 1981.
Ling-Zhi Yi was born on March 27, 1966 in Hunan in China. She
graduated from the Xiangtan University in 1986. And after then she
worked in Xiangtan University, act as the leader of the electricity-
electronics committee of Xiangtan University. She is elected as a core
young teacher of Hunan province in 1999, and as the person for 121
project of Hunan province in 2007. Up to today, she has published 100
papers in some famous magazines with 4 patents for invention and 18
software copyrights, 51papers cited by SCI and EI index included. She
is now an expert in National Energy Conservation Center, senior
member of Chinese Association of Automation and executive director
in Institute of Automation of Hunan
Wei-Hong Xiao Received the bachelor's degree in electronic
information engineering from Hunan University of Science and
Technology, Xiangtan, China, in 2016.He presently attend
Xiangtan University, pursuing a Master's degree in electrical
engineering, and his research direction is intelligent algorithm.
WenXin Yu received the B.Sc. degree in applied mathematics from
Hebei Normal University, Shijiazhuang, China, in 2005, and the M.S.
degree in wavelet analysis from Changsha University of Science &
Technology, Changsha, in 2008. And Ph.D. degree in electrical
engineering from Hunan University. Changsha, in 2015.
He joined the Hunan University of Science and Technology, where he c
urrently is lecturer of School of Information and Electrical Engineering.
His interests include the research of Fault diagnosis, signal processing, a
nd wavelet analysis and its application.
Genping Wang was born in 1966 in Jiangxi in China. He received the
B.E. degree from Zhejiang University in 1988. He received his Ph.D.
degree in Industrial Automation from Zhejiang University, Hangzhou,
Zhejiang, in 1998. His major field of study including signal and
processing, control technology and application of computer.
224© 2017 J. Adv. Inf. Technol.
Journal of Advances in Information Technology Vol. 8, No. 4, November 2017