An Improved Firefly Algorithm Based on Newton ' s Law of Universal Gravitation

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. 


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 optimization.Mathematical description of FA described below [15], [16].
Relative brightness is defined by where: 0 I is the original light intensity, it determined by the objective function. is the light absorption coefficient, and ij r stands for the spatial distance between firefly i and j .The intensity will gradually weakened with increasing distance ij r and media absorption, thus the light absorption coefficient  is set to reflect this characteristic.
Attraction is defined by where 0  is the original attraction value.
Location is updated by where: x i and y i 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 which can enhance search range and prevent the situation that particles fall into local best.

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 where: ij r stands for the spatial distance between firefly i and j, and ij m indicates the quality of the firefly i. G is the gravitational constant of the time t, which is defined by where 0 G is the original gravitational constant.
The quality i m is calculated by where: indicates the target fitness value of the firefly i at i x .If it is to solve the minimum problem, Conversely, if it is to solve the maximum problem, then (7) where: rand is a random factor which is uniformly

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).
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 where: min x is the lower limit of the search space, and max x 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: where: f is the target function,  is the solution of the algorithm in the iterative process.S is feasible solution space, and ) , is the iterative result of the algorithm at the 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 n R .If the algorithm satisfies condition 1 and condition 2, then , 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.
. In other words, condition 1 is satisfied.Assume that t k L 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 , that is, condition 2 is not satisfied.But the algorithm will produces a variant solution when evolution stagnates, let , that is to say condition 2 is satisfied.Thus LOGFA converges to the global optimal solution with probability 1. Proof is completed.

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.

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 Firefly Algorithm based on improved evolutionism (IEFA) using the 4 benchmark functions.In following tests, the algorithm parameters are set as follows: 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.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.
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].

TABLE I .
PSEUDO CODE OF THE BASIC STEPS OF THE LOGFA