The standard firefly algorithm.
Firefly algorithm is one of the well-known swarm-based algorithms which gained popularity within a short time and has different applications. It is easy to understand and implement. The existing studies show that it is prone to premature convergence and suggest the relaxation of having constant parameters. To boost the performance of the algorithm, different modifications are done by several researchers. In this chapter, we will review these modifications done on the standard firefly algorithm based on parameter modification, modified search strategy and change the solution space to make the search easy using different probability distributions. The modifications are done for continuous as well as non-continuous problems. Different studies including hybridization of firefly algorithm with other algorithms, extended firefly algorithm for multiobjective as well as multilevel optimization problems, for dynamic problems, constraint handling and convergence study will also be briefly reviewed. A simulation-based comparison will also be provided to analyse the performance of the standard as well as the modified versions of the algorithm.
- Metaheuristic Algorithms
- Parametric Modification
- Binary Problems
An optimization problem refers to the maximization or minimization of an objective function by setting suitable values for the variables from a set of feasible values. These problems appear not only in complex scientific studies but also in our day-to-day activities. For instance, when a person wants to go from one place to another and has multiple possible routes, a decision needs to be made on which route to take. The decision can be with the objective to minimize travel time, fuel consumption and so on. However, these kinds of problems with fewer number of alternatives can easily be solved by looking at the outcome of each of the alternatives. However, in real problems, it is not always the case to have a finite and small number of alternatives. Hence, different solution methods are proposed based on the behaviour of the problem.
Since the introduction of evolutionary algorithms, many studies have been conducted on heuristic algorithms. Introducing new algorithms has been one of the leading research areas . Currently, there are more than 40 metaheuristic algorithms . Most of these new algorithms are introduced by mimicking a scenario from nature. For instance, genetic algorithm is inspired by the Darwin theory of survival of the fittest ; particle swarm optimization is another metaheuristic algorithm mimicking how a swarm moves by following each other ; firefly algorithm is inspired by how fireflies signal each other using the flashing light to attract for mating or to identify predators  and prey predator algorithm is another new algorithm inspired by the behaviour of a predator and its prey . These algorithms use different degree of exploration and exploitation based on their different search mechanisms.
Firefly algorithm is among those metaheuristic algorithms which have different applications. Its uncomplicated and easy steps with its effectiveness attract researchers from different disciplines it. Different studies have been performed to modify the standard firefly algorithm to boost its performance and to make it suitable for a problem at hand. In this chapter, a comprehensive study will be presented on firefly algorithm and its modified versions. A brief discussion on extended firefly algorithm with other relevant studies will also be provided. In the next section, a discussion on optimization problems with their solution methods will be given followed by a review on studies on firefly algorithm, which includes a discussion on the standard firefly algorithm with its modified versions and other relevant studies on firefly algorithm, in Section 3. In Section 4, a comparative study based on simulation results will be presented followed by summary of the chapter in Section 5.
2. Optimization problems
Decision-making problems can be found beyond our daily activity. They are very common in engineering, management and in many other disciplines. Different researchers used the concept of optimization in different applications, including engineering applications, transportation planning, management applications, economics, computational intelligence, decision science, agriculture, tourism, sport science and even political science [7–18].
When these problems are formulated mathematically, they are called mathematical optimization problems. It will have a set of feasible actions, also called feasible regions, and a measure of performance of these actions called the objective. A standard single objective minimization problem can be given as in Eq. (1).
where is called the objective function,
In a broad sense, optimization solution methods can be categorized as exact and approximate solution methods. Exact solution methods are methods which use an exhaustive search for the exact solution in the solution space. They use mathematical and statistical arguments to get an exact solution. They mainly used calculus-based and iterative procedures. Perhaps Fermat is the first to use a calculus-based argument to solve optimization problems . Iterative methods were first proposed and used by Newton and Gauss . Since then, several exact solution methods are proposed and used in different problems. Branch and bound, simplex method and gradient descent method are good examples of exact solution methods. However, due to complex problems modelled from complex real aspects, it becomes challenging for the deterministic solution methods. This leads to the search of new 'out of the box' way of solving these problems, which in turn gives rise to the birth of metaheuristic solution algorithms.
Metaheuristic algorithms are approximate solution methods for an optimization problem which use a randomness property with an 'educated guess' in their search mechanism and try to improve the quality of the solutions at hand through the iterations, from a randomly generated set of feasible solutions, by exploring and exploiting the solution space. Even though these algorithms do not guaranty optimality, they are tested to give a reasonable and acceptable solution. Furthermore, they have the advantage of not to be affected much by the behaviour of the problem; this makes them useful in many applications. Having a variety of algorithms will give the option to choose a suitable one to solve a problem according to its behaviour.
3. Studies on firefly algorithm
Nature has been an inspiration for the introduction of many metaheuristic algorithms. It has managed to find solution to problems without being told but through experience. Natural selection and survival of the fittest was the main motivation behind the early metaheuristic algorithms. Different animals communicate with each other through different mode of communications. Fireflies use their flashing property to communicate. There are around 2000 firefly species with their own distinct flash patterns. They usually produce a short flash with a certain pattern. The light is produced by a biochemical process called the bioluminescence. The flashing communication is used to attract their mate and also to warn predators. Based on the pattern of the light, a suitable mate will communicate back by either mimicking the same pattern or responding with a specific pattern. It also needs to be noted that the light intensity decreases through distance; hence, a flashing light emanating from a firefly gets a response from fireflies around it within a visual range of the flash.
In addition to enjoying the beautiful view of a summer sky created by fireflies, they have motivated and have been the centre for many scientific researches [5, 21, 22]. In the sense of optimization, if we consider the fireflies as solution on the landscape of the solution space, then the attraction and movement of fireflies can inspire an optimization algorithm in which solutions follow better (brighter) solutions. Hence, firefly algorithm is motivated and inspired by these properties.
3.1.1. The standard firefly algorithm
Firefly algorithm is a swarm-based metaheuristic algorithm which was introduced by Yang . The algorithm mimics how fireflies interact using their flashing lights. The algorithm assumes that all fireflies are unisex, which means any firefly can be attracted by any other firefly; the attractiveness of a firefly is directly proportional to its brightness which depends on the objective function. A firefly will be attracted to a brighter firefly. Furthermore, the brightness decreases through distance based on inverse square law, as given in Eq. (2).
If the light is passing through a medium with a light absorption coefficient
In the algorithm, a randomly generated feasible solution, called fireflies, will be assigned with a light intensity based on their performance in the objective function. This intensity will be used to compute the brightness of the firefly, which is directly proportional to its light intensity. For minimization problems, a solution with smallest functional value will be assigned with highest light intensity. Once the intensity or brightness of the solutions is assigned, each firefly will follow fireflies with better light intensity. For the brightest firefly, it will perform a local search by randomly moving in its neighbourhood. Hence, for two fireflies, if firefly
These updates of the location of fireflies continue with iteration until a termination criterion is met. The termination criterion can be maximum number of iterations, a tolerance from the optimum value if it is known or no improvement is achieved in consecutive iterations. The algorithm is summarized in Table 1.
3.2. Modified versions of firefly algorithm with critical analysis
Firefly algorithm is efficient and an easy-to-implement algorithm. It is also suitable for parallel implementation. However, researches show that it is slow in convergence and easily gets trapped in local optimum for multimodal problems. In addition, the updates solely depend on current performance and no memory on previous best solutions and performances are kept. That may lead to losing better solutions. Furthermore, since the parameters are fixed, the search behaviour remains to be the same for any condition in all iterations. Hence modifying the standard firefly algorithm to boost its performance has been one of the research issues. Furthermore, the standard firefly algorithm is designed for continuous optimization problems; hence in order to use it for non-continuous problems it needs to be modified and adjusted.
3.2.1. Modification for problems with continuous variables
Basically, there are three classes of modification. Class 1 modification is the modification on the parameters. It is the first category in which the parameters of the algorithm are modified and the same updating mechanisms or formulas are used. Class 2 contains new updating mechanisms. It includes modifications which change part or all of the updating formulas, add mutation operator and the likes. The last category, Class 3, includes modifications on the search space, perhaps with the same updating mechanism it may be easier to switch to another ‘easy-to-search’ space, and changes in the probability distribution when generating random numbers. The categories are not necessarily disjoint as some of the modifications may fall in multiple classes.
18.104.22.168. Class 1 (parametric modification)
In the standard firefly algorithm, the parameters in Eq. (6) are user-defined constants. Like any other metaheuristic algorithms, the performance of a firefly algorithm depends on these parameter values. They control the degree of exploration and exploitation.
Some of the modifications of firefly algorithm are done by making these parameters variable and adaptive. In recent researches on the modification of firefly algorithms, the parameters
a. Modifying the random movement parameter:-
To deal with parameter identification of infinite impulse response (IIR) and nonlinear systems, firefly algorithm is modified in . The modification with the random movement is based on initial and final step lengths
Another firefly algorithm with adaptive
In , the randomized parameter is modified based on the number of iterations using . The simulation results in 16 benchmark problems show that the modification increases the performance of the standard firefly algorithm significantly.
In extending firefly algorithm for multiobjective problems, an adaptive
Self-adaptive step firefly algorithm is another modification done to the third term of the updating process by Yu et al. . The step length
Another study of modification of the random movement parameter based on the historic performance of the solution is presented in . Based on its best position until current iteration,
b. Modifying the attraction parameters
The attraction of one firefly by another depends on the light intensity at the source of the brighter firefly as well as on the distance between them and the light absorption coefficient of the medium.
For a small change in the distance between two fireflies results in a quick decrease of the attraction term. To deal with this problem, Lin et al.  introduced a virtual distance which will put
Tilahun and Ong  suggested that, rather than making
Due to the non-repetition and ergodicity of chaos, it can carry out overall searches at higher speeds. Hence, Gandomi et al.  proposed a modification on
c. Modifying both the random and attraction movement parameters
To overcome this challenge arising with an increase in the problem dimension and the size of the feasible region, Yan et al.  proposed a modification for the standard firefly algorithm. This modification is done on the generalized distance term given in Eq. (5), in which
In order to solve economic dispatch problem, firefly algorithm is modified in . To increase the exploration property, the authors replaced the Cartesian distance by the minimum variation distance. In addition, they used mutation operator on
To deal with premature convergence, firefly algorithm has also been modified based on the light intensity . The light intensity difference is defined by for an iteration
For the optimal sizing and siting of voltage-controlled distribution generator in distributed network, firefly algorithm is modified and is used in . The problem is to minimize the power loss by selecting optimal location for distributed generations and the power produced. In the modification
Another modification of the standard firefly algorithm to be listed in this category is done in . The randomized parameter
For path planning of autonomous underwater vehicle, the parameters
A similar approach in which the parameters
22.214.171.124. Class 2 modifications (new updating mechanisms)
The updating mechanism in the standard firefly algorithm is guided by Eqs. (6) and (7). In Class 1 modification, the same updating equations are used but with adaptive preference. Class 2 modifications include modification on the updating equations including modification in the updating process of the best (the brightest) and the worst (the dimmer) solutions changing part of the updating equations and some modification with additional mutation operator.
a. Modifying the movement of the brightest or dimmer firefly
In a high dimensional problem, the exploration is weak which results in premature convergence. To deal with this, two modifications are proposed in  for the standard firefly algorithm. That is, for the initial random
for (for all dimensions)
for (for all the solutions)
if [is better than ] end if
Similar to the previous modification, here also the best solution will improve or will not change in each of the iterations.
Opposition-based learning is also used in , to update the dimmer solution , a solution with worst performance, using , for an algorithm parameter
Indeed, it relocates the worst solution to a new position that may give the algorithm a good explorative behaviour.
b. Mutation incorporation
Jumper firefly algorithm is a modified firefly algorithm in which a memory on the performance of each of the solution is kept . A criterion called hazard condition is defined, and solutions will be tested based on their previous performance. If they are in hazardous condition, they will be randomly replaced by a new solution. Hence, based on the hazard condition, a mutation can be done by replacing the weak solution based on previous performance by a new solution.
Another modification in this category is done by Kazemzadeh-Parsi , where each iteration
Another modification of firefly algorithm by introducing new solutions as a mutation or crossover is given in [26, 56]. In addition to adaptive parameter
c. New updating strategy
This is another category of Class 2 modification in which the updating formula, given by Eqs. (6) and (7), is modified or changed. The first modification, to mention in this category, is the modification proposed in . For a firefly
A similar modification in the vicinity of the brighter firefly is given in . They proposed two updating formulas, with and without division, as the authors name them. The updating formula, without division, is given by . Once the fireflies are sorted according to their brightness, increasing with their index, the updating formula will be defined by , which will decrease
For a data clustering problem, the standard firefly algorithm is modified firefly algorithm [60, 61]. They proposed a new updating formula to increase the influence of the brightest firefly. The new updating formula is given by . This means that a firefly is not only attracted to brighter fireflies but also by the best solution found so far, . Suppose there are
Fuzzy firefly algorithm is another modification of the standard firefly algorithm . Even though they start with a wrong claim by saying "
Another modification with a new updating formula is proposed in  and is given by , otherwise where
Diversity-guided firefly algorithm is one of the recent modified versions . The modification is done to make the solutions as diverse as possible with a given threshold. The updating mechanism of the standard firefly is used until diversity of the solution falls beyond the given threshold. The diversity is measured by
In [66, 67], a mutated firefly algorithm is proposed in such a way that the brighter firefly donates some of its features based on a new algorithm parameter called probability of mutation,
In , a firefly located at
Another modification in this category is introduced to deal with economic dispatch optimization of thermal units . A memory is used to record the best solution found so far. Based on cultured differential evolution, the updating formula is modified as where and for
Another modification in this category is presented in . The updating formula becomes for a weighting parameter
126.96.36.199. Class 3 modifications (change in search space or probability density functions)
This class of modifications is on the abstract level modification and includes two types of modifications. The first one is changing the solution space to an easy search space, and the second one is on the types of probability distribution that is used to generate a random vector direction for the random movement.
a. Change in search space
In the modified version presented in , each component of a solution will be represented by quaternion for all components
b. Change in probability distribution function
Perhaps the first work which tries to adapt the randomness movement in the updating process is by Farahani et al. [72, 73]. Even though they started with a wrong claim by saying ‘
By enhancing the random movement of a firefly algorithm, Levy firefly algorithm is introduced in . This is the first modification made to firefly algorithm with the Levy distribution guiding the random movement by generating a random direction as well as the step length. The update formula is modified as ; ⊗ indicates a component-wise multiplication between the random vector from the Levy distribution and the sign vector. Similarly, in , Levy distribution is used to guide the random term of the updating formula. In addition, the parameter
3.2.2. Modifications for problems with non-continuous variables
Even though firefly algorithm is introduced for continuous problems, due to its effectiveness it has been modified for non-continuous problems as well. In this section, we will look at three classes of modification. The first one is when modifications are made to solve binary problems. The second is for integer-valued problems which include problems whose variable can have discrete values. The last one is mixed problems in which some of the variables are continuous and the rest are non-continuous.
188.8.131.52. Modifications for binary problems
To deal with set covering problem, a binary firefly algorithm is proposed in . There is no modification in the updating process except converting the solution to either one or zero. Three ways of conversion are proposed in . The conversion works dimension wise. After a solution
Another modification for binary problems which works dimension wise, in each dimension, is presented in . The update formula of the standard firefly algorithm is used. After the update, the solution will lie in the interval [0, 1] using function for the
Another discrete firefly algorithm, in order to deal with job, schedule problem is proposed in . Each firefly
In , for a dynamic knapsack problem, firefly algorithm has been modified. The conversion of the solutions is done based on the property of the problem using priority-based encoding. In addition to making the algorithm to suit for the problem, some modifications are done to increase its effectiveness. One of the modifications is that a firefly
Another modification in this category is presented in . In addition to the discretization, they have made
184.108.40.206. Modifications for integer optimization problems
In , firefly algorithm has been modified to deal with software modularization as a graph-partitioning problem. Initially, random integer-encoded solutions are generated. The hamming distance, the number of different entries between two solutions with the same index, is used to measure the distance between two solutions. The update is done by switching a number of entries of a firefly by the entries from a brighter firefly.
Another modification in this category is done in . The modification is based on a concept of random key, which is proposed in . The method uses a mapping of a random number space, [0,1]
In [96, 97], the standard firefly algorithm is modified for loading pattern enhancement. The generation of random solutions uses random permutation, and the distance between fireflies, , is measured using hamming's distance. The updating process is separated and made sequentially; first the
For travel salesman problem, firefly algorithm has been modified in . Initial solutions are generated using permutation of
Another modification in this category is proposed in . The decision variables, , represent assembly sequence. In the update, the random movement is omitted, and the attraction move is done in the discrete space. The attraction direction is computed for each dimension
Firefly algorithm has been discretized for supply selection problem in . The sum of the absolute differences between the entries is used to measure the distance . In addition, the movement is modified based on the property of the problem using rounding up for step length. In most cases, a modification specific to a problem is effective for that particular problem or a class of problems. However, it is hard to generalize the problems in other domains. It would be interesting to generalize the approach to be tested in other problem domains as well.
220.127.116.11. Modifications for mixed optimization problems
Perhaps the first modification to the standard firefly algorithm in this category is presented in . The updating of solutions is conducted using the updating mechanism of the standard firefly algorithm. To deal with the discrete variables, constraint handling mechanism is used based on penalty function. In addition, the authors proposed two ways to generate a diverse set of random initial solutions. An adaptive random step length is also proposed using similar updating way in . The same approach is improved in  by adding a scaling parameter for the random movement based on the difference between the maximum and minimum values for each variable. Portfolio optimization can be expressed as a mean-variance problem which belongs to the group of quadratic mixed-integer programming problems. In [106, 107], firefly algorithm has been extended with the use of rounding function and constraint handling approach. Deb’s method  is also used for constraint handling. In addition,
Like any metaheuristic algorithm, firefly algorithm is prone to parameter values. It is noticed that changing the parameters based on the search state is effective. Hence, modification on parameters is a direct forward idea to improve the performance of firefly algorithm. As the search proceeds, in order to have a conversion with good precision, the randomness movement must decrease. Hence, the randomness step length,
The decreasing scenario for
The attraction term has also been modified in different ways. Adaptive light absorption constant of the medium changing with iteration is given in some studies. This modifications use increasing function , decreasing function [43, 67] or neither increasing nor decreasing function [33–38, 49, 50] of
The movement of the best solution should be tuned properly. If it is allowed to decrease then its best performance may get lost. Hence, the approaches used to preserve the best solution are ended effectively [32, 52].
Mutation is another good approach to diversify the solutions which in turn increase the exploration behaviour of the algorithm [24, 53–58]. However, generating many solutions may hinder the search as it will take long to run. In addition, accepting weak solution should also be incorporated in deceiving problems; a solution needs to decrease in order to escape local solutions.
Modifying the update equation is another interesting modification featured in some studies [56, 58–61, 63–67, 69]. These studies suggest that the update should be done in the vicinity of the brighter firefly [58, 60]. This is not always a good idea as the region in between the two solutions will not be explored. Some of the studies indicate an increase in the attraction towards brighter fireflies [61, 64]. It simply means that increasing the step length of the attraction may dominate the random movement or even take the solution out of the feasible region. A memory is utilized to save the best solution found and additional attraction term towards that global solution is added in [63, 69]. It is a good idea in which the best solution will not be lost through iteration. To increase the diversity of the solution, an effective modification is proposed in . Using such kind of modification, the diversity of the solutions will be preserved, and the exploration behaviour of the algorithm will be improved.
Basically, two updating strategies are proposed for the non-continuous case. The first one is using the same updating formula and changing the results to discrete values afterwards [82, 94, 104]. And the second is to modify the updating formula on the discrete space [97–101]. The first problem is susceptible of trapping in local solution and misses the optimal solution. The optimal solution for a continuous version of a discrete problem may not always be an optimal solution for the discrete problem. Hence, the algorithm will tend to converge to the optimal solution of the continuous version of the problem. Hence, the second approach has an advantage in such cases.
4. Simulation results
The comparison of results is performed between the standard firefly algorithm and non-parameter modified version, i.e. Class 2 and Class 3 modifications. The modified versions selected for simulation are based on two criteria, the first one clear modification, that is the modification should be clearly described, and the second one is with small number of new parameters. In some of the modifications, a number of new algorithm parameters are introduced and tuning this parameter by itself needs another study so they are not included in the simulation. The modified versions used for simulation include Firefly Algorithm 1 , FFA2, , FFA3 , FFA4 [26, 57], FFA5 [24, 59], FFA6  FFA7 , FFA8 [61, 62], FFA9 , FFA10  where
4.1. Benchmark problems and simulation setup
Five benchmark problems are selected from different categories as presented in Table 2. The simulations are performed on Intel® Core™i3-3110M CPU @ 2.40 Ghz 64 bit operating system. MATLAB 7.10.0 (R2010a) is used for these simulations. The algorithm parameters are set as given in Table 2 for dimensions 2 and 5.
4.2. Simulation results and discussion
The simulation results, as presented in Table 3, show that some of the algorithms are very expensive in terms of computational time but give a good result, and others have small running time. For instance, in second problem, when the dimension is 2 on average, FFA3 outperforms all with average CPU time of 8.8, whereas FFA1 and FFA2 give a good approximation with smaller average CPU time. In general, it can be seen that FFA4 is very effective but not with the computational time. FFA1 and FFA2 give good approximate results with smaller CPU time compared to FFA4. However, when the dimension increases, FFA2 outperforms FFA1. Perhaps it is due to the fixed random direction m for all the simulations.
|Parameters and set-up|
In this chapter, a detailed review of modified versions of firefly algorithm is presented. The modifications are used to boost its performance for both continuous and non-continuous problems. Three classes of modifications are discussed for continuous problems. The first one being parameter level modification which will improve the performance of the algorithm. The second class is on the updating mechanism level, in which new updating equation or mechanisms are introduced. The last class is in the abstract level in which change of solution space and probability distribution of the randomness term are discussed. The strength and weakness of the approaches are also presented. Simulation results show that mutation-incorporated firefly algorithm gives better result with larger computational time, whereas versions of firefly algorithm with opposition-based learning and elitist movement for the brighter firefly give approximate solution with smaller computational time. Hence, if a proper way of implementation is used, mutation operator and elitist move of brighter firefly algorithm along with possible implementation of opposition-based approach may perform better.