An Enhanced Opposition-based Fire fl y Algorithm for Solving Complex Optimization Problems

Firefl y algorithm is one of the heuristic optimization algorithms which mainly based on the light intensity and the attractiveness of fi refl y. However, fi refl y algorithm has the problem of being trapped in local optimum and slow convergence rates due to its random searching process. This study introduces some methods to enhance the performance of original fi refl y algorithm. The proposed enhanced opposition fi refl y algorithm (EOFA) utilizes opposition-based learning in population initialization and generation jumping while the idea of inertia weight is incorporated in the updating of fi refl y’s position. Fifteen benchmark test functions have been employed to evaluate the performance of EOFA. Besides, comparison has been made with another existing optimization algorithm namely gravitational search algorithm (GSA). Results show that EOFA has the best performance comparatively in terms of convergence rate and the ability of escaping from local optimum point.


INTRODUCTION
In recent years, heuristic optimization methods have obtained a lot of attention from researchers.This is due to their better performance compared to mathematical optimization methods in coping with large and complex optimization problems.There are different types of heuristic optimization algorithms.One of the early works is Genetic Algorithm (GA) (Goldberg & Holland 1988), followed by other methods such as Ant Colony Optimization (ACO) (Dorigo et al. 1996), Particle Swarm Optimization (PSO) (Kennedy & Eberhart 1995), Gravitational Search Algorithm (GSA) (Rashedi et al. 2009) and etc.However, meta-heuristic optimization algorithms have the problem of being trapped in local optimum and slow convergence rates due to their random searching process.This leads to the development of hybrid algorithms that can overcome these issues effectively.
Firefl y Algorithm (FA) is an algorithm developed by X. Yang based on the fl ashing characteristics of fi refl ies (Yang 2008).The FA is illustrated based on three assumptions where fi rstly, all fi refl ies are of the same sex and therefore the attraction between the fi refl ies is independent.Secondly, the attraction between the fi refl ies is proportional to their brightness.This means, the brighter ones will attract the less bright ones.The fi refl ies will move randomly if all fi refl ies having the same brightness.Thirdly, the brightness of a fi refl y is decided by the objective function.
Compared to some other heuristic algorithms, FA is relatively more simple and easy to implement.However, like most of the heuristic algorithms, FA is also facing the problem in escaping from local optimum and pre-mature converges.Therefore, some improvements have been done on it by previous researchers.One of the improvements was introduced by X. Yang where a technique known as Levy fl ight is used to improve the randomization of FA (Yang 2010).Besides, modifi ed FA with cellular learning automata (CLA) was proposed to improve the ability and convergence rate of original FA (Hassanzadeh & Meybodi 2012).On the other hand, inertia weight based FA has been implemented to avoid the pre-mature convergence as well as to recover from being trapped in local optimum (Yafei et al. 2012).The improvement made to FA in this research differs from previous works.In order to further improve the performance of original FA in terms of convergence rate, the opposition-based learning (Tizhoosh 2005) is integrated into FA while the idea of inertia weight FA (Yafei et al. 2012) is also incorporated at the same time to improve the ability of FA to escape from local optimum.

CONVENTIONAL FIREFLY ALGORITHM
Two important components of FA are the light intensity as well as the attractiveness where the attractiveness is decided by the light intensity (brightness) of the fi refl ies.Since the attraction of a fi refl y is proportional to the light intensity as discovered by the nearby fi refl ies, the attractiveness function, β(r) can be defi ned as shown in Equation (1).
where β o is the attractiveness for r = 0, γ is the light absorption coeffi cient while r is the Cartesian distance between two fi refl ies as defi ned in Equation (2).( ) where i and j represents two fi refl ies at x i and x j .x i,k is the kth component of the spatial coordinate x i of i-th fi refl y.At the same time, the movement of the fi refl y i which is attracted by the brighter one (fi refl y j) is defi ned by Equation (3).
where the second term is due to the attraction and the third term is due to the randomization.In the third term, the randomization parameter alpha is used while rand is a random number generator uniformly distributed between zero and one.Meanwhile, alpha is a decreasing function with a decreasing factor, delta as illustrated in Equation (4).The fl owchart for FA is shown in Figure 1.
The FA have better performance if compared to other algorithms such as PSO and GA in terms of both effi ciency and success rate (Yang 2009).However, many researchers noted that the performance of FA becomes less satisfi ed when the dimension of the search space increased (Rahnamayan et al. 2006;Yang 2009).Opposition based learning could be one of the technique that can improve the performance of FA.

