Enhanced Firefly Algorithm Using Fuzzy Parameter Tuner

Exploitation and exploration are two main search strategies of every metaheuristic algorithm. However, the ratio between exploitation and exploration has a significant impact on the performance of these algorithms when dealing with optimization problems. In this study, we introduce an entire fuzzy system to tune efficiently and dynamically the firefly algorithm parameters in order to keep the exploration and exploitation in balance in each of the searching steps. This will prevent the firefly algorithm from being stuck in local optimal, a challenge issue in metaheuristic algorithms. To evaluate the quality of the solution returned by the fuzzy-based firefly algorithm, we conduct extensive experiments on a set of high and low dimensional benchmark functions as well as two constrained engineering problems. In this regard, we compare the improved firefly algorithm with the standard one and other famous metaheuristic algorithms. The experimental results demonstrate the superiority of the fuzzy-based firefly algorithm to standard firefly and also its comparability to other metaheuristic algorithms.


Introduction
Optimization is the task of finding the best values for the parameters of a given function by maximizing or minimizing the output while satisfying problem constraints.The set of values that can be assigned to the parameters represent the candidate solutions, and the candidate that leads to the best output is the optimal solution.Often, the optimization process suffers from the problem of widespread (high number of solutions) and high dimensionality (high number of parameters) search space.Moreover most optimization problems are NP-hard i.e. with very high computational complexity.Metaheuristic algorithms are considered among the most practical approaches for solving optimization problems.These algorithms algorithms have been developed based on biological, physical processes, chemical and swarm intelligence.Metaheuristic algorithms can handle a wide variety of real-world optimization applications that are basically difficult and in some cases impractical to be solved by classical methods (Yang, X.S., 2010).Even though these algorithms find the best solution in an excellent running time, they do not always guarantee the solution optimality (Yang, X.S., 2010).
It is not always possible to go through the search space entirely due to its complexity and high-dimensionality (Yang, X.S., 2010).So to discover the optimal solution, metaheuristic algorithms utilize a mixture of exploration and exploitation strategies.With exploration, these algorithms globally search the space and generate diverse solutions.Simultaneously, metaheuristic algorithms use local search to look around for the quality solutions.Let us assume an optimization algorithm employs only exploration (with 0% contribution of exploitation).Thus, the algorithm, regardless of the previous searching steps, performs its next movement, and by considering the dimensionality of the space the algorithm faces, it cannot succeed in finding the optimal solution.Similarly, if the algorithm designed with only exploitation, making a choice for the next movement is based on the previous decisions.So the algorithm becomes a hill-climbing method, and in complex problem spaces, it will be definitely trapped in local optimum (Durkota, K., 2011).It is evident that the best approach is to take advantage of both exploration and exploitation to be able to handle the problem dimensionality.Nevertheless, to improve the performance of metaheuristic algorithms in terms of the solution quality, a critical aspect is to keep the exploration and exploitation in balance (Yang, X.S., 2010).Each algorithm has its own tuning parameters, and their values determine the contribution rates of exploration and exploitation.The behavior of metaheuristic algorithms should be constantly monitored in run time to allocate proper values to their parameters in order to attain the right balance between local and global search (Yang, 2010).
Firefly is one of the most popular population-based algorithms inspired by the real fireflies' behavior in nature (Yang, 2010).One of the inherent features of firefly is its tendency to converge early.This is due to the fact that in each searching step, each firefly moves toward the brighter ones.This trend represents the exploitation i.e. the local search that causes the early convergence.It also increases the risk of being trapped in local optimum solutions.Moreover, in the firefly algorithm, the controlling parameters of exploration and exploitation are initialized at the beginning and then remain unchanged until the end of the searching task.Since this algorithm may encounter unwanted situations, such as being trapped in local optimums or progressing poorly in solving the optimization problem, then it needs different contribution rates of exploration and exploitation.Consequently, a parameter tuner is essential to effectively control the firefly parameters to determine the right contribution rates of exploitation and exploration considering the trend of approaching the optimal solution.For this purpose, we introduce an entire Fuzzy controlling system because Fuzzy logic is an adequate choice to adjust the exploitation-exploration trade-off in metaheuristic algorithms (Liu & Ma, 2011), Shi & Eberhart, (2001), Liu, Xu, & Abraham, 2005, Qi & Chunming, 2010).Indeed, when searching for the optimal solution, metaheuristic algorithms deal with uncertain values due to the stochastic nature of the optimization processes (Gandomi, A. H., 2014).Thus, we need to employ an approximate reasoning approach that allows making decisions with estimated values in conjunction with uncertain values.We may note that very limited studies (only two ( Bidar & Kanan, 2013), Hassanzadeh & Kanan, 2014) applied Fuzzy logic to firefly.According to the progress of the optimization process, the proposed Fuzzy system allocates dynamically different values to the parameters of firefly in order to control the algorithm behavior in run-time.To this end, we utilize two measures to examine the progress trend of firefly in approaching the optimal solution.
To assess the performance of the Fuzzy-based firefly algorithm, we conduct extensive comparative experiments based on a set of 20 benchmark functions (low and high dimensional problems) as well as on two constrained engineering problems.More precisely, we apply the enhanced firefly, the standard firefly and numerous famous nature-inspired optimization algorithms on these 22 well-known problems.Additionally, we compare the performance results of these optimization methods.The results of the experiments demonstrate the superiority of our proposed Fuzzy-based firefly algorithm to standard one.The results also show that our proposed algorithm is comparable to the other algorithms in terms of quality of the solution returned.
In this article, we first discuss the significance of exploitation and exploration in metaheuristic algorithms.Section 3 presents related work on firefly extensions and fuzzy logic application to other optimization algorithms.Section 4 discusses the standard firefly algorithm.Section 5 presents an overview on fuzzy systems.Section 6 exposes the steps of the proposed fuzzy firefly algorithm.Section 7 and 8 conduct several experiments based on unconstrained benchmark functions and constrained engineering problems.Finally section 9 concludes the paper.

