Abstract
Firefly Algorithm (FA) is a stochastic optimization algorithm inspired by the swarm intelligence. It has the advantages of simple implementation, high efficiency and so on. However, the algorithm is easy to come into premature convergence and fall into local optimum. To address this problem, we proposed a novel firefly algorithm, Detecting Firefly Algorithm (DFA), in which we use a detecting firefly that flies round certain target points to improve the search path of standards FA. Moreover, the influence of the brightest firefly and the second brightest firefly is taken into consideration to optimize the movement strategy of the single firefly. The example illustrates that the higher precision and better convergence features of the proposed algorithm in numerical optimization.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
Firefly algorithm (FA) is a stochastic optimization algorithm inspired by the swarm intelligence introduced by XinShe Yang [1] at Cambridge University. The algorithm is of higher convergence rate especially in function optimization. A lot of numerical examples have illustrated the superiority of this method. FA has been applied to many different fields. Nggam J. Cheung et al. analyzed of the relevant parameters of the algorithm [2]. Xinshe Yang et al. also made a further research on the algorithm that some unique test functions were introduced [3]. And the advanced nature of the algorithm was described in the optimization problem [4]. Xinshe Yang believed that it was more effective in solving NP-hard problems [5]. A new method using FA for hybrid data clustering was explained by Maheshwar et al. [6]. Shaik Farook used hybrid genetic-firefly algorithm for regulating LFC regulations in a deregulated power system [7].
However, standard FA is easy to fall into the local optimal solution in the global search. In order to overcome this defect of the algorithm, Arora et al. proposed mutated firefly algorithm to improve the convergence rate and accurateness [8]. Shuhao Yu et al. used a variable strategy for step size α to modify firefly algorithm (VSSFA) [9]. A new disturbance model of the brightest firefly was improved in the paper of S.L. Tilahun et al. [10]. And a peculiar movement strategy was described by adding inertia weight in literature [11]. At the same time, Mahdi Bidar et al. described a new method called JFA which promoted the low brightness firefly [12]. The intelligent firefly algorithm (IFA) was introduced by Seif-Eddeen K. Fateen et al. in which a firefly acted intelligently by basing its move on top ranking fireflies [13]. Milan Tuba et al. also upgraded FA for portfolio optimization problem [14]. In addition, Le’vy Flights was combined with search strategy of FA in literature of XinShe Yang et al. [15]. Some scholars also introduced the chaos mechanism into the algorithm [16, 17]. As well, a kind of adaptive firefly optimization algorithm based on stochastic inertia weight was discussed by Changnian Liu [18].
In the above improved methods, the search path of the firefly was not mentioned. In standard FA, a firefly in the search process is not clear about the direction of movement, so that it is not conducive to find the global optimal solution. Therefore, we presented a kind of detecting firefly which surrounds a target point to do a spiral motion, and gradually converges to the target point. When the scope of the definition domain is larger, the more dispersed fireflies will lead to lower convergence rate. In order to solve this problem, we add the item of brightness to the definition of attractiveness. And the influence of the global optimum and the suboptimum also was considered to join in the process of the movement of the firefly.
The rest of the paper is structured as follows. The second section is a review of the standard FA. DFA is described in third section. In fourth section, the proposed algorithm is tested on 28 benchmark functions. Moreover, the simulation result is compared with the standard FA and several intelligent optimization algorithms and then the performance of DFA is verified. The last section summarizes the paper.
2 Standard Firefly Algorithm
For simplicity in describing FA which was developed by XinShe Yang, There are three idealized assumptions as following [1]:
-
Each firefly will be attracted to other fireflies only depend on their brightness regardless of their sex or other.
-
Any two flashing fireflies, the less bright one will be attracted and move towards the brighter one. The attractiveness of fireflies both decrease as their distance increases. If there is no brighter one than a particular firefly, it will move randomly.
-
The brightness of a firefly is affected or determined by the value of the objective function.
In standard FA, the brightness of a firefly is proportional to the value of objective function. The absolute brightness of a firefly at a particular location x is chosen as:
where \( I(x) \) is absolute brightness when the attenuation of brightness in the medium is not considered. As attractiveness of a firefly is inverse proportional to the distance seen by adjacent fireflies, we define the attractiveness β of a firefly by:
where \( \beta_{0} \) is the attractiveness at r = 0, \( \gamma \) is a light absorption coefficient. The movement strategy of a firefly i is attracted to another more attractive (or brighter) firefly j is determined by:
where the second term is due to the attraction. The third term is randomized with α being the randomization parameter, and \( \varepsilon_{i} \) is a vector of random numbers drawn form a Gaussian distribution or uniform distribution.
3 Detecting Firefly Algorithm
3.1 Detecting Firefly
Inspired by detecting particle swarm optimization that was proposed by Y Zhang [19], we introduced the detecting firefly to FA. In standard FA, the search path of single firefly is disorganized. It is easy to make the algorithm fall into local optimal solution. The aim of this research is to help the firefly escape from local optimal trap. We selected a small portion of the n fireflies whose number was marked as \( n_{s} \). These fireflies which are known as detecting firefly try to find a better potential optimal value along the spiral convergence line path (a spiral center is required in the domain of definition). Using the detecting firefly can expand the search scope of the algorithm. In the meantime, the rest of fireflies search the optimal value in accordance with the standard FA. That natural firefly and detecting firefly complement each other effectively to maintain population diversity and avoid premature phenomenon in the evolution.
In order to make the detecting firefly move around the target point (such as current global optimal value) along the path of the spiral line, we used an offset \( \Delta X \) which is equal to the speed of particle in PSO. When detecting firefly i is going to move, its location update formula is defined as follows:
where \( X_{gbest} \) is the position of the brightest firefly, coefficient k represents the \( k_{th} \) iteration, \( C_{s1} \) and \( C_{s2} \) respectively represent the proportion of \( \Delta X_{i}^{k} \) and \( \left( {X_{gbest} - X_{i}^{k} } \right) \) in movement direction of the detecting firefly and the initial position \( X_{i}^{0} \) and initial offset \( \Delta X_{i}^{0} \) are random. We selected the position of current optimal firefly as the target. \( n_{s} \)(\( n_{s} \) = 5) detecting fireflies travel in the spiral track which were given in Fig. 1 around the position of current optimal firefly. This process will be iterated for T (T = 10) times. For example, we selected firefly i as a detecting firefly. The original brightness \( I_{i} \) of firefly i and the brightness \( I_{i}^{*} \) of detecting firefly \( i^{*} \) which is the brightest in T iterations are compared. If the brightness \( I_{i}^{*} \) is greater than the original brightness \( I_{i} \), the algorithm will use the position of detecting firefly \( i^{*} \) to update the original position of firefly i.
3.2 Randomization Parameter (Step Length) and Attractiveness
In fact, the randomization parameter \( \alpha \) of the standard FA is fixed in the formula of movement of a firefly. It cannot be perfectly suited to the search process of firefly. When \( \alpha \) is large, the algorithm has a satisfied convergence rate. But it is easy to ignore the potential of the optimal value, so that it reduces the accuracy in late search. On the other hand, when \( \alpha \) is smaller, the algorithm has the high precision in local. However, reduced search space can result in that the algorithm cannot find the global optimal value. In order to balance the search range and precision, we used an adaptive strategy to generate \( \alpha \) [1] as follow:
where \( \alpha_{s} \) is initial value, \( \alpha_{e} \) is the final value specified, coefficient t represents the \( t_{th} \) iteration. The formula shows that \( \alpha \) decreases exponentially with the increase of the iteration.
In standard FA, the movement direction of the firefly is determined by the brightness of each firefly. But the degree of the attractiveness between the fireflies is only related to the distance. It does not reflect the impact of the brightness in the movement of the firefly [9]. If the function optimization problem has a larger scope of definition, a brighter firefly which is far from the others will not have enough attractiveness to the others. So in DFA, a new method of calculating attractiveness was designed depending on both brightness and direction. If firefly j is brighter than firefly i, the attractiveness \( \beta_{ij} \) of firefly j to firefly i is given by:
where \( I_{i} \) and \( I_{j} \) are absolute brightness of firefly i and firefly j respectively. In this paper, it is important to note that the brightness of all fireflies is greater than zero which depends on the objective function. Therefore, the minimum brightness is zero.
3.3 Firefly Movement
In the position update process of original firefly, the current brightest firefly has not been concerned in the algorithm. XinShe Yang introduced to add an extra item about the brightest firefly into Eq. 3 [1]. But this strategy is likely to cause that the movement direction of the firefly becomes single.
DFA was continued to add another item about second brightest in our improvement. When the firefly is moving, the space between the optimum and the suboptimum will be searched. It avoids the premature convergence that is caused by adding the optimal location only. Suppose that the brightness of firefly i is not as good as firefly j, firefly i is attracted by firefly j. The updated location of firefly i is defined by:
where \( x_{gbest} \) is the location of the brightest firefly and \( x_{gbest}^{'} \) is the location of the second brightest firefly. \( \varepsilon_{i1} \), \( \varepsilon_{i2} \) are vectors of random numbers in [-0.5,-0.5]. \( \lambda_{1} ,\lambda_{2} \) are inertia weight. If a firefly is the brightest firefly, it will move randomly. We used the best firefly after disturbing to replace the original firefly. According to Eqs. 4–8, the pseudo code of DFA is given by Table 1.
4 Simulation and Experiments
The algorithm was compared with other intelligent optimization algorithms, such as standard particle swarm algorithm, genetic algorithm, SFA, and VSSFA [9]. The parameters of these algorithm were listed by Table 2. The proposed DFA was tested by 28 benchmark functions in CEC 2013 which be summarized in paper [20]. There are five unimodal functions (from \( f_{1} \) to \( f_{5} \)), 20 basic multimodal functions (from \( f_{6} \) to \( f_{20} \)) and 8 composition functions (from \( f_{21} \) to \( f_{28} \)). All problems are the minimum optimization. And the dimensions of all test functions were 30. The scope of each dimension was in [−100, 100]. We adopted 50 independent runs for each of test function and then calculated the average of 50 results.
The average values on the optimization were presented in Table 3, where the top of the ranked value was highlighted in boldface. From the results, the average ranking of DFA is 1.46 that is far higher than other algorithms in ranking.
Though the performance of DFA is not as good as SPSO on function \( f_{2} \), \( f_{4} \), \( f_{6} \), \( f_{10} \), and is worse than GA and VSSFA respectively on function \( f_{8} \) and \( f_{15} \), \( f_{23} \), the algorithm has an absolute advantage on the rest of test functions. The simulation and experiments show that the performance of the algorithm is significant which beyond other in finding the global optimal value.
To amplify the convergence property of DFA, the convergence curves were displayed at Figs. 2, 3, 4 and 5. Due to space limitations, our paper only described four convergence curves on functions \( f_{1} \), \( f_{11} \), \( f_{13} \), \( f_{28} \). Figures 3 and 4 show that convergence rate of DFA was greater than other algorithms on Sphere function and Rastrigin’s function. On Sphere function, DFA began to converge at the \( 400_{th} \) iteration. But SFA and VSSFA still fluctuated at the \( 800_{th} \) iteration. DFA began to converge at the \( 300_{th} \) iteration on Rastrigin’s function. However, SFA and VSSFA were not convergent in \( 1000_{th} \) iterations. On non-continuous rotated Rastrigin’s function, DFA is better than FA, not as good as VSSFA. And on the composition function 8(n = 5, rotated), the convergence rate of DFA is as high as that of SFA, which is higher than VSSFA.
The experiments displayed that DFA has well accuracy and convergence rate on different function optimization problems. Adding the detecting firefly made the algorithm escape from the local optimal trap and premature convergence. The decline of convergence rate that detecting firefly caused was blocked by adding optimum and suboptimum.
5 Conclusion
In the paper, to address the problem that SFA easy to fall into local optimum, an improved firefly algorithm, named as DFA, was proposed. The proposed algorithm based on detecting firefly expanded the searching range of the firefly swarm, so that it is easier to find the global optimal value. Further, that the optimal location was added to the movement strategy highlighted the role of optimal location in the algorithm. Finally, the experiments on 28 benchmark functions show that DFA has a significant improvement on standard FA.
References
Yang, X.S.: Firefly algorithm. Nature-Inspired Metaheuristic Algorithms Second Edition. Luniver Press, Bristol (2010)
Cheung, N.J., Ding, X.M., Shen, H.B.: Adaptive firefly algorithm: parameter analysis and its application. PLoS ONE 9(11), e112634 (2014)
Yang, X.S.: Firefly algorithm, stochastic test functions and design optimization. Int. J. Bio-Inspired Comput. 2(2), 78–84 (2010)
Johari, N.F., Zain, A.M., Mustaffa, N.H.: Firefly algorithm for optimization problem. Appl. Mech. Mater. 421, 512–517 (2013)
Yang, X.S.: Firefly algorithms for multimodal optimization. Stochast. Algorithms Found. Appl. 5792, 169–178 (2010)
Maheshwar Kaushik, K., Arora, V.: A hybrid data clustering using firefly algorithm based improved genetic algorithm. Procedia Comput. Sci. 58, 249–256 (2015)
Farook, S.: Regulating LFC regulations in a deregulated power system using hybrid genetic-firefly algorithm. In: IEEE International Conference on Electrical, Computer and Communication Technologies (ICECCT), IEEE International Conference, Coimbatore, India, pp. 1–7 (2015)
Arora, S., Singh, S., Singh, S., Sharma, B.: Mutated firefly algorithm. In: International Conference on Parallel, Distributed and Grid Computing, pp. 33–38 (2014)
Yu, S., Zhu, S., Ma, Y., Mao, D.: A variable step size firefly algorithm for numerical optimization. Appl. Math. Comput. 263, 214–220 (2015)
Tilahun, S.L., Ong, H.C.: Modified firefly algorithm. J. Appl. Math. 467631(12), 2428–2439 (2012)
Tian, Y., Gao, W., Yan, S.: An improved inertia weight firefly optimization algorithm and application. Int. Conf. Control Eng. Commun. Technol. Liaoning China 4, 64–68 (2012)
Bidar, M., Kanan, H.R.: Jumper firefly algorithm. In: 3rd International Conference on Computer and Knowledge Engineering (ICCKE), Mashhad, Iran, pp. 267–271 (2013)
Fateen, S.E.K.: Intelligent firefly algorithm for global optimization. In: Yang, X.-S. (ed.) Cuckoo Search and Firefly Algorithm. SCI, vol. 516, pp. 315–330. Springer, Heidelberg (2014)
Tuba, M., Bacanin, N.: Upgraded firefly algorithm for portfolio optimization problem. In: UK Sim-AMSS 16th International Conference on Computer Modelling and Simulation, Cambridge, USA, pp. 113–118 (2014)
Yang, X.S.: Firefly algorithm, L’evy flights and global optimization. In: Bramer, M., Ellis, R., Petridis, M. (eds.) Research and Development in Intelligent Systems XXVI, Springer London, pp. 209–218 (2010)
Gandomi, A.H., Yang, X.S., Talatahari, S., Alaiv, A.-H.: Firefly algorithm with chaos. Commun. Nonlinear Sci. Numer. Simul. 18(1), 89–98 (2013)
Baykasoglu, A., Ozsoydan, F.B.: Adaptive firefly algorithm with chaos for mechanical design optimization problems. J Appl. Soft Comput. 36(c), 152–164 (2015)
Liu, C.N., Tian, Y.F., Zhang Q., Yuan J., Xue, B.B.: Adaptive firefly optimization algorithm based on stochastic inertia weight. In: Sixth International Symposium on Computational Intelligence and Design, Hangzhou, China, pp. 334–337 (2013)
Zhang, Y.N., Teng, H.F.: Detecting particle swarm optimization. Concurrency Comput. Pract. Experience 21(4), 449–473 (2009)
Liang, J.J., Qu, B.Y., Suganthan, P.N., Hernández-Díaz, A.G.: Problem Definitions and Evaluation Criteria for the CEC 2013 Special Session on Real-Parameter Optimization
Acknowledgments
This paper is supported by the National Natural Science Foundation of China (61502290, 61401263), Industrial Research Project of Science and Technology in Shaanxi Province(2015GY016), the Fundamental Research Funds for the Central Universities, Shaanxi Normal University (GK201501008) and China Postdoctoral Science Foundation (2015M582606).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
Zhang, Y., Lei, X., Tan, Y. (2016). Detecting Firefly Algorithm for Numerical Optimization. In: Tan, Y., Shi, Y., Niu, B. (eds) Advances in Swarm Intelligence. ICSI 2016. Lecture Notes in Computer Science(), vol 9712. Springer, Cham. https://doi.org/10.1007/978-3-319-41000-5_20
Download citation
DOI: https://doi.org/10.1007/978-3-319-41000-5_20
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-40999-3
Online ISBN: 978-3-319-41000-5
eBook Packages: Computer ScienceComputer Science (R0)