Journal of Applied Mathematics

Volume 2013 (2013), Article ID 832718, 8 pages

http://dx.doi.org/10.1155/2013/832718

## Self-Adaptive Step Firefly Algorithm

^{1}Institute of Computer Network Systems, Hefei University of Technology, Hefei 230009, China^{2}School of Information Engineering, West Anhui University, Lu'an 237012, China

Received 1 July 2013; Accepted 17 September 2013

Academic Editor: Sabri Arik

Copyright © 2013 Shuhao Yu et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

In the standard firefly algorithm, each firefly has the same step settings and its values decrease from iteration to iteration. Therefore, it may fall into the local optimum. Furthermore, the decreasing of step is restrained by the maximum of iteration, which has an influence on the convergence speed and precision. In order to avoid falling into the local optimum and reduce the impact of the maximum of iteration, a self-adaptive step firefly algorithm is proposed in the paper. Its core idea is setting the step of each firefly varying with the iteration, according to each firefly’s historical information and current situation. Experiments are made to show the performance of our approach compared with the standard FA, based on sixteen standard testing benchmark functions. The results reveal that our method can prevent the premature convergence and improve the convergence speed and accurateness.

#### 1. Introduction

Firefly algorithm (FA) is inspired by biochemical and social aspects of real fireflies [1]. It could handle multimodal problems of combinational and numerical optimization more naturally and efficiently [2–5]. Owing to its few parameters to adjust, easy to understand, realize, and compute, it was applied to various fields, such as codebook of vector quantization [6], in-line spring-mass systems [7], mixed variable structural optimization [8], nonlinear grayscale image enhancement [9], travelling salesman problems [10], continuously cast steel slabs [11], promoting products online [12], nonconvex economic dispatch problems [13], chiller loading for energy conservation [14], stock market price forecasting [15], and multiple objectives optimization [16].

Despite these advantages, the FA is also a metaheuristic algorithm; the standard FA can easily get trapped in the local optima when solving complex multimodal problems. These weaknesses have restricted wider applications of the FA. Therefore, avoiding the local optima and accelerating convergence speed have become the two most important and appealing goals in the FA research. To overcome these disadvantages, many researchers have proposed a variety of modifications to the original FA [17–19].

Compared with other evolutionary algorithms, such as Genetic Algorithm and Simulated Annealing, standard FA has the following problem: it is not rational that each firefly uses the same step or the linear step just depends on maximum iteration not related to experience of fireflies, which may impact on the balance between the global and local search. Based on the above problem, a self-adaptive step firefly algorithm (SASFA) is proposed in the paper, which considers the historical information and current situation of each firefly.

The rest of this paper is organized as follows. Section 2 shows a brief review of the updating process of the standard FA and analyzes some problems about the linear step approach. In Section 3, a novel approach is proposed to set the step of each firefly self-adaptively. In Section 4, experimental settings and results compared with the two algorithms are presented. Finally, we make the conclusions in Section 5.

#### 2. Firefly Algorithm Concepts

Firefly algorithm is based on the idealized behavior of the flashing feature of fireflies. The following three rules are idealized for the basic formulation of FA: all fireflies are unisex so that fireflies will attract each other regardless of their sex; attractiveness is proportional to their brightness, which decreases as distance increases between two flies; the brightness of a firefly is determined by the objective function [1].

##### 2.1. Standard Firefly Algorithm

In the FA, there are two critical issues: the formulation of the attractiveness and the variation of light intensity. We can always suppose that a firefly’s attractiveness is determined by its light intensity or brightness, which in turn is associated with the encoded objective function [5]. The light intensity varies with the distance exponentially and monotonically. That is, where is the initial light intensity and is the light absorption coefficient. As a firefly’s attractiveness is proportional to the light intensity seen by neighbor fireflies, we can now define the attractiveness of a firefly by where is the attractiveness at . The movement of a firefly is attracted to another more attractive firefly , which is determined by

The third term is the randomization with the step , being drawn from a Gaussian distribution. In [2], the Levy distribution was used instead of the Gaussian one. Based on the comments in [1] the implementation of standard FA was adopted and generated with uniform distribution in range . The procedure for implementing the FA can be summarized as the pseudocode revealed in Pseudocode 1.

##### 2.2. Problems of Setting Step in Standard Firefly Algorithm

In standard FA, the third term of (3) is the randomization with step . It generates with uniform distribution in range . In general, the method of setting step is static or linear; step just depends on maximum generation, which cannot be adaptive to different fireflies. Firstly, each firefly has the same step settings, and its value decreases from iteration to iteration. Consequently, it may trap in the local optimum, resulting in premature convergence. Secondly, a large step can make the firefly skip the best optimal solution when it is in the neighborhood of the firefly, during the early stage of the search. Therefore, this may reduce the search performance.