Discussion on Exploration and Exploitation
Two basic features of every metaheuristic algorithm are exploitation and exploration.Exploration or diversification enables algorithms to search globally for the optimal solution by discovering new areas in the problem space.In other words, it causes the algorithm to produce more diverse solutions (diversity refers to the difference between solutions).This is a very important task because having diversified solutions has a great impact on the performance of these algorithms, especially when dealing with multimodal problems.Additionally, exploration helps the algorithm escaping from the local optimum trap (Črepinšek, M., Liu, S. H., & Mernik, M. (2013)).One of the common problems with many metaheuristic algorithms is the premature convergence that is caused by the poor diversity of the produced solutions.On the other hand, exploitation or intensification processes the neighboring areas of already discovered points in the problem space.In hilly or unimodal problem spaces, exploitation causes the algorithm to move step by step toward the local optimum solution, which is may be the global optimum solution.However for multimodal problem spaces relying just on exploitation causes the algorithms to being trapped in local optimum.So, all these points clearly emphasize on the importance of balancing between exploitation and exploration in different steps of solving optimization problems.Managing exploration and exploitation can be done through two different strategies, offline and online (Črepinšek, M., Liu, S. H., & Mernik, M. (2013)).In the former, the controlling parameters of the algorithm are tuned to their best in the initialization step of the problem solving.Nevertheless, in this strategy, the parameter values remain unchanged to the end of the solving process.During the optimization process, different ratios between exploitation and exploration are required.Moreover, in the situation of problems with unknown problem spaces, the appropriate amount of exploitation and exploration is unclear.So to deal more effectively with complex optimization problems, metaheuristic algorithms require a dynamic mechanism to find the appropriate ratio between exploitation and exploration.Regarding the online strategy, there are several ways, and in this study we propose to use a fuzzy system as the parameter controller to determine the ratio between exploitation and exploration more intelligently.This system must be able to decide when the algorithm needs to produce more diversified solutions through exploration and when to emphasis more on exploitation.The challenging issue here is to measure the progress of the algorithm (as well as finding out whether the algorithm is trapped in local optimum solution or not) to be able to decide about the amount of the exploration and exploitation.To design the desired fuzzy controller, we should consider some facts.First, in the initial optimization steps, we need diverse solutions.Second, in the final steps, if we are close to the optimal solution then the emphasis should be on the exploitation.Finally, according to the feedbacks of the algorithm to the fuzzy system, appropriate ratio between exploitation and exploration must be considered (this will be discussed in detail in this paper).
The standard Firefly algorithm has controlling parameters that are set at the initial step to adjust the amount of exploitation and exploration needed for a specific problem.According to above discussion, it follows the offline strategy.To deal more effectively with optimization tasks and confer an appropriate dynamism to the algorithm, we propose a fuzzy system as a parameter controller.With such online controller, firefly algorithm will enjoy an adaptive behavior in facing different situations in the solving the problems.

Related Work
In this section, we investigate reliable studies about improving the firefly performance as well as the application of fuzzy systems to other metaheuristic algorithms.

