Modification of Fish Swarm Algorithm Based on Lévy Flight and Firefly Behavior

Artificial fish swarm algorithm easily converges to local optimum, especially in solving the global optimization problem of multidimensional and multiextreme value functions. To overcome this drawback, a novel fish swarm algorithm (LFFSA) based on Lévy flight and firefly behavior is proposed. LFFSA incorporates the moving strategy of firefly algorithm into two behavior patterns of fish swarm, i.e., chasing behavior and preying behavior. Furthermore, Lévy flight is introduced into the searching strategy. To limit the search band, nonlinear view and step size based on dynamic parameter are considered. Finally, the proposed algorithm LFFSA is validated with several benchmark problems. Numerical results demonstrate that LFFSA has a better performance in convergence speed and optimization accuracy than the other test algorithms.


Introduction
Optimization plays an important role in modern industry as well as in scientific world. Due to the computational costs of the existing numerical methods, researchers have to rely on metaheuristic algorithms to solve complex optimization problems.
Artificial fish swarm algorithm (AFSA) was proposed as a metaheuristic algorithm based on fish swarm behaviors-preying behavior, swarming behavior, and chasing behavior [1]. With its simple principle and such good features as robustness and tolerance of parameter setting, AFSA has become an increasingly important tool in swarm intelligence optimization. Some algorithms derived from AFSA have been presented: Wang et al. eliminated the step restriction and added new leaping behavior to improve the stability of the algorithm [2]. Another modified form of AFSA used particle swarm optimization to reformulate AFSA, integrated AFSA with communication behavior, and created formulas for major AFSA parameters [3]. Luan et al. adopted normal distribution function, Cauchy distribution function, multiparent crossover operator, mutation operator, and modified minimal generation gap model to overcome the drawback of slow convergence speed in later iterations [4]. Another improved AFSA with crossover and culture algorithm was proposed to enhance its optimization efficiency [5]. Hu et al. integrated the merits of the selfadaptation strategy, mutation strategy, and hybrid strategy into the social behaviors of AFSA [6].
Over the last decades, AFSA and its improved algorithms have been successfully applied to various engineering optimization problems. Kumar et al. adopted AFSA to optimize renewable energy sources in a microgrid [7]. By categorizing the social behaviors of fish swarm into foraging, reproductive, and random behaviors, a novel artificial fish swarm algorithm was advocated for solving large-scale reliability-redundancy application problem [8]. A derivative of AFSA was used to solve the multiobjective disassembly line balancing problem with fuzzy disassembly times [9]. A binary fish swarm algorithm was presented to solve profit-based unit commitment problem in generation companies [10].
Firefly algorithm (FA) is another metaheuristic algorithm based on the idealized behavior of the flashing characteristics of fireflies [11]. FA can adaptively adjust the radius of the induction and parallel search the optimum in multiple peaks. FA has natural advantages in solving multimodal optimization problem. Some drawbacks of searching strategy and parameters in FA were targeted and improved by researchers. A derivative of FA with directed movement of fireflies was proposed by Farahani et al. [12]. Chaotic sequence was introduced into the basic FA to adjust parameters c and α by Coelho et al. [13]. Eagle Strategy, which combines Lévy flight search with FA, was introduced by Yang and Deb [14]. Elitist FA was presented [15], which tried to enhance the best solution position by generating m uniform random vectors and moving in the direction of best solution.
Firefly algorithm and its modified forms were also successfully applied to numerous practical problems. Jagatheesan et al. used firefly algorithm to design a controller for an automatic generation control of multiarea power thermal systems [16]. An FA-inspired band selection and optimized extreme learning machine were proposed for hyperspectral image classification [17]. A self-adaptive firefly algorithm was developed for placement of FACTS devices [18]. Teshome et al. modified FA to counteract some inherent problems that may hinder the performance of the maximum power point tracking [19]. Alb et al. used FA to solve a shielding/shunting electromagnetic problem [20]. Mishra et al. proposed a method for optimal placement of interline power flow controller by using FA [21]. Other applications of improved FA include image compression [22], financial forecasting [23], image segmentation [24], structural optimization [25], classification problem [26], unconstrained optimization [27], economic dispatch problems [28], clustering [29], image retrieval [30], and mechanical optimal design [31]. Some researchers presented comprehensive reviews of existing FA and its modified forms to encourage new researchers to employ FA for solving their own problems [32,33].
At the same time, numerous studies have shown that Lévy flight is similar to flight characteristics of given animals and insects [34][35][36], which has been widely used in swarm intelligence algorithms. Subsequently, Lévy flight has been applied to optimization, and preliminary results showed its potential capabilities. Jensi and Jiji proposed an enhanced particle swarm optimization with Lévy flight [37]. Tang et al. proposed a new framework of shuffled frogleaping algorithm based on the exploration and exploitation mechanism by using Lévy flight [38]. Yahya and Saka proposed a multiobjective artificial bee colony algorithm with Lévy flight and applied it to construction site layout planning [39].
Hybridization is recognized to be an important aspect of high performing algorithms in recent years [40]. Owing to some drawbacks of traditional AFSA and FA, they are not suitable for solving highly nonlinear and multimodal problems. By integrating the merits of AFSA with Lévy flight and FA, this paper proposes a novel hybrid algorithm, named LFFSA (fish swarm algorithm based on Lévy flight and firefly behavior), for global optimization. e highlights of the new algorithm are as follows: (i) Attraction degree is involved in the definition of artificial fish (ii) Lévy flight is used to adjust the search route of artificial preying fishes (iii) By analyzing the relationship between swarming behavior and chasing behavior, unnecessary behavior (swarming behavior) is excluded instead of improving AFSA through adding new behaviors [3][4][5][6] (iv) Time complexity of the improved algorithm is also further analyzed to demonstrate the effectiveness of the improvement e remainder of this paper is organized as follows: Section 2 describes the basic AFSA, FA, and Lévy flight respectively; Section 3 proposes and explains LFFSA algorithm in details; in Section 4, the superiority of proposed algorithm LFFSA is validated by several benchmark problems; Section 5 outlines the conclusion.