OPPOSITION-BASED LEARNING
Opposition-based learning was proposed by Tizhoosh (Tizhoosh 2005) and it has been applied and tested in some heuristic optimization algorithms such as genetic algorithm (Tizhoosh 2005), differential evolution algorithm (Rahnamayan et al. 2006), ant colony optimization (Malisia & Tizhoosh 2007) and gravitational search algorithm (Shaw et al. 2012) in order to enhance the performance of these algorithms.
Basically, optimization process such as FA always starts with an initial population (solutions) which is created randomly due to the absence of a priori information about the solutions.Then the algorithm will try to search for the best solutions.However, there can be a possibility that the initial guess for the solutions are far away from the actual solutions.The chance to start with the solutions closer to the optimal value can be increased by obtaining the opposite set of solutions simultaneously.Set of population that are closer to the optimal value will be chosen as initial population.The  similar method can be adopted as well for each solution in the current population.The concept of opposite number is demonstrated below.Let x ∈ R be a real number within a defi ned interval where x ∈ [a,b].The opposite number x o can be defi ned as shown in Equation ( 5).
Similarly, this concept can be extended to the case with higher dimensions.Let D(x 1 , x 2 …., x m ) be a set of points in m dimensional search space where x m ∈ R. Then the points in the opposition set D o (x o1 , x o2 … x om ) can be defi ned as shown in Equation ( 6).
By using the definition for opposite number, the opposition based optimization can be developed as follows.Let D(x 1 , x 2 …, x m ) be the set of points in m dimensions search space which is the candidate solution for an optimization problem.According to opposition theorem, D o (x o1 , x o2 …, x om ) will be the opposition set for D(x 1 , x 2 …, x m ).Suppose that f( x In inertia weight based FA (Yafei et al. 2012), an inertia weight function, ω(t) as shown in Equation ( 7) was applied to the Equation (3) in the original version of FA described in Section 3.
where ω(t) is the inertia weight at t, ω max and ω min are the initial and fi nal values of the inertia weight respectively through the iteration process, t is the current iteration while Maxgeneration is the maximum number of iterations as defi ned in the initialization process of FA.
The movement of the fi refl y in updating its position in inertia weight based FA is shown in Equation ( 8).
( ) The main purpose of the inertia weight based function here is to improve the global exploration at the beginning of optimization process while improve the local exploration at the end of optimization process (Yafei et al. 2012).

EOFA
Opposition-based population initialization and oppositionbased steps for EOFA with the population size of n and dimension of m are shown in Figure 2.For the initialization, the initial population of fi refl ies, D is generated randomly, and then the opposite population, D o is calculated using Equation ( 6).The n fi ttest fi refl ies are chosen from D and D o to become the fi rst population in opposition-based optimization process.
In EOFA, each fi refl y updates the light intensity (fi tness value) using Equation ( 8) after the evaluation of the fi tness from the objective function.Then the fi refl ies will rank and update their positions.In EOFA, a jumping rate, Jr of 1 is used to decide if the opposite population is generated or not according to Equation ( 9).If Jr is greater than the generated random number, the opposite population will be generated and the next population will be the n fi ttest individuals chosen from current D and D o or else, the next population will remain as the current population, D generated from the update of fi refl y's position.The optimization process repeats until the criteria given is met, where in this case it is the maximum number of iteration.

, ( ) , generation of yes if Jr rand opposite population
no otherwise The opposition-based optimization enables the algorithm to search for the global optimum points in a faster way.The superior performance of EOFA in escaping from the local optimum points as well as the higher convergence rate is shown in the results.

RESULT AND DISCUSSION
Fifteen benchmark test functions for unconstrained global optimization (Hedar 2013) have been chosen in order to evaluate the performance of EOFA.The name, dimension size and the global minima of each test function is presented in Table 1.All simulations in this study are done using MATLAB software.Besides, comparison has been done with Gravitational Search Algorithm (GSA) (Rashedi et al. 2009) in order to show the superior performance of EOFA in solving most of the problems.In addition, FA (Yang 2008) is included in the comparison as well to show the improvement of conventional method by using EOFA.In this work, the population size, n is set to be 50 and the number of maximum iteration is taken as 1000 for all algorithms used in the comparison.For FA and EOFA, the values for β o , initial alpha, delta and gamma are defi ned as 1, 0.2, 0.97 and 1 respectively.For EOFA, the jumping rate, Jr = 1 while the inertia weight, ω max and ω min are 1.4 and 0.5 respectively.For GSA, the initial gravity constant, G o is set to be 100 while the best applying force, Kbest decreases monotonically from 100% to 2.5%.The parameter τ is set to be 8% of the total number of dimensions.
After 50 runs on each test functions, the performances (fi tness value) of each algorithm are reported in Table 2 and the summary of the performances is shown in Table 3.It can be seen that the performances for FA are always the worst compared to GSA and EOFA.This can be caused by premature convergence after trapping in a local optimum.On the other hand, it can be observed that EOFA has the best performance for most of the test functions except for F2 and F11 where GSA outperforms EOFA.It is known from the reviews that, different algorithms may perform better than others for different problems (Elbeltagi et al. 2005;Rashedi et al. 2010).Performances in terms of convergence between FA, GSA and EOFA for randomly chosen functions are illustrated from Figure 3 to Figure 6.It can be seen from the fi gures that FA always converge pre-maturely and give an unsatisfi ed result.Meanwhile, both GSA and EOFA are able to escape from local minima and give better results.However, EOFA has the higher convergence rate and give better results if compared to GSA.

FIGURE 1 .
FIGURE 1. Flowchart for Firefl y Algorithm (FA) ) is the function used to measure the performance of candidate solution, thus if f(D) is greater than or equal to f(D o ), then set of points in D can be replaced by D o or else D is maintained.ENHANCED OPPOSITION-BASED FIREFLY ALGORITHM (EOFA) INERTIA WEIGHT BASED FA

TABLE 1 .
Comparison of performance of FA, GSA and EOFA for F1 with dimension size 30 FIGURE 4. Comparison of performance of FA, GSA and EOFA for F10 with dimension size 30 FIGURE 5. Comparison of performance of FA, GSA and EOFA for F12 with dimension size 30 Comparison of performance of FA, GSA and EOFA for F13 with dimension size 30 Test functions for unconstrained global optimization

TABLE 2 .
Comparison of performances for GSA, FA and EOFA has presented a new method known as EOFA to enhance the performance of standard FA.It was mainly based on the combination of opposition learning theory and the inertia weight function.The performance and effectiveness of EOFA was extensively tested on 15 unconstrained global optimization functions and the results were compared with other existing method, namely FA and GSA.According to their performances, it can be concluded that EOFA has higher effectiveness among the aforementioned optimization technique in obtaining the global optimum value for the test functions.