Improving Firefly
The firefly algorithm is suitable for problems that have fast convergence but not for a wide range of problems (Hassanzadeh, T., & Kanan, H. R. (2014)).In the literature, various strategies have been introduced to address the issue of exploitation and exploration specifically in firefly, such as employing Fuzzy systems, the chaotic theory, the Gaussian distribution and the theory of jumper searching agents.
Fuzzy systems as parameter controllers are a known approach to adjust exploration and exploitation in metaheuristic algorithms.Nevertheless, there are very limited studies that enhanced firefly based on Fuzzy logic or Fuzzy system.Our work differs widely from these studies since we have taken different design decisions regarding the components of the Fuzzy system and Fuzzy rule base.For instance, in (Hassanzadeh, T., & Kanan, H. R. (2014)), the authors presented a Fuzzy method to improve the collective behavior and global searching task of firefly.They employed Fuzzy logic to reform the firefly equations in order to attain a proper balance.In each of the iterations, more than one firefly can affect other fireflies as opposed to the behavior of the standard firefly.The attractiveness of one firefly is a proportion to its brightness, and the brightness of K fireflies is represented by a Fuzzy variable.This method improved the performance of firefly by shifting its tendency from local search to global search (Hassanzadeh, T., & Kanan, H. R. (2014)).In our work, we have developed a Fuzzy system to allocate dynamically appropriate values to the firefly parameters.We assess the trend of approaching the optimal solution with two measures.
To achieve a proper balance, in another work (Farahani, S. M., Abshouri, A. A., Nasiri, B., & Meybodi, M. (2011)), the authors exposed a new approach to improve the global search of firefly based on the Gaussian distribution.To be able to increase the participation rate of random search, the authors introduced a randomization strategy.A significant issue of firefly is its fixed movement steps that may cause to miss good quality solutions.By allocating suitable values to the controlling parameter Alpha, this approach adjusts the size of the random step in each of the iterations.It also adjusts the direction and size of the random step for the stochastic movement of the brightest firefly.The main strategy in (Farahani, S. M., Abshouri, A. A., Nasiri, B., & Meybodi, M. (2011)) is to change the size of random step based only on the iteration number.To make sure that the firefly algorithm approaches the optimal solution our method utilizes two different measures, not only the iteration number but also the other measure Delta to make sure that finding the optimal solution will happen.
Another approach to adjust the exploration-exploitation balance is to apply the chaotic theory.The most important application of this theory to the firefly algorithm is to encourage diversification (exploration) to help the algorithm escape the local optimum solutions traps.Dos Santos and al. applied the chaotic theory to the controlling parameters of firefly (which are constant values in standard firefly) and replaced them with the chaotic sequences to confer more stochastic behavior to firefly (dos Santos Coelho, L., de Andrade Bernert, D. L., & Mariani, V. C. (2011, June)).This approach greatly improved the firefly efficiency.The main difference between the technique of (dos Santos Coelho, L., de Andrade Bernert, D. L., & Mariani, V. C. (2011, June)) and our work is that our Fuzzy system takes decisions based on the Fuzzy rules.Different rules are fired according to the situations being faced by firefly.On the other hand, the chaotic-based firefly allocates a chaotic series to the controlling parameters to diversify the solutions.

Fuzzy Logic for other Metaheuristic Algorithms
Fuzzy logic has also been considered to improve the performance of other metaheuristic algorithms.For example, in the study (Liu, Y., & Ma, L. (2011, May)), the authors utilized Fuzzy logic to address the immaturity or early convergence of the PSO algorithm.The proposed method, which employs a Fuzzy system, assigns proper values to the velocity parameter of PSO in different steps.Adjusting the velocity factor prevents the early convergence of PSO and encourages the global search.The designed Fuzzy system has 2 inputs (particle value (Value) and iteration counter (NC)) and 1 output (Velocity), and employs 5 Fuzzy sets and 25 Fuzzy if-then rules.In another research, Shi and Eberhart developed a 2 inputs-1 output Fuzzy system to enhance the performance of the canonical PSO (Shi, Y., & Eberhart, R. C. (2001)).The input variables are the current best solution and current inertia weight parameter, and the output is the updated inertia weight.The authors utilized 3 Fuzzy sets and 9 Fuzzy rules to decide about the values to the inertial weight.Hongbo and Ajith in (Liu, H., Xu, Z., & Abraham, A. (2005, September)) introduced a Fuzzy system to improve the efficiency of Genetics Algorithms (GAs) by adjusting the mutation and crossover probabilities.The underlying updating strategy is based on the maximum fitness and average fitness in the population.The Fuzzy system decides on the occurrence probability of the mutation and crossover operations based on Fuzzy rules: 15 rules to update the mutation probability and 15 others for the crossover probability.In (Qi, Z., & Chunming, P. (2010, August)), the Fuzzy system is used to increase the performance of GAs.Choosing proper values for occurrence probability of mutation and crossover has a significant impact on the GAs performance.The authors also tried to strike an appropriate balance between exploitation and exploration of GAs using Fuzzy logic.So in their Fuzzy system, probabilities of mutation and crossover are adjusted to acquire better solutions and faster convergence speed.Their designed Fuzzy system contains 7 fuzzy sets and 98 rules for each input.

Firefly Algorithm
In this section, we first describe the behavior of the firefly algorithm, and then the issue of exploitation and exploration within firefly.

Standard Firefly
There are hundreds of firefly species in nature and most of them produce short and rhythmic flashes.The motive behind the flashing light is twofold (Yang, X. S., & Deb, S. (2009, December), Yang, X. S. (2010)): (1) to communicate with other fireflies and attract matting partners, and (2) to allure and hunt prey.The rhythm, rate and duration of the flashing light all form one part of the signal system whose purpose is to bring both sexes together.In the same specie, females respond to a male's unique pattern of flashing (Fister, I., Yang, X. S., & Brest, J. (2013)).Actually, fireflies tend to move toward those that are the brighter.The attractive power depends on the brightness of the firefly i.e. its light intensity, which actually attenuates with the distance.The light intensity I at a particular distance r from the light source obeys the inverse square law.In other words, I decreases as r increases in terms of I / r 2 .Furthermore, the light is absorbed by air and becomes weaker and weaker.These two combined factors may make fireflies' vision limited.
The firefly algorithm, introduced by Xin-She Yang in 2008 (Yang, X. S. ( 2010)), is one of the popular Metaheuristic algorithms that can address a large variety of non-trivial optimization problems.The steps of firefly are exposed in Algorithm 1 where m is the number of fireflies, the size of the random step, the absorption coefficient, and I the light intensity at source, which can be defined as I = f(x i ) or I=1.We may note that ∈ [0, ∞) and ∈ [0,1).(Durkota, K. (2011)).
The other features, like distance , , attractiveness β and the movement behavior of fireflies, are described in Table 1 (Yang, X. S. ( 2010)).Random() is a function that produces uniformly distributed vectors of [0,1).