Artificial Fish Swarm
Algorithm. AFSA is a swarm intelligence algorithm, which can be employed to solve the optimization problem by imitating swarming, chasing, and preying behaviors of artificial fishes [1]. As shown in Figure 1, let X i be the current position of one artificial fish, X v be the viewpoint of artificial fish at one moment, Visual be the visual scope of each individual, X a and X b be fishes within the Visual of X i , Step be the biggest step of artificial fish, and δ be the congestion factor of fish swarm. e food concentration is proportional to the fitness function f(X). e behavior patterns of fish swarms can be described as follows.
Swarming behavior: where X c is the central point inside the Visual of the point X i , swarming behavior is to be executed. Take X c as X v . e fish at X i will take a step toward the point X c .
Chasing behavior: if the point (denoted by X max ) having the best objective function value inside the Visual satisfies f(X max ) > f(X i ), and if the Visual of X i is not crowded, chasing behavior is to be executed. Take X max as X v . e fish at X i will take a step toward the point X max .
Preying behavior: preying behavior is tried in the following situations: Here, a point X j inside the Visual of X i is randomly selected. If f(X j ) > f(X i ), the preying behavior is to be executed. Take X j as X v . e fish at X i will take a step toward the point X j . Otherwise, it will move a step randomly within its Visual. e best solution obtained in each iteration is marked as "board." After the specified iterations, search process is terminated and the result on the "board" is regarded as the final solution.
For artificial preying fishes, the position-updating can be formulated as where X next is the next position of artificial fish; X i is the current position of artificial fish; X j is the position which has a better objective function value; rand is a random number in [−1, 1]; and norm(X j − X i ) is the distance between two position vectors. For artificial swarming fishes, the position-updating can be formulated as For artificial chasing fishes, the position-updating can be formulated as e flowchart of AFSA is shown in Figure 2.

Firefly Algorithm.
Firefly algorithm (FA) [11] is another swarm intelligence algorithm. It achieves swarming phenomenon by using the fluorescent signal between two firefly individuals. e attraction between fireflies depends on their light intensities and attraction degree. e light intensity is in proportion to the objective function value of firefly's position. Attraction degree is in proportion to the light intensity.
e brighter the light intensity is, the higher attraction degree will be. Besides, the farther the distance is, the lower the light intensity and attraction degree will be.
In the simplest form, the light intensity I(r) varies with the distance r monotonically and exponentially as where I 0 is the original light intensity and c is the light absorption coefficient. As firefly attraction degree is proportional to the light intensity seen by adjacent fireflies, the attraction degree beta of a firefly can be defined as where beta 0 is the attraction degree at r � 0. e distance r ij between any two fireflies i and j at x i and x j , respectively, is the Cartesian distance, which is calculated as where n is the dimensionality of the given problem.

Lévy Flight.
Lévy flight is one kind of random searching strategy [35]. Flying step satisfies a heavy-tailed Lévy distribution, which can be represented by a clear power-law equation as

