Abstract

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.

1. 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 self-adaptation 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 γ 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 [3436], 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 frog-leaping 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. The 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 [36](iv)Time complexity of the improved algorithm is also further analyzed to demonstrate the effectiveness of the improvement

The 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.

2. Background

2.1. 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 be the current position of one artificial fish, be the viewpoint of artificial fish at one moment, be the visual scope of each individual, and be fishes within the of , be the biggest step of artificial fish, and δ be the congestion factor of fish swarm. The food concentration is proportional to the fitness function . The behavior patterns of fish swarms can be described as follows.

Swarming behavior: if , where is the central point inside the of the point , swarming behavior is to be executed. Take as . The fish at will take a step toward the point .

Chasing behavior: if the point (denoted by ) having the best objective function value inside the satisfies , and if the of is not crowded, chasing behavior is to be executed. Take as . The fish at will take a step toward the point .

Preying behavior: preying behavior is tried in the following situations:(1), , and the is not crowded(2)The is crowded

Here, a point inside the of is randomly selected. If , the preying behavior is to be executed. Take as . The fish at will take a step toward the point . Otherwise, it will move a step randomly within its .

The 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 aswhere is the next position of artificial fish; is the current position of artificial fish; is the position which has a better objective function value; rand is a random number in [−1, 1]; and 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

The flowchart of AFSA is shown in Figure 2.

2.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.

The attraction between fireflies depends on their light intensities and attraction degree. The light intensity is in proportion to the objective function value of firefly’s position. Attraction degree is in proportion to the light intensity. The 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 varies with the distance r monotonically and exponentially aswhere is the original light intensity and γ is the light absorption coefficient. As firefly attraction degree is proportional to the light intensity seen by adjacent fireflies, the attraction degree of a firefly can be defined aswhere is the attraction degree at .

The distance between any two fireflies i and j at and , respectively, is the Cartesian distance, which is calculated aswhere n is the dimensionality of the given problem.

2.3. 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 aswhere 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, 4143].

3. 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. This kind of searching strategy is inefficient and can easily miss the optimum point. Thirdly, too many moving patterns can increase the algorithm complexity, which may cause slow convergence speed.

The 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.

The 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.

(1)Initialization of ;
(2)Evaluate fitness;
(3)while the stop criterion is not met do
(4)while do
(5)  if meets the condition of chasing behavior
(6)   Move with attraction degree and get a new based on Equation (13);
(7)  else
(8)   Prey with Lévy flight and get a new based on Equations (11) and (14);
(9)  end if
(10)end while
(11) Update the “board”;
(12)end while
(13)Obtain the optimum solution

The 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 aswhere is the Cartesian distance between artificial fishes i and j given by Equation (6); γ is the light intensity coefficient, which can be set as a constant; and , the largest attraction degree, is attraction degree of an artificial fish at .

The position-updating with preying behavior established by attraction degree can be formulated aswhere is the current position of artificial fish i; is the attraction degree; α is the step factor which is a constant between 0 and 1; is a number chosen randomly in [−1, 1]; and is to avoid falling into the local optimum.(b)Improvement 2: inertia weight. A linear inertia weight is added into Equation (9) aswhere is the weight size inherited from the last position of an artificial fish; denotes the biggest weight; is the minimum weight; represents the current iteration; and is the ultimate iteration.

Similarly, the position-updating with chasing behavior can be formulated aswhere is the position with the highest food concentration in the view of artificial fish and other parameters are defined in Equations (10) and (11).(c)Improvement 3: Lévy flight-based search strategy. Lévy flight is involved in the definition of artificial fishes are executing preying behavior. The movement can be formulated aswhere is the current position of artificial fish i; is the point to point multiplication; denotes a random vector generated by Lévy flight; represents the best fish on the “board”; ; and μ and have the standard normal distribution , , respectively, wherewhere is the standard Gamma function.(d)Improvement 4: nonlinear visual and step. and change nonlinearly and dynamically in LFFSA. The updating equations are as follows:where , the minimum visual, takes 0.001; , the minimum step, takes 0.0002; ρ is a nonlinear weight; and s represents an integer, . Here, . Other parameters are the same as those in Equation (11). The relationship between s and ρ is as shown in Figure 5.

Besides, define the biggest distance between two artificial fishes aswhere, and represent the upper bound and the lower bound of searching range respectively; D denotes the D-dimension searching space. The initial is equal to , and initial is equal to . Then and 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.

4. Numerical Simulation

4.1. 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. The 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.

The 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. These benchmarks are listed in Table 2 [44, 45]. The 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. The 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. The 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.

4.2. 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. The algorithm may consist of a loop executed many times, and each time is with a different complexity. Time complexity of the algorithm is used to estimate the efficiency of the algorithm. It is defined that the time complexity of the algorithm, or the running time, is [46]. Define N as the population.

In the definition of time complexity, and are at different levels. If the time complexity of one algorithm is , the time complexity of the other one is , then the former algorithm is more complex. In the other case, if the time complexity of one algorithm is while the time complexity of the other one is , their complexities are both .

The time complexity analysis of AFSA is provided in Table 4.

From Table 4, the time complexity of AFSA is

Swarming behavior has N times of calculating congestion factor, 1 time of judging, and 1 time of moving. Therefore, time complexity of swarming behavior is . Chasing behavior has N times of calculating congestion factor, N times of searching, 1 time of judging, and 1 time of moving. Therefore, time complexity of chasing behavior is .

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

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. Their computational complexities in the worst case are only the square of the training sample size.

4.3. Experimental Complexity Analysis

Time complexity is a rough estimate of time cost. The more accurate time cost of an algorithm can only be validated by running it on computer. Since different algorithms cannot reach the same convergence accuracy, the test with fixed convergence accuracy is not available. Therefore, the test with max function evaluations is conducted. Running time of each algorithm is counted by the explorer of MATLAB. Parameter settings of algorithms are the same in Section 4.1. Average running time of different algorithms is listed in Table 6. When function evaluations are the same, running speed of LFFSA is faster than that of AFSA, while DE has the fastest running speed. Results are quite in accord with those obtained by computational complexity analysis. LFFSA and jDE are comparative in experimental complexity. Running time of FFSA is almost twice as much as that of LFFSA. The improvement of LFFSA decreases time complexity to some extent.

4.4. Parameter Analysis of LFFSA

The 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. and are proportional to the optimization result. can impact the time complexity of the algorithm, so the value should be appropriate not to affect the running speed. The best value of γ and δ is 2.5 and 1.2, respectively.

5. 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. Then 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

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work is supported by National Natural Science Foundation of China (61463028). The authors wish to thank Dr. Yanliang Cui for his fruitful comments and suggestions.