Finally, we can see from (3), that it is helpful for firefly to explore new search space with a large step, but it is not useful to the convergence of global optimum. If step has a small value, the result is contrary. For this reason, the step has a great effect on the exploration and convergence of the algorithm. The value of decreases slowly with the large number of iterations but decreases rapidly with the small number of iterations. To take into account the above issues, a new method based on self-adaptive step is introduced which considers the respective experience of each firefly.

#### 3. Proposed Firefly Algorithm

When we make a decision, two important messages are usually integrated, which is known by Boyd and Richerson, on the exploration of human decision-making process. One is the experience of themselves and their neighbors. The other is the current situation. Inspired by this idea, we use it to set the step of each firefly to guide its search in the search space [20].

##### 3.1. Self-Adaptive Step Settings

To solve the problems mentioned in Section 2, step settings should vary with the different problems, fireflies, and environment. Based on these considerations, a method is presented that sets the step of each firefly according to its respective experience and current situation. The step of firefly near the optimal solution should be set small. Similarly, the step of firefly far away from the optimal solution should be set large. Fireflies between the above two are used to balance the global search and local search. Therefore, the step of firefly should also be concerned with its historical information and current situation. In this paper, firefly’s history information includes its past two iteration’s optimum value. Based on the comments mentioned above and many experiments, the step of each firefly is calculated by (4) and (5), respectively [21]. Consider where is the past two iterations’ history information of th firefly. is the fitness value of the best solution of th firefly. is the fitness value of the best solution of population heretofore found, and is the fitness value of th firefly, which reflects the current information. The next iteration step of each firefly is self-adaptive, determined by the difference between its current fitness value and the best fitness value of the population. So the step of each firefly can vary with the iteration, and the step of each firefly is also altered at the same iteration. Obviously, the step of each firefly is different for various problems, because different fitness functions are used.

##### 3.2. Procedure of Self-Adaptive Step Firefly Algorithm

The implementation procedure of our proposed self-adaptive step firefly algorithm (SASFA) can be described as follows.

*Step 1. *Generate the initial population of fireflies, .

*Step 2. *Compute intensity for each firefly member, .

*Step 3. *Update the step of each firefly. The step is calculated by (4) and (5).

*Step 4. *Move each firefly towards other brighter fireflies. The position of each firefly is updated by (3).

*Step 5. *Update the solution set.

*Step 6. *Terminate if a termination criterion is fulfilled; otherwise go to Step 2.

#### 4. Experiments and Results

The proposed SASFA and standard FA are tested on sixteen benchmark functions which are given in Table 1. All simulations are run in Matlab 2010b with 2 GB of random access memory. To eliminate stochastic discrepancy, in each case study, it adopted 100 independent runs for each of the optimization methods, involving 100 different initial trial solutions for each optimization method. The number of fireflies was 30, and the maximum iteration number was 300.

Table 2 shows the best solution, the worst solution, the medium of solutions, and the standard deviation of 100 runs. Medium of solutions and standard deviation of 100 runs are considered to measure the scalability. Table 2 reveals the striking potential of the SASFA in obtaining the optimal solution with high precision, and the solutions of SASFA are better than the solutions found by standard FA.

Figures 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, and 16 give the comparison of convergence processes of the SASFA and standard FA in the above sixteen benchmark functions. It can be found out that SASFA outperformed standard FA with the same parameter settings. Convergence curves depict the provision trade-off between exploration and exploitation of the SASFA during the search process.

#### 5. Conclusions and Further Research

In the paper, we have proposed a self-adaptive step firefly algorithm which considers the current situation and historical information of each firefly. Simulation results demonstrated the potential of the proposed algorithm. Considering more iteration’s information of the algorithm could be an exciting direction in future.

#### Acknowledgments

This research is financially supported by the National Natural Science Foundation of China (NSFC) for Professor Shanlin Yang (no. 71071045) and Professor Shoubao Su (no. 61075049) and the Universities natural science foundation of anhui province (nos. KJ2011A268 and KJ2012Z429). The authors of the paper express great acknowledgment for these supports.

#### References