AFSA begins
Does X i meet the condition of swarming behavior?
Obtain the optimum solution Computational Intelligence and Neuroscience where s is random Lévy step. For searching problems inside a wide range of unknown space, the variance of Lévy movement increases faster than the dimensional Brownian movement.
To some extent, the foraging behavior of nature animals is a kind of random movement behavior. Because next movement usually depends on the current position and the probability of moving to next position, the effectiveness of each random movement becomes greatly important. Recent studies show that Lévy flight is one of the best searching strategies in random movement model [35,[41][42][43].

Fish Swarm Algorithm Based on Lévy Flight and Firefly Behavior
AFSA has several disadvantages in solving nonlinear and multimodal problems. Firstly, AFSA uses swarming behavior and chasing behavior to execute parallel search in a simple and fast way. However, after determining the direction, each artificial fish moving with random step will be unable to approach the target point effectively. Secondly, artificial fish will execute preying behavior when it does not meet the conditions of swarming behavior and chasing behavior. is kind of searching strategy is inefficient and can easily miss the optimum point. irdly, too many moving patterns can increase the algorithm complexity, which may cause slow convergence speed. e above-listed drawbacks of AFSA are improved in the proposed LFFSA. FA has the unique moving strategy using attraction between fireflies, which can be used to fix the random moving after determining the direction in AFSA. And, the preying behavior can be improved using Lévy flight to specify the behavior of artificial fishes. In LFFSA, attraction degree is involved in the definition of artificial fishes, which allows each individual move according to attraction degree; Lévy flight is also considered in the definition of the artificial preying fish to avoid falling into the local optimum; chasing behavior is excluded to decrease the algorithm complexity. e flowchart of LFFSA is shown in Figure 3. Pseudo code of LFFSA is described in Algorithm 1. To show the difference between AFSA and LFFSA vividly, mechanisms of both algorithms are provided in Figure 4. e main improvements of LFFSA are summarized as follows: (a) Improvement 1: FA-based moving strategy. Attraction degree is involved in the definition of artificial fishes, which can be formulated as where r ij is the Cartesian distance between artificial fishes i and j given by Equation (6); c is the light intensity coefficient, which can be set as a constant; and beta 0 , the largest attraction degree, is attraction degree of an artificial fish at r ij � 0.
e position-updating with preying behavior established by attraction degree can be formulated as where X i is the current position of artificial fish i; beta ij (X j − X i ) is the attraction degree; α is the step factor which is a constant between 0 and 1; rand is a number chosen randomly in [−1, 1]; and α(rand − 0.5) is to avoid falling into the local optimum.
(b) Improvement 2: inertia weight. A linear inertia weight is added into Equation (9) as where ω t is the weight size inherited from the last position of an artificial fish; ω max denotes the biggest weight; ω min is the minimum weight; gen represents the current iteration; and Maxgen is the ultimate iteration.  Similarly, the position-updating with chasing behavior can be formulated as (12) where X max is the position with the highest food concentration in the view of artificial fish X i and other parameters are defined in Equations (10) and (11).
Lévy flight is involved in the definition of artificial fishes are executing preying behavior. e movement can be formulated as where X i is the current position of artificial fish i; ⊕ is the point to point multiplication; L(λ) denotes a random vector generated by Lévy flight; X best represents the best fish on the "board"; μ � t −λ , 1 < λ < 3; and μ and v have the standard normal distribution where Γ is the standard Gamma function. (d) Improvement 4: nonlinear visual and step. Visual and step change nonlinearly and dynamically in LFFSA. e updating equations are as follows: (1) Initialization of X 1 , X 2 , . . . , X n ; (2) Evaluate fitness; (3) while the stop criterion is not met do (4) while i < n do (5) if X i meets the condition of chasing behavior (6) Move with attraction degree and get a new X i based on Equation (13); (7) else (8) Prey with Lévy flight and get a new X i based on Equations (11) and (14); (9) end if (10) end while (11) Update the "board"; (12) end while (13) Obtain the optimum solution ALGORITHM 1: LFFSA.
Here, s � 3. Other parameters are the same as those in Equation (11). e relationship between s and ρ is as shown in Figure 5.
Besides, define the biggest distance between two artificial fishes as where, x max and x min represent the upper bound and the lower bound of searching range respectively; D denotes the D-dimension searching space. e initial Visual is equal to max D, and initial Step is equal to max D/8. en Visual and Step change dynamically according to Equations (16)-(18).
(e) Improvement 5: decrease of time complexity. Swarming behavior in AFSA is excluded to decrease the algorithm complexity.

Comparison of Convergence
Accuracy. LFFSA is validated by numerical simulations. Fish swarm algorithm with firefly behavior (FFSA), differential evolution (DE) algorithm, self-adaptive differential evolution (jDE) algorithm, and the two basic algorithms (AFSA and FA) are compared. All the algorithms are coded in Matlab 2014b. e operating system is windows 7. Simulation hardware is a PC with 2.50 GHz Inter Core i5 and 2.00 GB Memory. Parameters shown in Table 1 are determined by trial and error. e following benchmarks are chosen carefully according to their features. Functions Sphere, Quartic, and Rosenbrock, etc., are simple unimodal problems. Functions Ackley, Rastrigin, and Schwefel, etc., are highly complex multimodal problems with many local minima. Schwefel function has a maximum value and other functions have minimum values. ese benchmarks are listed in Table 2 [44,45]. e solutions of 17 test functions obtained by different algorithms are compared. To compare the convergence speed and accuracy of the algorithms clearly and correctly, all functions are run 50 times for each algorithm, respectively. e results are averaged and plotted in Figure 6.
From Figure 6, LFFSA can avoid local optimum and have better convergence accuracy compared with the other algorithms. For AFSA and FA, the solutions of most functions are unsatisfactory; the DE cannot find ideal solutions of f3, f4, f5, f6, f10, f11, f12, f14, and f15; the jDE has good accuracy while solving some of those functions, e.g. f1, f2, f3, and f8; however, solutions of f4, f10, f11, and f15 obtained by jDE are not so precise; the LFFSA can obtain the ideal accuracy for almost all functions, although it cannot achieve a high precision level like solutions of f2 obtained by jDE; the FFSA is slightly worse than LFFSA. e LFFSA outperforms jDE in 10 benchmark functions, while 2 functions are comparative, and 5 functions are worse.
LFFSA is better than AFSA because Lévy flight is able to restrict the movement step of AFSA to a very small area around the current position. Furthermore, the attraction degree guides the fish moving. Besides, LFFSA can quickly lead the fish individual to the close-by optimal point. Considering all the advantages discussed above, the optimum solution can be found successfully by using LFFSA, which outperforms the basic algorithms for all test functions, and outperforms jDE for several functions. To observe the searching capabilities of different algorithms directly, the average, median, best, and worst values obtained by different algorithms are listed in Table 3. Results indicate that LFFSA can find ideal solutions and have a better robustness.

Computational Complexity Analysis.
Time complexity is also an important indicator in the analysis of algorithms. If an algorithm is composed of several parts, then its complexity is the sum of the complexities of these parts. e algorithm may consist of a loop executed many times, and each time is with a different complexity. Time complexity of   [46]. Define e time complexity analysis of AFSA is provided in Table 4.
From Table 4, the time complexity of AFSA is O Maxgen * 3 * N 2 + trynumber * N + 6 * N . (20) Swarming behavior has N times of calculating congestion factor, 1 time of judging, and 1 time of moving. erefore, time complexity of swarming behavior is O (N 2 + 2  *  N). Chasing behavior has N times of calculating congestion factor, N times of searching, 1 time of judging, and 1 time of moving. erefore, time complexity of chasing behavior is O(2 * N 2 + 2 * N).
Time complexity analysis of LFFSA is listed in Table 5.
Due to the lack of swarming behavior, time complexity of LFFSA can be calculated as O Maxgen * 2 * N 2 + Trynumber * N + 4 * N . (21) We can also obtain time complexity of FA: A conclusion can be obtained that time complexities of the three algorithms are at the same level. eir computational complexities in the worst case are only the square of the training sample size.  Sphere

Experimental Complexity
Schwefel f13 Dixon and price Computational Intelligence and Neuroscience     e effect of parameters on optimization is analyzed in this section. Taking Ackley function as example, Figure 7 shows the change of the objective function value in the case of varying parameters. Trynumber and β 0 are proportional to the optimization result. Trynumber can impact the time complexity of the algorithm, so the value should be appropriate not to affect the running speed. e best value of c and δ is 2.5 and 1.2, respectively.

Conclusion
LFFSA is proposed to improve the capability of AFSA which integrates the merits of both AFSA and FA. Firstly, the searching characteristic of AFSA is studied by calculating the time complexity. Secondly, 17 benchmark test functions are used to verify LFFSA. en time complexity of LFFSA is estimated. Numerical results demonstrate that LFFSA has a better performance in accuracy and speed of optimization to solve nonlinear optimization problems than the other test algorithms. However, the solution obtained by LFFSA can be more precise, and the way of modification could provide reference for those efficient algorithms, e.g. DE and GWO.     Data Availability e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.