Abstract
Bat algorithm is a recent optimization algorithm with quick convergence, but its population diversity can be limited in some applications. This paper presents a new bat algorithm based on complex-valued encoding where the real part and the imaginary part will be updated separately. This approach can increase the diversity of the population and expands the dimensions for denoting. The simulation results of fourteen benchmark test functions show that the proposed algorithm is effective and feasible. Compared to the real-valued bat algorithm or particle swarm optimization, the proposed algorithm can get high precision and can almost reach the theoretical value.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
1 Introduction
Swarm intelligence optimization algorithm originates from the simulation of various types of biological behavior in nature and has the characteristics of simple operation, strong parallelism, good optimization performance, etc. Inspired by this idea, the genetic algorithm (GA) [1], ant colony optimization (ACO) [2, 3], particle swarm optimization (PSO) [4] are proposed and are applied widely. In recent years, some new swarm intelligence algorithms were also proposed, such as the shuffled frog leaping algorithm (SFLA) [5], artificial bee colony optimization (ABC) [6], artificial fish swarm algorithm (AFSA) [7], cuckoo search (CS) [8], monkey algorithm (MA) [9] and firefly algorithm (FA), Glowworm swarm optimization algorithm (GSO) [10–13]. Swarm intelligence optimization algorithm can effectively solve some problems which traditional methods cannot solve and have shown excellent performance in many respects. So, its application scope has been greatly expanded.
The real-valued bat algorithm (BA) was proposed by Yang in 2010 [14, 15], which originated from the simulation of echolocation behavior in bats. Bats use a type of sonar called echolocation to detect prey, avoid obstacles in the dark. When searching their prey, the bats emit ultrasonic pulses. The loudness at this time is the maximum, which can help lengthen the ultrasonic propagation distance. During flight to the prey, loudness will decrease while the pulse emission will gradually increase, which can make the bat locate the prey more accurately. But the basic bat algorithm uses real number encoding method, and the application range is limited in the real number. So, the population diversity is limited, and the algorithm is easy to fall into the local optimum. In the low dimensional case, optimization performance is good [16–18], engineering optimization [19, 20], multi-objective optimization [21], and hybrid bat algorithm [22], but in the high dimensional case, optimization performance cannot be satisfactory. In order to solve the high space optimization problems in the basic bat algorithm based on the idea of complex diploid encoding [23–25], we present a bat algorithm based on the complex-valued encoding (CBA) in this paper. The idea of complex-valued encoding uses two parameters (i.e., the real part and the imaginary part) to represent a variable, and the real and imaginary parts can be updated in parallel. The independent variables of the objective function are determined by the modules and angles of their corresponding complex numbers. So, the diversity of population is greatly enriched, the proposed CBA algorithm expands the dimensions for denoting and the performance of the algorithm is improved and CBA can expand the scope of application and basic theory of bat algorithm to certain extent and also provides a new way for bat algorithm to solve the practical problems. This paper is organized as follows. In the Sect. 2, the basic bat algorithm is described. Section 3 gives the CBA algorithm. The simulation and comparison of this proposed algorithm are presented in Sect. 4. Finally, some remarks and conclusions are provided in Sect. 5.
2 Bat algorithm
2.1 The velocity updating and position updating of the bat
Firstly, initialize the bat population randomly. Supposed the dimension of search space is n, the position of the bat i at time t is \(x_{i}^{t}\) and the velocity is \(v_{i}^{t}\). Therefore, the position \(x_{i}^{t + 1}\) and velocity \(v_{i}^{t + 1}\) at time t + 1 are updated by the following formulas:
where Q i represents the pulse frequency emitted by bat i at the current moment. Q max and Q min represent the maximum and minimum values of pulse frequency, respectively, β is a random number in \([0,1]\) and best represents the current global optimal solution.
Select a bat from the bat population randomly and update the corresponding position of the bat according to Eq. (4). This random walk can be understood as a process of local search, which produces a new solution by the chosen solution.
where x old represents a random solution selected from the current optimal solution, A t is the loudness, ε is a random vector and its arrays are random values in \([ - 1,\;1]\).
2.2 Loudness and pulse emission
Usually, at the beginning of the search, loudness is strong and pulse emission is small. When a bat has found its prey, the loudness decreases while pulse emission gradually increases. Loudness A(i) and pulse emission r(i) are updated according to Eqs. (5) and (6):
where α and γ are constants. For any 0 < α < 1, γ > 0, A(i) = 0 means that a bat has just found its prey and temporarily stop emitting any sound. It is not hard to find that as \(t \to \infty\), we can get \(A^{t} (i) \to 0,\,r^{t} (i) = r^{0} (i)\).
2.3 The implementation steps of bat algorithm
Generally speaking, the implementation steps of bat algorithm as follows:
-
1.
Initialize the basic parameters: population size N, attenuation coefficient of loudness α, increasing coefficient of pulse emission γ, the maximum loudness A 0 and maximum pulse emission r 0 and the maximum number of iterations \(iterMax\);
-
2.
Define pulse frequency \(Q_{i} \in [Q_{\hbox{min} } ,\;Q_{\hbox{max} } ]\);
-
3.
Initialize the bat population x i and v;
-
4.
Enter the main loop. If rand < r i , update the velocity and the current position of the bat according to Eqs. (2) and (3). Otherwise, make a random disturbance for position of the bat and go to step 5;
-
5.
If (\({\text{rand}} < A_{i} ,f(x_{i} ) < f(x)\)), accept the new solutions and fly to the new position;
-
6.
If \(f(x_{i} ) < f_{\hbox{min} }\), replace the best bat and adjust the loudness and pulse emission according to Eqs. (5) and (6);
-
7.
Evaluate the bat population and find out the best bat and its position;
-
8.
If termination condition is met (i.e., reach maximum number of iterations or satisfy the search accuracy), go to step 9; otherwise, go to step 4 and execute the next search.
-
9.
Output the best fitness values and global optimal solution.
3 Complex-valued bat algorithm (CBA)
3.1 The complex-valued encoding method
Compared with the traditional real number encoding method, complex-valued encoding has many advantages. It maps one-dimensional expression space with two-dimensional coding space. For each individual bat, the real and imaginary part of complex are updated separately which leads to an inherent parallelism and increases the diversity of individuals in the intangible. So, to some extent, the CBA has higher population diversity and overcomes the disadvantage of bat algorithm, which is easy to fall into local optimum. What’s more, the application range of the bat algorithm is expanded to complex range. Because of the two-dimensional properties of complex number, CBA can express a higher dimension space.
3.1.1 Initialize the complex-valued encoding population
Based on the definition interval of the problem \([A_{k} ,B_{k} ],\;\;k = 1,2,\infty \ldots ,2M\), generate 2M complex modulus and 2M phase angle randomly.
According to the Eq. (9), get 2M complex number:
Thus, we obtain 2M real parts and 2M imaginary parts, and the real and imaginary parts are updated according to the following way.
3.1.2 The updating method of CBA
-
1.
Update the real parts
$$V_{R} (t + 1) = V_{R} (t) + (X_{R} (t) - best_{1} )*Q_{1} (t)$$(10)$$X_{R} (t + 1) = X_{R} (t) + V_{R} (t + 1)$$(11) -
2.
Update the imaginary parts
$$V_{I} (t + 1) = V_{I} (t) + (X_{I} (t) - {\text{best}}_{2} )*Q_{2} (t)$$(12)$$X_{I} (t + 1) = X_{I} (t) + V_{I} (t + 1)$$(13)where the \(V_{R} (t),V_{I} (t)\) are the bat speed of real and imaginary, \(X_{R} (t),X_{I} (t)\) are the bat current position of real and imaginary, best1 is the best solution of real parts and best2 is the best solution of imaginary parts. \(Q_{1} (t)\) and \(Q_{2} (t)\) are the pulse frequency.
3.1.3 The calculation method of fitness value
Because the complex domain has two parts (i.e., the real and imaginary parts), when calculating the fitness value, the complex number needs to be converted into real number firstly and then calculates its fitness value. Specific practices are as follows:1. Take complex modulus as the value of the real number:
2. The sign is determined by phase angle:
where X n represents the converted real variables.
3.2 CBA algorithm
The complex-valued encoding idea which can be considered as an efficient global optimization strategy is introduced to the bat algorithm. Based on the two-dimensional properties of the complex number, the real and imaginary parts of complex number are updated separately. This strategy can greatly enrich the diversity of population and enhance the global search ability of individual bat. Thus, the performance of the algorithm is improved greatly. When updating two new parameters, we also introduce the differential evolution strategy “DE/best/2/bin” [26, 27] to improve the local search ability of the algorithm. In this case, CBA can balance global and local search and cope with multimodal benchmarks. The pseudo code of CBA is as follows:
4 Simulation experiments and results analysis
4.1 Simulation platform
The proposed algorithm is implemented in MATLAB. Operating system: Windows XP; CPU: AMD Athlon (tm) II X4 640 Processor, 3.01 GHz; RAM: 3 GB; Programming language: Matlab R2012 (a).
4.2 Benchmark functions
In order to verify the effectiveness of the proposed algorithm, we select fourteen standard benchmark functions [28, 29] to detect the searching capability of the proposed algorithm. Each function has its own characteristics, and a single algorithm cannot apply to every benchmark function. Therefore, the experimental results can fully reflect the performance of the algorithm.
The benchmark functions selected can be divided into three categories (i.e., high-dimensional unimodal functions, high-dimensional multimodal functions and low-dimensional functions). They are F 1, F 2, F 3, F 4 and F 5 for category I, F 6, F 7, F 8 and F 9 for category II and F 10, F 11, F 12, F 13 and F 14 for category III. In high-dimensional functions, F 2 is a classical test function. Its global minimum is in a parabolic valley, and function values change little in the valley. So, it is very difficult to find the global minimum. There are a large number of local minima in the solution space of F 6. And in low-dimensional functions, most functions have the characteristic of strong shocks. As the global minimum of most benchmark functions is zero, in order to verify the searching capability of the algorithm effectively, we select some functions with nonzero global minimum.
4.3 Parameter setting
Generally, the choice of parameters requires some experimenting. In this paper, after a lot of experimental comparison, the parameters of the algorithm are set as follows.
In BA, the parameters are generally set as follows: Pulse frequency range is \(Q_{i} \in [0,\;2]\), the maximum loudness is A 0 = 0.5, maximum pulse emission is r 0 = 0.5, attenuation coefficient of loudness is α = 0.95, increasing coefficient of pulse emission is γ = 0.05 and population size is N = 40.
In PSO, we use linear decreasing inertia weight that is \(\omega_{\hbox{max} } = 0.9\), \(\omega_{\hbox{min} } = 0.4\), and learning factor is \(C_{1} = C_{2} = 1.4962\).
In CBA, the basic parameters are the same with BA. The range of complex modulus is \(\rho_{k} \in [0,\frac{{A_{k} - B_{k} }}{2}]\), the range of phase angle is \(\theta_{k} \in [ - 2\pi ,2\pi ]\), where \([A_{k} ,B_{k} ]\) is the range of variables.
In the tests, the maximum number of iterations of each algorithm is \(iterMax = 500\).
4.4 Comparison of experiment results
For standard benchmark functions in Table 1, the comparison of test results is shown in Tables 2, 3 and 4, while comparison of searching success rate is shown in Table 5. In this paper, the results are obtained in twenty trials. The Best, Mean, Worst and Std. represent the optimal fitness value, mean fitness value, worst fitness value and standard deviation, respectively. Bold and italicized results mean that CBA is better, while underlined results mean that other algorithm is better.
Seen from Table 2, in category I, CBA can find the optimal solution for F 1 and F 3 and has a very strong robustness. For other three functions, the precision of optimal fitness value and mean fitness value is higher than those of PSO and BA. For the five functions in category I, standard deviation of CBA is less than that of PSO and BA. And this means that in the optimization of high-dimensional unimodal function, CBA has better stability. Similarly, seen from Table 3, besides F 7, for other functions in category II, CBA can find out the optimal solution, and all the standard deviation is 0. Even for F 7, CBA has a higher precision of optimization. The accuracy of CBA can be higher than that of PSO and BA for 16, 17 orders of magnitude, respectively. Overall, the optimization performance of CBA is superior to PSO and BA in the high-dimensional case.
The optimal value of functions in category III is nonzero. Seen from the results in Table 4, although in functions F 10, F 11 and F 12, both PSO and CBA can find out the optimal solution, but the mean optimal value and standard deviation of CBA are smaller than those of the PSO. Only for F 14, the optimal value of CBA is slightly worse than PSO, while standard deviation of CBA is slightly larger than the BA. But the mean optimal value of CBA is better than PSO and BA. Obviously, for functions in category III, the optimization performance of CBA is still better than PSO and BA.
For functions in three categories, Figs. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 and 14 are the fitness evolution curve, Figs. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 and 28 are the anova tests of the global minimum and Figs. 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 and 42 are the comparisons of optimal fitness value.
If the error between actual optimization and theoretical optimal value is less than 1 %, count as a successful search to the optimal value. In order to fully validate the effectiveness of the algorithm, we made a statistical analysis of the optimization success rate of each algorithm. Table 5 shows that optimization success rate of each algorithm, where dimension of functions in category I and category II is 10. Figures 43 and 44 are the anova tests of the global minimum for F 2 and F 6 in the 10 dimensional case, and Fig. 45, Fig. 46 is comparison of optimal fitness value for F 2 and F 6 in the 10 dimensional case.
Because the optimization success rate of PSO and BA in high-dimensional search is very low, so the dimension for functions in category I and category II is set to 10. It can be seen from Table 5, except that the optimization success rate of CBA for F 5 is 0, the optimization success rate of CBA for other functions is higher than those of PSO and BA. In particular, for functions F 6, F 7 and F 8, CBA can certainly find out the optimal solution, while optimization success rate of PSO and BA is 0 and cannot find a satisfactory result. The anova function tests of the global minimum in Figs. 43 and 44 and comparison of optimal fitness value in Fig. 45, Fig. 46 also show that the CBA has better stability and higher precision of optimization.
5 Conclusions
There are many shortcomings of bat algorithm, such as poor population diversity, low precision of optimization, easy to fall into local optimum and poor optimization performance in high-dimensional case. This paper introduces the idea of complex-valued encoding into bat algorithm and proposes a novel bat algorithm based on complex-valued encoding (CBA). With the unique two-dimensional characteristics of complex number, the proposed algorithm increases the diversity of population and improves the optimization performance of the algorithm. In this article, we tested fourteen typical benchmark functions. The results of comparison with the PSO and BA show that precision of optimization, convergence speed and robustness of CBA are all better than PSO and BA. The results of simulation test show that the proposed algorithm is effective and feasible.
References
Srinivas M, Patnaik LM (1994) Adaptive probabilities of crossover and mutation in genetic algorithm. IEEE Trans Syst Man Cybern 24(4):656–667
Kennedy J, Eberhart RC, Shi Y (2001) Swarm intelligence. Morgan Kaufman, San Francisco
Coloni A, Dorigo M, Maniezzo V (1996) Ant system: optimization by a colony of cooperating agent. IEEE Trans Syst Man Cybern Part B Cybern 26(1):29–41
Kennedy J, Eberhart R (1995) Particle swarm optimization. In: Proceedings of IEEE international conference on neural networks. IEEE Press, Piscataway, NJ, pp 1942–1948
Wen-hua Cui, Xiao-bing Liu, Wei Wang, Jie-sheng Wang (2012) Survey on shuffled frog leaping algorithm. Control Decis 27(4):481–486
Karaboga D, Basturk B (2007) A powerful and efficient algorithm for numerical function optimization: artificial bee colony (ABC) algorithm. J Global Optim 39(3):459–471
Xiao-lei Li, Zhi-jiang Shao, Ji-xin Qian (2002) An optimizing method based on autonomous animals: fish-swarm algorithm. Syst Eng Theory Pract 22(11):32–38 (in Chinese)
Yang XS, Deb S (2009) Cuckoo search via Lévy Flights. In: Proceedings of world congress on nature & biologically inspired computing. IEEE Press, Coimbatore, pp 210–214
Rui-qing Zhao, Wan-sheng Tang (2008) Monkey algorithm for global numerical optimization. J Uncertain Syst 2(3):164–175
Yang XS (2009) Firefly algorithms for multimodal optimization. Stoch Algorithms Found Appl Lect Notes Comput Sci 5792:169–178
Krishnanand KN, Ghose D (2009) Glowworm swarm optimization: a new method for optimizing multi-modal functions. Int J Comput Intell Stud 1(1):93–119
Zhou Y, Zhou G, Zhang J (2013) A hybrid glowworm swarm optimization algorithm to solve constrained multimodal functions optimization. Optimization 1–24 (published online)
Zhou Y, Luo Q, Liu J (2013) Glowworm swarm optimization for dispatching system of public transit vehicles. Neural Process Lett 1–9 (published online)
Yang XS (2010) A new metaheuristic bat-inspired algorithm. In: Gonzalez JR et al (eds) Nature inspired cooperative strategies for optimization, NICSO 2010, SCI:284, pp 65–74
Yang XS (2011) Nature-inspired metaheuristic algorithms. Luniver Press, Frome
Zhou Y, Xie J, Zheng H (2013) A hybrid bat algorithm with path relinking for capacitated vehicle routing Problem. Math Probl Eng 2013:2013
Xie J, Zhou Y, Zheng H (2013) A hybrid metaheuristic for multiple runways aircraft landing problem based on bat algorithm. J Appl Math 2013:2013
Gandomi AmirHossein, Yang Xin-She, Alavi AmirHossein, Talatahari Siamak (2013) Bat algorithm for constrained optimization tasks. Neural Comput Appl 22:1239–1255
Yang XS, Gandomi AH (2013) Bat algorithm: a novel approach for global engineering optimization. Eng Comput 29(5):464–483
Kaveh A, Zakian P (2014) Enhanced bat algorithm for optimal design of skeletal structures. Asian J Civial Eng 15(2):179–212
Yang XS (2011) Bat algorithm for multi-objective optimisation. Int J Bio-Inspired Comput 3(5):267–274
He X-s, Ding W-j, Yang X-s (2013) Bat algorithm based on simulated annealing and gaussian perturbations. Neural Comput Appl (published online)
Casasent D, Natarajan S (1995) A classifier neural network with complex-valued weights and square-law nonlinearities. Neural Netw 8(6):989–998
De-bao Chen, Huai-jiang Li, Zheng Li (2009) Particle swarm optimization based on complex-valued encoding and application in function optimization. Comput Eng Appl 45(10):59–61 (in Chinese)
Zhao-hui Zheng, Yan Zhang, Yu-huang Qiu (2003) Genetic algorithm based on complex-valued encoding. Control Theory Appl 20(1):97–100 (in Chinese)
Das S, Suganthan PN (2011) Differential evolution: a survey of the state-of-the-art. IEEE Trans Evol Comput 15(1):4–31
Pei-chong Wang, Qian Xu, Yue W (2009) Overview of differential evolution algorithm. Comput Eng Appl 45(28):13–16 (in Chinese)
Yang XS (2010) Appendix a: Test problems in optimization. In: Yang XS (ed) Engineering optimization. John, Hoboken, pp 261–266
Tang K, Yao X, Suganthan PN et al (2007) Benchmark functions for the CEC’ 2008 special session and competition on large scale global optimization. University of Science and Technology of China, Hefei
Acknowledgments
This work is supported by National Science Foundation of China under Grant No. 61165015. Key Project of Guangxi Science Foundation under Grant No. 2012GXNSFDA053028, Key Project of Guangxi High School Science Foundation under Grant Nos. 20121ZD008, 201203YB072, funded by Open Research Fund Program of Key Lab of Intelligent Perception and Image Understanding of Ministry of Education of China under Grant No. IPIU01201100 and the Innovation Project of Guangxi Graduate Education under Grant No. gxun-chx2012103.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Li, L., Zhou, Y. A novel complex-valued bat algorithm. Neural Comput & Applic 25, 1369–1381 (2014). https://doi.org/10.1007/s00521-014-1624-y
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00521-014-1624-y