- X. S. Yang,
*Nature-Inspired Metaheuristic Algorithms*, Luniver Press, Frome, UK, 2008. - X.-S. Yang, “Firefly algorithm, lévy flights and global optimization,” in
*Research and Development in Intelligent Systems*, vol. 26, pp. 209–218, Springer, Berlin, Germany, 2010. View at Publisher · View at Google Scholar - X.-S. Yang, “Firefly algorithms for multimodal optimization,” in
*Stochastic Algorithms: Foundations and Applications*, vol. 5792 of*Lecture Notes in Computer Science*, pp. 169–178, Springer, Berlin, Germany, 2009. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet - S. Łukasik and S. Zak, “Firefly algorithm for continuous constrained optimization tasks,” in
*Computational Collective Intelligence. Semantic Web, Social Networks and Multiagent Systems*, vol. 5796 of*Lecture Notes in Computer Science*, pp. 97–106, Springer, Heidelberg, Germany, 2009. View at Publisher · View at Google Scholar · View at Scopus - X. S. Yang, “Firefly algorithm, stochastic test functions and design optimisation,”
*International Journal of Bio-Inspired Computation*, vol. 2, no. 2, pp. 78–84, 2010. View at Google Scholar - M.-H. Horng and T.-W. Jiang, “The codebook design of image vector quantization based on the firefly algorithm,” in
*Computational Collective Intelligence. Technologies and Applications*, vol. 6423 of*Lecture Notes in Computer Science*, pp. 438–447, Springer, Heidelberg, Germany, 2010. View at Publisher · View at Google Scholar · View at Scopus - R. Dutta, R. Ganguli, and V. Mani, “Exploring isospectral spring-mass systems with firefly algorithm,”
*Proceedings of the Royal Society A*, vol. 467, no. 2135, pp. 3222–3240, 2011. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet · View at Scopus - A. H. Gandomi, X.-S. Yang, and A. H. Alavi, “Mixed variable structural optimization using firefly algorithm,”
*Computers and Structures*, vol. 89, no. 23-24, pp. 2325–2336, 2011. View at Publisher · View at Google Scholar · View at Scopus - T. Hassanzadeh, H. Vojodi, and F. Mahmoudi, “Non-linear grayscale image enhancement based on firefly algorithm,” in
*Swarm, Evolutionary, and Memetic Computing*, vol. 7077 of*Lecture Notes in Computer Science*, pp. 174–181, Springer, Heidelberg, Germany, 2011. View at Publisher · View at Google Scholar · View at Scopus - G. K. Jati and Suyanto, “Evolutionary discrete firefly algorithm for travelling salesman problem,” in
*Adaptive and Intelligent Systems*, vol. 6943 of*Lecture Notes in Computer Science*, pp. 393–403, Springer, Heidelberg, Germany, 2011. View at Publisher · View at Google Scholar · View at MathSciNet - T. Mauder, C. Sandera, J. Stetina, and M. Seda, “Optimization of the quality of continuously cast steel slabs using the firefly algorithm,”
*Materiali in Tehnologije*, vol. 45, no. 4, pp. 347–350, 2011. View at Google Scholar · View at Scopus - H. Banati and M. Bajaj, “Promoting products online using firefly algorithm,” in
*Proceedings of the 12th International Conference on Intelligent Systems Design and Applications (Isda)*, pp. 580–585, 2012. - X.-S. Yang, S. S. S. Hosseini, and A. H. Gandomi, “Firefly Algorithm for solving non-convex economic dispatch problems with valve loading effect,”
*Applied Soft Computing Journal*, vol. 12, no. 3, pp. 1180–1186, 2012. View at Publisher · View at Google Scholar · View at Scopus - L. D. Coelho and V. C. Mariani, “Improved firefly algorithm approach applied to chiller loading for energy conservation,”
*Energ Buildings*, vol. 59, pp. 273–278, 2013. View at Publisher · View at Google Scholar - A. Kazem, E. Sharifi, F. K. Hussain, M. Saberi, and O. K. Hussain, “Support vector regression with chaos-based firefly algorithm for stock market price forecasting,”
*Applied Soft Computing*, vol. 13, no. 2, pp. 947–958, 2013. View at Publisher · View at Google Scholar - X. S. Yang, “Multiobjective firefly algorithm for continuous optimization,”
*Engineering with Computers*, vol. 29, no. 2, pp. 175–184, 2013. View at Publisher · View at Google Scholar - Y. F. Tian, W. M. Gao, and S. Yan, “An improved inertia weight firefly optimization algorithm and application,” in
*International Conference on Control Engineering and Communication Technology (ICCECT '12)*, pp. 64–68, 2012. View at Publisher · View at Google Scholar - S. L. Tilahun and H. C. Ong, “Modified firefly algorithm,”
*Journal of Applied Mathematics*, vol. 2012, Article ID 467631, 12 pages, 2012. View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet - A. H. Gandomi, X.-S. Yang, S. Talatahari, and A. H. Alavi, “Firefly algorithm with chaos,”
*Communications in Nonlinear Science and Numerical Simulation*, vol. 18, no. 1, pp. 89–98, 2013. View at Publisher · View at Google Scholar · View at Zentralblatt MATH · View at MathSciNet - R. Boyd and P. J. Richerson,
*Culture and the Evolutionary Process*, University of Chicago Press, 1988. - H. T. Geng, Y. H. Huang, J. Gao, and H. F. Zhu, “A self-guided particle swarm optimization with independent dynamic inertia weights setting on each particle,”
*Applied Mathematics & Information Sciences*, vol. 7, no. 2, pp. 545–552, 2013. View at Google Scholar