Feature
Description Equation

Distance
Distance between two fireflies i and j at locations x i and x j respectively.

Attractiveness
Attractiveness of a firefly closely depends on the light intensity one can see from distance r and absorption coefficient γ.

Movement
The movement of firefly i toward firefly j (at x i and x j ) that is brighter and more attractive.

Brightest firefly movement
The brightest firefly at location x min moves stochastically.
According to the movement equation (3), each firefly utilizes random step (α.(random()-1/2)) and local step (x i +β.( x i + x j )) when moving toward the brighter fireflies Yang, (X. S. ( 2010)).The brightness of fireflies, representing the solution quality, is calculated with a fitness function that is defined according to the problem being solved (Yang, X. S. ( 2010)).The brightest firefly is the optimal solution.

Controlling Parameters of Firefly Algorithm and its Extreme Cases
Determining the exploitation and exploration balance has always been a challenging issue in metaheuristic algorithms.Here we investigate the movement equation of firefly to address this issue.As discussed before, every firefly when moving toward the brighter fireflies follows equation 3. The latter is composed of the movement induced by better firefly locations (their solutions) and random movement.The positions of better fireflies are considered as hints for quality points, and the weaker firefly moves toward them by searching their neighboring areas in attempt to find higher quality solutions to enhance its status (quality).Therefore, according to the definition of the exploitation, this induced motion by better fireflies is the local search.This movement is controlled mainly by Gamma parameter ( So, different values of Gamma cause different amounts of exploitation.On the other hand, fireflies also perform random movement not influenced by other fireflies.They just stochastically move through the problems space, and this results in discovering new points that are not necessarily in the neighboring areas of already discovered solutions.As stated in equation 3, the random movement part is controlled by Alpha ( [ 0 , 1 )   α ∈ ).In fact Alpha controls the size of the random steps of firefly i.e. the exploration.To find out about the importance of tuning the two controlling parameters, we discuss extreme cases in firefly algorithm.
From equation (3), there are two extreme cases of the firefly algorithm as demonstrated in (Durkota, K. (2011)): As a result, equation (3) turns into equation ( 5): (5) According to the equation 5, the only movement is random movement.Here there are no hints about quality solutions' positions and fireflies move without considering the previous searching steps.We already know that searching problem spaces blindly does not result in finding the optimum solution.This is specially the case when the algorithm is dealing with complex problems with high dimensional problem spaces.
As a result, equation (3) turns into equation ( 6): Equation ( 6) states that the distance parameter between fireflies is removed, and therefore fireflies observe each other very clearly (Durkota, K. (2011)).In this case, exploitation reaches its highest value while exploration remains normal.This reveals that the algorithm mainly does local search, and this increases the probability of being trapped in local optimum (Durkota, K. (2011)).
In regard to these two cases, the need for a parameter controller is irrefutable.Such controller will achieve a balance between exploration and exploitation under different situations that may occur in each solving step of the firefly algorithm.

Exploration and Exploitation Balance in Firefly
Controlling parameters of firefly algorithm which control the exploitation and exploration amount are Gamma and Alpha, utilized in equations ( 2) and (3).Gamma controls the exploitation and Alpha the exploration.The behavior of firefly should be constantly monitored to be able to allocate proper values to its controlling parameters in order to attain the right balance (online strategy) (Liu, Y., & Ma, L. (2011, May)).In the initial solving steps, there is no hint about the location of the optimal solution.So, the maximum participation rate of exploration is needed (to produce more diversity solution) to produce diverse solutions which is very important issue in metaheuristic algorithms.As discussed in previous section this diversity causes algorithm not to be trapped in local optimum solutions at the initial steps of solving problems.As the algorithm approaches the optimal solution, the contribution rate of exploration must be reduced and exploitation must be increased.But in some steps that progress of the solving a problem is weak, it implies that algorithm is stuck in local optimum solution and suffers from premature convergence due to lack of appropriate diversity solutions.In this situation emphasizing the exploration to produce more diversity solutions helps the algorithm to escape the trap.In the final steps, the minimum distance to the goal is expected, so a high rate of exploration cannot be fruitful as it may causes the algorithm lose the optimal solution.Consequently, in the final steps, the burden of the search must be carried out mainly by exploitation rather than exploration.General speaking, from the beginning to the final steps, the maximum rate of exploration decreases to a minimum quantity, and the minimum rate of exploitation increases to a maximum quantity.This trend, which is illustrated in Figure 1, is the basis to design a Fuzzy rule base for our parameter controller (the vertical axis indicates the range of exploitation/exploration amounts and horizontal axis the progress of problem solving, iteration simply).
There are different options for the inference engine, such as Product Inference Engine, Minimum Inference Engine, Lukasiewicz Inference Engine and Dienes-Rescher Inference Engine.We refer the reader to (Wang, L. X. (1999)) for more information.Fuzzy systems can be employed as controlling components in two different ways: (1) closed-loop controller, or (2) open-looped controller.The first controller is applied when a continuous control action of a process is needed.The fuzzy system measures the outputs continuously to perform its mission.However when it is applied as an open-loop controller, the fuzzy system usually sets up the controlling parameters, and then operates with respect to these parameters.Since we need to continuously monitor the progress of the firefly algorithm to be able to allocate appropriate values to the controlling parameters, we then utilize the closed-looped Fuzzy controller.
Example: Let us assume a Fuzzy system (with 2 inputs and 1 output) is designed with the following two rules: where L and LM are two Fuzzy sets deployed with the following membership functions: We would like to apply the Singleton fuzzifier and the Product Inference Engine defined respectively as follows: We may note that if X * is some point in U, then the inference engine is changed to equation ( 11): When the input pair (Delta, Count) is set to (0.21, 0.23), the equation ( 9) will produce the Fuzzy output: ' ( ) max [ (0.21) Now by employing the Center Average Weight defuzzifier (Haynes, W., (2013)), the output Y (here Gamma) would be:


where y -1 and y -2 denote the center of the first and second Fuzzy sets respectively, and y -1 =0 and y -2 =1.We can see that small changes in weights (heights of the Fuzzy sets) result in small changes in the output Y.

Proposed Fuzzy-Based Firefly Algorithm
A decision making task needs to be performed simultaneously with firefly when processing optimization applications.A Fuzzy system as parameter controller is proposed in this section to enhance the performance of the firefly algorithm.

Improving Firefly
We utilize two measures to examine the progress trend of firefly in approaching the optimal solution.The first one is the main loop counter (iteration) of the algorithm, renamed here Count and whose value is determined based on the experts' experience or by trial and error.To cover all probable cases that may occur during the searching process because of the stochastic nature of firefly, another measure is needed to warn the fuzzy controller system about unsuitable situations.The latter must be addressed by the fuzzy controller.Thus we introduce the measure, called Delta, which is calculated according to equation ( 12): When maximizing an optimization problem: And when minimizing the problem: where Best i is the best solution in iteration i and TBest i-1 is the best solution found from the beginning to (i-1)-th iteration.In fact, the algorithm records the history of its achievements to make decision in the current step.Equation ( 12) calculates the difference between the best solution in iteration i and the best solution found before iteration i.It is expected that Delta decreases gradually from the beginning to the end.But if some undesirable situations occur, the designed Fuzzy system helps firefly overcome these situations and approach the optimal solution.
The mathematical representation of the proposed fuzzy system is given below.More precisely, we employ five Product Inference Engine (with Mamdani's product implication): where M is the number of Fuzzy rules and N the number of Fuzzy sets, which are 25 and 5 respectively in our fuzzy system.

Fuzzy Controller
Figure 3 depicts the closed-loop relationship of the enhanced firefly algorithm with our fuzzy system.In each searching step, the fuzzy system receives two inputs from the algorithm, Delta and Count, updates Alpha and Gamma accordingly, and then sends them to firefly in order to adjust the exploration and exploitation rates.The proposed system controls the algorithm behavior in run-time.This will definitely improve the performance of the searching tasks.More precisely, our system employs the Singleton fuzzifier, Mamdani Inference Engine, Centroid defuzzification, Max Aggregation, Min Implication, Max for the Or method, Prod for the And method, and a rule-base with 25 if-then rules.As we can see in Algorithm 2, the improved firefly calculates Delta and then calls the fuzzy system in each resolution step.We have developed the entire fuzzy system by using the fuzzy toolbox MATLAB 2010 as presented in Figure 4. Assume that the parameter Delta is in the interval of [0, 100].Considering this domain, the triangular membership function determines the degree of Delta membership to each of the five fuzzy sets.For example when Delta=5, its membership degree to L is 0.9 and 0 to the other four sets (see Figure 5).

Fuzzy Rule-Base
The rules of a fuzzy system define the logical relationship between the inputs and outputs.The rule base should be meticulously designed so that it covers all the situations firefly may encounter when searching for the optimality.Additionally, the base should contain no conflicting rules, meaning that no more than one rule fire for the inputs.We propose a base with a total of 25 rules exposed in Table 2.The main strategy behind these rules is to emphasize on the global search when there are not much hints about the optimum solution, but more we approach the optimal solution more we emphasize on the local search.
Table 2. Rule base of the Fuzzy controller (Fuzzy If-Then rules)

If (Count is H) and (Delta is MH) Then (Alpha is MH)(Gamma is MH) 25. If (Count is H) and (Delta is H) Then (Alpha is H)(Gamma is M)
As an example, let's assume that Count is L and Delta is M. In this case, the third rule is fired:

If Count is L and Delta is M then Alpha is MH and Gamma is LM
When Count is L, it means that the searching process is still in its beginning steps and the emphasis should be on the random steps to search more globally and produce more diverse solutions.Delta is M means that the difference between the current best solution and the best solution found so far belongs to the medium set.So these values of Count and Delta fire the third rule, which sets Alpha to MH and Gamma to LM.These values put the emphasis more on exploration and less on exploitation.
The 3-D schematic of changes in variables Alpha and Gamma by considering the changes in variables Count and Delta are illustrated in Figures 6 and 7. We can see that the fuzzy controller is designed in a way that from the beginning to the end of the solving problem, by approaching the optimal solution, the emphasis of the algorithm gradually changes from exploration to exploitation.To get more familiar with the functionality of the new Fuzzy system, consider Figure 8.We may note for each pair of Delta and Count, there would be a rule to be fired to produce the specific outputs (Alpha and Gamma).

Low and High Dimensional Problems
To properly evaluate the performance of our Fuzzy-based Firefly Algorithm (FFA), we conduct several experiments based on well-known benchmark problems.The benchmark set contains 10 low and 10 high dimensional standard functions.Moreover, we compare the results achieved by the new method with those of the standard firefly as well as with other famous nature-inspired optimization algorithms, including Differential Evolution (DE), Particle Swarm Optimization (PSO), Accelerated PSO (APSO), Biogeography-Based Optimization (BBO), Interior Search Algorithm (ISA) and Krill Herd (KH).In fact, we have applied these four algorithms to the 20 functions.

Standard Benchmark Functions
We employ high dimensional (F1-F10) and low dimensional (F11-F20) continuous functions that are difficult to solve due to their dimensionality (Bidar, M., & Kanan, H. R. (2013, August)) and are used frequently by researchers to examine the performance of different optimization methods.These functions can be divided into two categories: unimodal and multimodal (functions that have more than one local optimum and therefore it is difficult to find the optimum solution (Bidar, M., & Kanan, H. R. (2013, August), Hassanzadeh, T., & Kanan, H. R. ( 2014)).The goal here is to minimize these functions described in Table 3. Except for Schwefel 2.21, all the other functions are differentiable.

Performance Evaluation and Comparison
The population size is set to 100, Gamma and Alpha are in the intervals [0, 1] and [0,1) respectively.Gamma is set to its minimum value and Alpha to its maximum at the beginning of the searching process to emphasis the exploration.Due to the stochastic behavior of the metaheuristic optimization algorithms, their performance cannot be judged in one single run.So, the experimental results are the average of 50 trials.In order to facilitate the comparison, all the results are normalized according to following equation (Ali, M. M., Khompatraporn, C., & Zabinsky, Z. B. (2005) where , i normalized X is the normalized value of solution i, i X the fitness value of solution i, min X and max X its minimum and maximum fitness values respectively.The normalized statistical results of the proposed method along with the results of the other metaheuristic algorithms on high and low dimensional benchmark functions are given in Tables 4 and 5

Statistical Comparison
A useful statistical experiment to compare the efficiency of metaheuristic algorithms is the Non-parametric Wilcoxon Rank Sum Tests (Haynes, W., (2013)).We carry out this experiment with the results achieved by the proposed algorithm and also the seven mentioned metaheuristic algorithms on the 20 benchmark functions.The outcomes of this experiment are presented with P-value and H that help finding out whether there is a significant difference between the performance of FFA with another algorithm or not (see Table 6).H gets three values: 1 -, 0 and 1 + , and in which 1 -indicates that the performance of two algorithms is significantly different with 95% of confidence, 0 shows that there is no statistical difference, 1 + indicates that FFA has a higher performance than the other one.

Analysis Results
From the results exposed in Tables 4 and 5, we can see that our fuzzy system significantly improves the performance of the firefly algorithm.This is due to the capability of the fuzzy firefly algorithm in recognizing different optimization situations and taking appropriate actions to handle them.The improved firefly algorithm employs a set of 25 fuzzy if-then rules.All the situations that may happen during the search are covered by these rules.For instance, when the value of parameter Delta is expected to change (at the beginning for example), the fuzzy system by considering the values of Delta and Count recognizes that the algorithm is being stuck in local optimum trap.So increasing the exploration amount (by changing its controlling parameters) enables the algorithm to escape from that trap.The reason for being stuck is that the algorithm cannot find better solutions.
To escape from that trap, firefly must be enabled to take bigger steps.According to these tables, FFA outperforms SFA in all the experiments, and achieves very comparable results to the other metaheuristic algorithms.
To statically compare the results achieved by FFA and other metaheuristic algorithms, we perform the Wilcoxon Rank Sum test.Some analytic notions about this test are expressed below: • F1 is Ackley function.The proposed method ranked third in this experiment.It has statistically significant performance over DE, KH, BBO and PSO algorithms.There is no statistically significant performance between FFA and APSO.FA and ISA have statistically significant performance over FFA algorithm.From Table 6, we can see that in most of the experiments, the results achieved by FFA are comparable with those of the seven metaheuristic algorithms.The high performance of FFA is mainly due to its dynamic behavior.
Achieving the exploration-exploitation balance in run-time (on-line strategy) enables firefly to effectively move toward the best solution by avoiding local optimums.
To compare performance of FFA and SFA visually, convergence trends of them on four benchmark functions are shown in Figure 9.To facilitate the comparison, we have used semilogy function of MATLAB in plotting the convergence trends of algorithm.These plots confirm the higher performance of FFA to SFA in term of reaching the optimal solution.From the graphs, the convergence trend to the global optimum can be easily seen.This demonstrates that the proposed Fuzzy system has a great impact on the performance of firefly.By allocating proper values to the firefly parameters, the Fuzzy system keeps exploration-exploitation in balance.This will cause firefly not to be trapped in local optimum solutions while searching the problem space.
Figure 9. Convergence comparison between FFA and SFA on some benchmark functions.

Constrained Engineering Problems
Here, we assess the efficiency of our algorithm when applied to two constrained engineering problems, pressure vessel design and spring design, which have been utilized frequently to check the capability of different constrained optimization algorithms.Constrained optimization is the process of optimizing an objective function subject to some constraints imposed on the problem variables.The constraints divide the problem space into two subspaces: the feasible space where all the constraints are satisfied and the unfeasible space where at least one constraint is violated.The solutions of a constrained problem must be found in the feasible space.The parameters of the Fuzzy-based firefly algorithm are set in the same way as in the previous experiment.

Pressure Vessel Design
As presented in Figure 10, the pressure vessel consists of a cylinder topped with two hemispherical heads (Gandomi, A. H., & Alavi, A. H. (2012)).The objective here is to minimize the total cost by including the costs of the material, forming and welding.The involved variables of this optimization problem are four: thickness of the head (x 1 ), thickness of the shell (x 2 ), inner radius (x 3 ) and length of the cylinder not including the heads (x 4 ) (see figure 10).Table 7 exposes the constraints and cost function of this problem.
Figure 10.The pressure vessel design problem (Cagnina, Esquivel & Coello, 2008) Table 7. Constraints and cost function of the pressure vessel design problem The simple bounds of this problem are: 1×0.0625 ≤ x 1 , x 2 ≥ 99×0.0625,10.0 ≤ x 3 and x 4 ≤ 200.0.In Table 8, we show the best solution X* found by FFA and its total cost.This solution was produced through a run of 120 000 evaluations by satisfying all constrains of the problem.The statistical results obtained by FFA, SFA and 20 other optimization algorithms are presented in Table 9.As we can see in addition of being superior to SFA, FFA achieved comparable result in comparison with the other optimization also.This table shows that the best weight is 6059.714,obtained by the ISA algorithm.FFA produces the minimum weight of 6061.107, which is very close to the best result.We may note that FFA is better than SFA.However due to the random nature and stochastic behavior of the nature-inspired algorithm their real performance cannot be judged in a single run.So in this experiment we also include the mean and standard deviation values for each of the algorithms.In term of mean value the result achieved by FFA is much better that the result achieved by SFA and is superior to five out of fifteen optimization methods.

Tension/Compression Spring Design
The problem objective is to minimize the weight of a tension/compression spring that is subject to several constraints, like the minimum deflection, shear, surge frequency and limits on the outside diameter (see  10.   Cost( ) ( 2) The simple bounds of this problem are: 0.05 ≤ x 1 ≤2.0, 0.25 ≤ x 2 ≤1.3 and 2.0 ≤ x 3 ≤15.0.Table 11 shows the best solution found through a run of 90 000 evaluations by respecting all the elicited constraints.shows that the best weight is 0.012665, which is obtained by TCA, SA-DS and ISA algorithms.FFA is superior to SFA and very comparable to the other algorithms.Indeed, FFA produces the minimum weight of 0.012704, which is extremely close to the best result.We may note that FFA is better than SFA.However due to the random nature and stochastic behavior of the nature-inspired algorithm their real performance cannot be judged in a single run.So in this experiment we also include the mean and standard deviation values for each of the algorithms.In term of mean value the result achieved by FFA is much better that the result achieved by SFA and is superior to seven out of fifteen optimization methods.

Conclusion
The goal of this study is to tune dynamically the firefly parameters in order to achieve appropriate rates for the exploration and exploitation.To this end, we have employed Fuzzy logic and devised a Fuzzy system as a parameter controller for the firefly algorithm.In each of the optimization steps, the Fuzzy system adjusts efficiently the values of the firefly parameters based on a set of Fuzzy rules.Attaining a good balance between exploration and exploitation causes the firefly algorithm to move effectively toward the optimal solution and to avoid local optimum traps as demonstrated in this paper.To assess the efficiency of the new algorithm in terms of the solution optimality, we have conducted extensive experiments.First we have applied our Fuzzy-based firefly, the standard firefly and four other famous metaheuristic algorithms (Differential Evolution, Particle Swarm Optimization (PSO), Accelerated PSO and Krill Herd), Biography-Base Optimization (BBO) and Interior Search Algorithm (ISA) to ten low and ten high dimensional optimization problems.Second, we have compared the performance results of these six optimization algorithms.The experimental results proved the superiority of our proposed Fuzzy-based firefly algorithm to standard firefly.In all the experiments on standard benchmark functions, the Fuzzy firefly algorithm performed better than the standard firefly and achieved the best results in nine out of twenty benchmark functions.In the rest of the experiments, it achieved very comparable results to the other optimization algorithms.We also conducted a statistical experiment by using the Non-parametric Wilcoxon Rank Sum Tests to statistically investigate the performance of the proposed method compared to the other optimization methods.Furthermore, we have applied the improved firefly and standard firefly to two constrained engineering problems, and have demonstrated that our method is much better than standard firefly and very comparable to the best optimization algorithms in the literature.
The design of Fuzzy systems, particularly the underlying rule bases and membership functions, is based on human knowledge.Thus, we would like to enhance our Fuzzy system to improve the performance of firefly for instance by deploying more practical Fuzzy membership functions and also a better Fuzzy rule base that will cover more situations that firefly may encounter when searching for the optimal solution.Another future work would be assessing different combinations of the Fuzzy components (i.e.different fuzzifiers, defuzzifiers and inference engines) in order to find out the best arrangement that will lead to the most efficient firefly algorithm.

Figure 1 .
Figure 1.Change trend of exploration and exploitation from the beginning to the end

Figure 3 .
Figure 3. General Schematic of Fuzzy-based firefly

Figure 5 .
Figure 5. Membership degree of Delta=5 to Fuzzy sets

Figure 6 .
Figure 6.The 3-D surface plot of output Alpha

Figure 7 .
Figure 7.The 3-D surface plot of output Gamma respectively.Due to the random nature and stochastic behavior of the nature-inspired algorithm their real performance cannot be judged based on a single run.So in our experiments we report the results achieved in 50 runs.The results demonstrate that the proposed fuzzy controller increased the performance of the Standard Firefly Algorithm (SFA) since FFA outperforms SFA in all the experiments.Also, FFA is superior to the other metaheuristic algorithms in nine out of twenty experiments, and very close in the other experiments.

F2
Figure 11) (Cagnina, L. C., Esquivel, S. C., & Coello, C. A. C. (2008)).The design variables of this problem are three: the wire diameter (x) 1 , the mean coil diameter (x 2) , and the number of active coils (x) 3 .The constraints and cost function of the problem are shown in Table

Table 4 .
Statistical results of FFA and other metaheuristic algorithms on low dimensional problems

Table 5 .
Statistical results of FFA and other metaheuristic algorithms on high dimensional problems Tables4 and 5present and compare results of our experiments on high and low dimensional benchmark functions.In these tables results have been reported in terms of Best (best results achieved by algorithms), Mean (mean of best results in 50 runs) and Standard Deviation.From the results we can see that in most of the experiments proposed algorithm achieved very good results.It outperformed other metaheuristic algorithms in nine (out of twenty) experiments and achieved very comparable results in the other experiments with the other algorithms.

Table 6 .
Statistical comparison between FFA and other metaheuristic algorithms

•
F3 is Rosenbrok function.The proposed algorithm achieved the second best result in this experiment in comparison with other metaheuristic algorithm participated in this experiment.The FFA has statistically significant performance over FA, DE, BBO, ISA and PSO algorithms.There is no statistically significant performance between FFA, KH and APSO algorithms.• F5 is Schwefel 2.26 function.FFA algorithm achieved the best result in this experiment.It has statistically significant performance over FA, KH, DE, PSO, BBO, ISA and APSO.• F7 is Schwefel 1.2 function.FFA algorithm ranked first in this experiment.It has statistically significant performance over FA, KH, DE, BBO, ISA and PSO.There is no statistically significant performance between FFA and APSO.• F9 is Rastrigin function.FFA algorithm ranked first in this experiment.Statistically it has significant performance over FA, KH, BBO, ISA and DE.There is no significant performance between FFA, PSO and APSO.• F11 is Branin function.FFA algorithm achieved the second best result in this experiment.Statistically it has significant performance over FA, BBO, ISA and DE.There is no statistically significant performance between FFA, KH, PSO and APSO.GSA has significant performance over FFA algorithm.• F13 is De Joung function.FFA algorithm ranked second in this experiment.It has statistically significant performance over KH, DE, PSO, BBO, ISA and APSO.There is no statistically significant performance between FFA and FA.• F15 is Hartman 1 function.FFA achieved the second best result in this experiment.It has statistically significant performance over FA and PSO.KH, DE, BBO and APSO and ISA have significant performance over FFA.• F17 is Kowalik function.FFA ranked first in this experiment.It has statistically significant performance over FA, KH, DE, PSO, ISA and APSO.There is no statistically significant performance between FFA and BBO.• F19 is Shekel 2 function.FFA algorithm achieved the best result in this experiment.Statistically it has significant performance over FA, DE, KH, BBO, ISA and PSO.There is no significant performance between FFA and APSO.

Table 8 .
Best solution of the pressure vessel problem found by FFA

Table 10 .
Constraints and cost function of spring design problem

Table 11 .
Best solution of the tension/compression spring problem found by FFA Table12compares the statistical results obtained by FFA, SFA and the 20 metaheuristic algorithms.This table