Abstract
Fruit fly optimization algorithm, which is put forward through research on the act of foraging and observing groups of fruit flies, has some merits such as simplified operation, strong robustness, easy to parallel computing, and fast convergence rate; it could solve the bottlenecks of traditional intelligent optimization algorithms on precocity and low convergence speed effectively. Fruit fly optimization algorithm is applied to almost all the numerical optimization problems and is very useful in engineering applications. When the design variable is negative, traditional fruit fly optimization algorithm is not qualified for the extraordinarily slow convergence rate during the late stage of calculation and easy to be trapped in local optimum. Because of the defects of classical fruit fly optimization algorithm, a new coding method of the process of optimization is improved by this article, so the design variables could be searched toward the direction. In addition, a novel bionic global optimization—fruit fly optimization algorithm of learning—is proposed by introducing the concept of “study.” This article tries to apply fruit fly optimization algorithm of learning to compare calculations; therefore, four classical test functions and two engineering problems are performed. It turned out that not only does fruit fly optimization algorithm of learning inherit the advantages of fruit fly optimization algorithm, but has a strong learning ability. The introduction of “study” ability into fruit fly optimization algorithm notably improves the efficiency and capability of optimization; it has characteristics of fast convergence rate and fast speed of approaching the global optimum solutions. Fruit fly optimization algorithm of learning has the ability to solve practical problems, and its engineering prospect is promising.
Keywords
Preface
Fruit fly optimization algorithm (FOA), which is a new evolutionary global optimizing method, was a creative model proposed by Wen-Tsao Pan1–3 who was inspired by foraging behavior of drosophila in 2011. The FOA has high value of application and wide prospects in engineering and science, not only because of its simple principle and fast convergence in calculation, but also on account of its good local searching ability in acquiring global optimal value. However, the design variables could be searched in the direction of positive value only by FOA, for its special coding way. And it is easily trapped into a local optimum value during the late stage of iteration, especially for advanced multi-extremum optimum problem, like other intelligent optimization algorithms, such as genetic algorithms (GAs),4–7 particle swarm algorithm,8–10 and bees algorithm. 11 Because of that, many improved ways have been proposed to improve the performance of algorithms. Hui and Liu 12 put forward a new method based on utilizing chaos mapping and FOA, combining logistic map with FOA, which can improve the precision for improper initial values. Junying and Chengzhong 13 improved global searching capacity by integrating chaos optimization algorithm and FOA.
Based on traditional FOA, this article puts forward a new algorithm called fruit fly optimization algorithm of learning (FOAL), which improves the code scheme of FOA and introduces the “learning” mechanism, so it can search on a global scale, which makes other drosophila learning to the best one in order to get a better sample with the better fitness. Finally, by comparing some classic test functions and engineering examples, it is confirmed that the new algorithm FOAL is an effective way to improve the algorithm performance with higher precision and faster convergence rate.
FOA
According to the forging behavior of drosophilae, FOA is a new global optimization to search for the best value.14,15 Drosophilae search for foods by sensitive olfaction and superior vision. They find foods by smelling the taste drifting in the air; higher the taste concentration is, closer they are to the foods and vice versa. In fact, the process drosophilae foraging for foods is according to the concentration of food taste from low to high. On knowing the concentration of food taste is high where some drosophilae are, others will fly to them by vision.16–18 Applying FOA to solve the optimization problem, abstract the points in solution space from the food source and the procedure of searching optimization by FOA from drosophilae searching for foods when applying the FOA to solve the optimization problem. There are three assumptions as follows:
When searching for food, drosophilae estimate the concentration of food taste, first by smelling, then fly to the drosophila nearest to food by vision;
Drosophilae estimate and get the position of the drosophila whose taste concentration is highest each time;
The population of drosophilae is invariant.
Set min f(x) is the optimization problem to be solved,
Step 1. The size of population is PopNum, maximum iteration number is MaxI, and the number of design variable is D. Initialize the place of the first drosophila randomly
where
Step 2. The drosophila can search the direction and distance of food by smelling. Initialize the population of drosophila
where
Step 3. When the position of food is unknown, calculate the distance of a drosophila to the origin
Since
The FOA mentioned in this article applies to equation (3).
Step 4. Substituting the taste concentrate discriminant value into objective function
Step 5. Find out the best drosophila in taste concentrate
Step 6. Maintain the best taste concentrate value and the position coordinate correspondingly
Step 7. Get in optimization iterative, execute Steps 2–6 repeatedly, and judge whether the best taste concentrate (population fitness) variance in continuous five generations is less than convergence precision
FOAL
Being in the same population or between different species, one of the main reasons people can dominate the world is that they are capable of learning. With the better ability of learning, the population will evolve to higher ranks. Enlightened by GA and “shake” GA, 19 this article puts forward a FOAL which puts learning into FOA and develops on it. This new algorithm develops the performances of fruit fly algorithm and improves the speed of convergence.
FOAL is described theoretically by the following three aspects:
Learning object. Learning object is necessary for any learning process. For FOA, learning object is the one whose taste concentration is highest.
Learning objective. Getting better food is the objective behind drosophila foraging. FOA abstracts taste concentration from food. So the learning objective of drosophila is to get higher taste concentration value than the highest at present.
Learning method. In order to ensure the best individual’s character can be inherited, other drosophilae should learn from it and become better than it. The essence of FOAL in learning is exchanging the position (coordinate value) of individual, which puts the coordinate of the individual with highest taste concentrate to another one randomly in certain probability
where
Basic procedures of FOAL are shown in Figure 1.

Basic procedures of FOAL.
Equation (8) shows the learning process: the individual which is not the optimal one is endowed with the value of 1 or a few design variables of the best individual (shown in Figure 2); this ensures that the new distance between the individual fruit flies and the optimal one is closer. The object function value of new individual will be closer and even better than the current optimal value. This is more suitable for searching the local extremum, and it can improve the precision of the algorithm significantly; the way the algorithm generates the new solution by “learning” is similar to the “cross” operation of GA, but it is not the “crossover” operation, because it will affect the current diversity of population by using the searching method which is proposed by this article, and it is not suitable for GA but for FOA. So this article calls the new searching method which is different from the “crossover” of GA “learning.” Learning is the act of acquiring new or modifying and reinforcing existing knowledge, behaviors, skills, values, or preferences. In the space, the best individual is the goal other individuals try to achieve; it has weakness and shortage in some respects, although it is the best one. Other individuals are transferred into new individuals which is clearly similar to the best one through learning. It can be proved that the “learning” finally achieved success when the new one is better than the original best one; conversely, the new one cannot be accepted.

Substitution method of design variable during “study” procedure.
Performance analysis of FOAL
Simulation and results
To verify that FOAL has many advantages over the traditional FOA, choose four classical test functions and find out the minimum values which are widely used in GA and particle swarm optimization algorithm. Table 1 shows the names, dimensions, math expressions, searching space, and theoretically optimum values of test functions. The simulation parameters are as follows: the size of population PopNum = 100, maximum iteration number MaxI = 5000, convergence precision
Four functions for testing FOAL performance.
FOAL: fruit fly optimization algorithm of learning.
Comparison of results.
FOA: fruit fly optimization algorithm; FOAL: fruit fly optimization algorithm of learning. The data in this table are average values with 20 times iteration.

Convergence curve of test function 1.

Convergence curve of test function 2.

Convergence curve of test function 3.

Convergence curve of test function 4.
Data in Table 2 indicate that FOAL has advantages over FOA in the ability of searching, for its learning capability, which can get the better answer with less time of searching. The curves in Figures 3–6 show that FOA before and after improvement can concentrate in global optimum steadily, and the phenomenon of precocity does not occur. This indicates that FOA can avoid precocity concentration. FOAL not only has the same advantages with FOA, but also has faster concentration than FOA.
Engineering example 1
Deflection calculation model of crane girder was used to verify application value of FOAL; the model is shown in Figure 7. The span S = 25 m, exert concentrated load P1 = 17,8281 N, P2 = 178,281 N, and uniform load
where

Mechanical model.
Comparison of maximum deflection optimized by three ways.
GA: genetic algorithm; FOA: fruit fly optimization algorithm; FOAL: fruit fly optimization algorithm of learning.
Based on material mechanics bending deformation theory, the expression of objective function is simplified because the origin of coordinate is located on mid-span of main girder by applying the mechanical model shown in Figure 7, which avoids piecewise objective function and more conditional judgment sentences with origin O located in other places. So the computational efficiency is higher.
Data of FOAL and FOA in Table 3 show that when the distance of loads

The comparison of iteration.
Engineering example 2
The structure optimization model of crane box girder in Lu et al., 20 Guo et al., 21 Zhengjia et al., 22 and Guozheng 23 is applied to the math model shown in equation (11), where L = 10,500, P1 = 120,000, P2 = 12,000, and X1, X2, X3, and X4 are the size of cross section of crane box girders 700 ≤ X1 ≤ 800, 350 ≤ X2 ≤ 400, 5 ≤ X3 ≤ 10, and 5 ≤ X4 ≤ 10, respectively; G(x) is the objective function that represents the weight of box girder per unit length. Set the size of population PopNum = 100 and maximum iteration number MaxI = 1000, and the program runs independently 20 times continuously. The results of the optimal solution, worst solution, and average are listed in Table 4, together with the results in other references for comparing
Results of FOAL and other functions.
FOAL: fruit fly optimization algorithm of learning.
Table 4 indicates that FOAL is the best way to solve engineering problems. The result
Summary
Based on traditional FOA, analyzed its optimization performance, put forward a new algorithm called FOAL, whose efficiency is higher and searching range is wider:
Changing the coding method of traditional FOA
Introducing the concept “learning” in improved FOA in order to improve the searching efficiency and make the ability of searching more power.
FOAL not only inherits the merits of traditional FOA such as easy to operate, powerful robustness, fast convergence speed, hard to be precocity, but also has wider searching range and powerful adaptation. What is more, FOAL simulates the process of learning by exchanging the position of individual in population in order to make the individuals learn to the best one, then surpass it so as to improve the searching efficiency and precision. It is proved that FOAL is faster in convergence, and higher in computational accuracy and efficiency. By comparing four classical test functions and engineering problems, FOAL is applied to engineering more, which has wide prospects of science researching and provides a new thinking to improve traditional FOA.
Footnotes
Declaration of conflicting interests
The authors declare that there is no conflict of interest.
Funding
This study was supported by National Nature Science Foundation of China (no. 51275329).
