A novel Fruit Fly Optimization Algorithm with quasi-affine transformation evolutionary for numerical optimization and application

The Fruit Fly Optimization Algorithm is a swarm intelligence algorithm with strong versatility and high computational efficiency. However, when faced with complex multi-peak problems, Fruit Fly Optimization Algorithm tends to converge prematurely. In response to this situation, this article proposes a new optimized structure—Quasi-affine Transformation evolutionary for the Fruit fly Optimization Algorithm. The new algorithm uses the evolution matrix in QUasi-Affine TRansformation Evolution algorithm to update the position coordinates of particles. This strategy makes the movement of particles more scientific and the search space broader. In order to prove its effectiveness, we compare Quasi-affine Transformation evolutionary for the Fruit fly Optimization Algorithm with five other mature intelligent algorithms, and test them on 22 different types of benchmark functions. In order to observe the multi-faceted performance of Quasi-affine Transformation evolutionary for the Fruit fly Optimization Algorithm more intuitively, we also conduct experiments on algorithm convergence analysis, the Friedman test, the Wilcoxon signed-rank test, and running time comparison. Through the above several comparative experiments, Quasi-affine Transformation evolutionary for the Fruit fly Optimization Algorithm has indeed demonstrated its strong competitiveness. Finally, we apply it to Capacitated Vehicle Routing Problem. Through comparing with the contrast algorithms, it is confirmed that Quasi-affine Transformation evolutionary for the Fruit fly Optimization Algorithm can achieve better vehicle routes planning.

Fruit Fly Optimization Algorithm (FOA) is also a metaheuristic algorithm evolved by simulating the foraging process of fruit flies. It was proposed by Pan 44 in 2012. However, the optimization process of fruit fly relies heavily on its sense of smell. It first uses the sense of smell to identify the direction in which the food is most likely to exist. Then, many other individuals in the group fly to this place quickly. This can easily induce the algorithm to fall into a local extremum. 45,46 Therefore, for this shortcoming, many scholars had made efforts. In 2015, Wang et al. 47 proposed an elite selection mechanism and applied the algorithm to joint supply problem. Next, in 2016, Zheng and Wang 48 created a dual-strategy mechanism to allow FOA to carry out more detailed local exploitation. Then, in 2018, Kanarachos et al. 49 and his team adopted a dynamic multi-decision method, so that the algorithm had the ability to self-adjust and improved the diversity of solutions in the iterative process.
QUasi-Affine TRansformation Evolution (QUATRE) is an excellent optimization evolution structure proposed by Pan et al. 50 in 2016. The position update of its search agent uses an affine transformation formula. Then, Meng et al. 51 compared the performance of QUATRE with various variants of PSO and DE, and demonstrated the powerful global optimization capabilities of it. In view of the good performance of QUATRE, many scholars had proposed a lot of algorithms based on it. In 2020, Du et al. 52 introduced the timestamp mutation strategy to QUATRE, so the performance of the algorithm was further promoted. In 2018, Meng and Pan 53 and his partners proposed a multi-group multi-selection communication strategy, which greatly improved the ability of the original QUATRE to perform global search, and applied it to the received signal strength indication (RSSI)-based wireless sensor network (WSN) node positioning problem.
In this article, combining FOA and QUATRE, a new intelligent algorithm is proposed-Quasi-affine Transformation evolutionary for the Fruit fly Optimization Algorithm (QTFOA). At first, QTFOA randomly allocates the location coordinates of search agents based on the mechanism of FOA, and determines the global optimal individual. In this way, randomly initializing the positions of the particles can greatly enhance the distribution range of the population, which is conducive to the subsequent global optimization. After entering the iteration, the algorithm uses evolution matrix in QUATRE to update the positions of particles. QUATRE's unique affine transformation matrix allows particles to affine from one position to another, so that the jump-type position transformation can make the movement of the particles more scientific and have a wider range of optimization. In this way, the evolutionary method in FOA can perform local exploitation in detail without any worries. Because it largely does not have to worry about falling into a local optimum. This combination of FOA and QUATRE not only provides a guarantee for the global exploration but also lays the foundation for the local exploitation.
Capacitated Vehicle Routing Problem (CVRP) 54-56 is a typical problem in transportation. Its foundation is Vehicle Routing Problem (VRP), 57,58 which is a common problem in life. 59,60 CVRP is a further expansion of VRP, which adds capacity restriction condition on the basis of original problem. There are already many algorithms for solving CVRP. Among them, the metaheuristic algorithm is particularly prominent. Metaheuristic algorithm can use search agents to quickly find the optimal path. Examples of good results include Sine Cosine Algorithm (SCA), Bee Algorithm (BA), Tabu Search algorithm (TS), Simulated Annealing algorithm (SA), and so on. Here, we applied QTFOA to this practical scenario and compared it with several other mature algorithms. It was finally confirmed that QTFOA could always find the shortest path.
There are five remaining sections in this article. Section ''Related works'' is an introduction of the theoretical basis of FOA and QUATRE. Section ''The proposed QTFOA'' details the operating mechanism of the newly proposed QTFOA. Section ''Simulation experiment and result analysis'' presents the experimental results of a series of performance tests. Section ''Application of QTFOA in CVRP'' verifies the excellent effect of QTFOA on CVRP. Section ''Conclusion'' summarizes the whole article and indicates the potential shortcomings of QTFOA.

FOA
Since modern times, fruit fly has become a model organism that is very popular among researchers. It has outstanding sense of smell and vision. After the fruit flies perceive the concentration of the food odor, they will send information to their companions. Similarly, each search agent also receives the odor concentration information transmitted by the companions. In this way, fruit flies can compare the odor concentration of various parties, and then use their excellent vision to fly to the location with highest concentration. Repeat this process continuously, and eventually they have a good chance of finding food. To unify the standard, this article only studies the minimization problem. The following describes the specific steps of FOA: 1. Position initialization: there are ps search agents. The moving direction and distance of them are initialized around the best one in population casually. Equation (1) is used to solve the location of each search agent The position of the ith search agent is represented by X i and Y i [X_axis, Y_axis] is optimal position of the population. RandomValue is a random search distance.

Calculate taste concentration judgment value:
initially, the location of food is not known, so we reckon the distance (Dist i ) between each search agent and origin. Later, we count the taste concentration judgment value S i at each particle's location. The calculation formula is shown in equations (2) and (3) 3. Calculate taste concentration value: we calculate the taste concentration Smell i of each one by equation (4) 4. Choose the best individual: we choose the best search agent which has the global optimal concentration value bestSmell in the population 5. Fly to food: other individuals in the group will fly to the best individual. 6. Iterative optimization: repeat Steps 1-4 and continuously update the global optimal individual.
Other fruit flies always fly to the best individual in each generation.
Through understanding the optimization process of fruit flies, combined with the existing references, the following three shortcomings of FOA can be summarized: 1. The most significant shortcoming of FOA is that the optimization process of it is blind and random, which makes the algorithm converge too fast and the population diversity is insufficient in the later stage. 2. According to equations (2) and (3), we see FOA implicitly stipulates optimal solution can only be a positive number. This largely limits the scope of the algorithm. 3. There is no certain mathematical formula to express the position relationship between the current generation and previous generation. So, the search agent's location cannot be accurately described.

QUATRE
The position update process in QUATRE is similar to affine transformation in geometric transformation, which uses mathematical equations to linearly transform coordinates from one affine space to another. This process is shown in equation (6) where X is the coordinate matrix of population, X = [x 1 , x 2 , ..., x ps ] T , and G represents the current iteration. For each particle, x i = [x i1 , x i2 , ..., x iD ]. D is the dimension. is a symbol for component multiplication. B can be regarded as a mutation matrix, and there are six representation methods, as shown in Table 1. F is an important scale factor and in this article, it is set to 0.7. X r1,G , X r2,G , X r3,G , X r4,G , and X r5,G are matrices obtained by randomly transforming row vector of X. X gbest,G is composed of coordinate vector of the optimal particle position in current generation, as shown in equation (7) X gbest, G = x gbest, G x gbest, G ::: M is a matrix of size ps * D, M is its binary inverse matrix, as shown in equation (8). M is derived from the lower triangular matrix M tmp . First, for each row of M tmp , D column elements are randomly scrambled, and then this matrix arbitrarily transforms the row vector.
In this way, M can be obtained, and the transformation process from M tmp to M is shown in equation (9) However, we need to pay attention to the following situations. If ps \ D, we can expand the matrix according to the value of population size. Suppose ps = E * D + i, then the first E * D rows can be divided into E lower triangular matrices, and the remaining i rows correspond to the first i rows of the matrix M tmp . If ps . D, in the same way, we can expand M tmp according to the value of D. The process is shown by equation (10) M tmp = 1 ::: 1 1 ::: 1 1 1 ::: ::: 1 1 1 ::: 1 1 ::: 1 1 ::: 1 1 1 ::: ::: 1 1 1 ::: 1 1 ::: 1 1 :::  (11) and (12) We use equations (2) and (3) to calculate the taste concentration judgment value, and we use equation (4) to calculate the taste concentration value. new_X and new_Y are used to retain the position information of the current global optimal individual

Position change
Next, the algorithm enters the core. We change the particle's position with the affine transformation evolution matrix in QUATRE, and the specific process is as follows: 1. Generate matrices M and M according to the principles of equations (10) and (8). 2. In order to strengthen the randomness of the particles, it is preferred to generate mutation matrices B x and B y according to the second mutation strategy in Table 1. Next, we randomly transform the row vectors of X and Y to generate six random matrices. Among them, posrx, posr1, and posr2 are obtained corresponding to X. posry, posr3, and posr4 are obtained corresponding to Y. The two mutation matrices B x and B y serve for the transformation of X and Y, respectively. The generation process is shown in equations (14) and (15) 3. X and Y are updated according to the principle of equation (6), and the update process is shown in equations (16) and (17) Update the optimal value 1. We combine the updated X and Y with equations (3) and (4) to calculate the taste concentration value of the location of each search agent. 2. For each search agent, we compare the current taste concentration value with its previous taste concentration value. And then keep the minimum value bestmore i . The operation process is shown in equation (18) bestmore 3. As shown in equation (19), the minimum value among bestmore i is the contemporary global optimal value gbestval G gbestval G = min bestmore 1, G , bestmore 2, G , . . . , bestmore ps, G À Á The above is the main process of QTFOA. On one hand, QTFOA retains the inherent exploration and exploitation strategy of FOA. On the other hand, it adds the affine transformation in QUATRE, which helps the particles to change the position coordinates in a large range and effectively reduces the probability of falling into local extremes. The details of this process are described by the pseudo code of Algorithm 1.

Benchmark functions
We select 22 benchmark functions to conduct experiment to test the optimization effect of QTFOA. Tables  2-5 show the specific details. Among them, f 1 -f 8 are the universal unimodal functions, f 9 -f 10 are the lowdimensional unimodal functions, f 11 -f 17 are the universal multimodal functions, and f 18 -f 22 are the lowdimensional multimodal functions. Unimodal function has only one peak. So, it can explore whether the algorithm can find the global optimal value under limited optimization conditions (such as fewer particles). Multimodal function has multiple peaks, which can explore the ability of one algorithm to escape the trap of falling into local optima. This article adds low-dimensional test functions. In lowdimensional situations, algorithm is more likely to converge prematurely, so this can better detect the performance of QTFOA. Initialize the population size ps, the maximum number of iterations nfe_max, the objective function f(S) and the current iteration number G = 1. Randomly initialize the position coordinates of population (X_axis, Y_axis) and the position matrix X G , Y G using equation (1). Calculate the taste concentration value using equations (2)- (4).
Generate matrix M and calculate the corresponding matrix M using equations (10) and (8). Generate mutation matrices B x and B y using equations (14) and (15). Update two location matrices of search agents: Calculate the taste concentration value Smell G + 1 using equations (2)-(4). Update individual optimal and global optimal through the principles of equations (18) and (19). ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi Output the global optimal solution x gbest,G , y gbest,G and the global optimal value f(s gbest ).
[25,10] 30 0 Table 3. Low-dimensional unimodal functions. Griewank 10] 30 0 Powell Styblinski-Tang Hartman2 Compare with mature algorithms In this part, we compare QTFOA with FOA, QUATRE, DE, PSO, and GWO. Specifically, we use 30 particles to run these six algorithms on 22 benchmark functions 30 times, and each single function performs 3000 iterations. Finally, we use error average (AVG) to compare optimization results and we use error standard deviation (STD) to evaluate the stability of solution. The win, lose, and draw are used to represent the number of functions that QTFOA is better than, worse than, and equal to corresponding algorithm's optimized performance, respectively. The running results are shown in Table 6, and in order to highlight the optimal values, we bold them. From Table 6, for eight universal unimodal functions f 1 -f 8 , the performance advantage of QTFOA is absolute. QTFOA randomly generates the solution in the early stage, and then performs the affine transformation of the particle position coordinates, which greatly improves the position diversity and helps the particles to quickly find the optimal value. But for the two low-dimensional unimodal functions f 9 and f 10 , neither of them can beat all other algorithms. This shows the performance of QTFOA is not very good on low-dimensional unimodal functions.
For the seven universal multimodal functions f 11 -f 17 , QTFOA ranks first in six functions of f 11 , f 12 , f 13 , f 15 , f 16 , and f 17 . And the data appear that the result of QTFOA is not only superior than other algorithms but also helps most universal multimodal functions find the theoretical global optimum. What multimodal functions urgently need to solve is the inability to escape the local extremum problem. In response to this, QTFOA introduces the affine transformation mechanism, which helps particles seek the optimal solution toward higher expectations and greater optimization potential.
For the five low-dimensional multimodal functions f 18 -f 22 , QTFOA ranks first in three functions of f 18 , f 19 , and f 20 . It can be seen that QTFOA is also excellent in low-dimensional multimodal functions. In short, through the above analysis and the values of win, lose, and draw in Table 6, the overall performance of QTFOA is higher than the other five algorithms.

Analysis of algorithm convergence
Convergence is another indicator for judging the quality of an algorithm. Table 7 shows the number of iterations of these six algorithms to get the optimal value on 22 functions. We set the maximum number of iterations to 500. At the same time, to evaluate experimental results faster, we assume that when the optimal value is less than 10 24 , it is roughly considered that the algorithm has converged to 0. If the algorithm does not converge after 500 iterations, 500 is regarded as the number of iterations here. For each function, we bold the data that iterates fastest to the optimal value. That is, the smaller the value, the faster the algorithm iterates on this function. Figure 1 reveals the convergence curves of the six algorithms on functions f 1 , f 9 , f 12 , and f 19 . Four selected examples correspond to the four types of functions proposed, which can help us better analyze the algorithm. Please note that in Figure 1(a), the values of FOA and QTFOA in the whole iteration process are quite different from those of other algorithms. Therefore, Figure 1(b) adds the details of numerical changes of these two algorithms.
From Table 7 and Figure 1, we can see that for most functions, QTFOA can efficiently converge in the fastest time. Whether the speed of convergence or the quality of the solution, QTFOA has demonstrated strong competitiveness. However, the performance of QTFOA on low-dimensional unimodal functions is not good. For example, it can be seen from the iterative curve of f 9 that QTFOA tends to fall into local optimal values.

Significant difference analysis
To detect the difference of experimental results samples, we compare QTFOA with other five algorithms for significant differences test by the Friedman test and the famous Wilcoxon signed-rank test. Tables 8 and 9 respectively show the experimental results. Among them, when the p-value is greater than 0.05, it means that this sample result is not statistically significant.
We bold the data which are greater than 0.05. From the experimental results, we can see only a small amount of data has been annotated. This shows the optimization result of QTFOA is indeed very different from other algorithms significantly.

Comparison of the running time of six algorithms
Time complexity is also one of the indicators for judging the capability of an algorithm, which can roughly characterize its computational efficiency. For each function, we run it 500 times with six algorithms, respectively, and then take the average of the corresponding time as the algorithm's optimization time for this function. The unit of time is seconds. The experimental result is shown in Table 10, and the shortest time is bolded.
From Table 10, it can be seen that QUATRE and PSO have higher operating efficiency, but the QTFOA has a long running time. In QTFOA, the random optimization process and matrix operations increase the

Principle of CVRP
The problem can be described as: there is a central warehouse (numbered 0) transporting goods to L shipping points (numbered 1, 2, ., L) through K vehicle. Each shipping point has a different demand g i (i = 1, 2, ., L) for goods and the demand for each shipping point can only be met by one car. The model requires that every shipping point must receive the delivery service of a vehicle. The capacity of each vehicle is q k (k = 1, 2, ., K). For each vehicle, the total cargo volume of its transportation path shall not exceed its own maximum capacity. Now, it is required to find the shortest vehicle travel path. First, two variables y ki and x ijk are defined by equations (20) and (21) if the demand of delivery place i is fulfilled by vehicle k 0 else C ij is the distance between shipping point i and j. Z is the sum of all vehicle paths and Q represents the maximum capacity of transport vehicles. CVRP is to find minZ and the related formula is shown below Equations (23) and (24) can ensure that the requirements of each shipping point are met. Equation (25) can ensure that the needs of each shipping point can only be met by one car. For each vehicle, equation (26) can ensure the total cargo volume of whole transportation path shall not exceed its own maximum capacity.

Simulation experiment and result analysis
First, to study whether QTFOA is suitable for solving CVRP, we use a simple example in Table 11 for testing. The serial number 0 represents the central warehouse, and the serial numbers 1-7 represent seven shipping points. Set the number of transport vehicles to 3, and stipulate the capacity of each vehicle cannot exceed 100. Location information and cargo requirements are given in Table 11. The theoretical optimal path value is known to be 217.8. The optimization result of QTFOA is shown in Figure 2.
In the above test case, QTFOA can optimize the path to 221.4 quickly, which is very close to 217.8. This shows that the QTFOA is suitable for CVRP and can achieve good optimization results.
Later, we compare QTFOA with QUATRE, FOA, and SA. Four algorithms are tested on 10 sets of data from the CVRP international standard example VRPLIB. The numerical results of this comparison can be observed in Table 12. Here, in order to ensure fairness, for each algorithm, we run 3000 generations with 150 particles.  Table 12 shows that QTFOA can obtain the shortest path on each set of test cases. At the same time, in general, as the number of shipping points and transportation vehicles increases, the advantages of QTFOA become more obvious. This shows that when faced with a complex transportation environment,  QTFOA can play a better role. In short, QTFOA has performed very well in solving CVRP.
To further explore the optimization process of QTFOA to CVRP, we have done an analysis of the convergence process of four algorithms. Figure 3 reveals the convergence curves of A-L32-k5 and A-L33-k5. As can be seen from Figure 3, QTFOA can get the highest quality solution, that is, the shortest path. However, from the image, we can see that QTFOA converges very slowly. When solving the situation with large quantities of data, the calculation speed and efficiency must be specially considered. So, this can be an aspect of future research.

Conclusion
Combining FOA and QUATRE, a new optimization algorithm QTFOA is proposed in this article. To effectively avoid sinking into the local optimum, QTFOA uses affine transformation formula in QUATRE algorithm, which helps the particles to expand the search range greatly. To explore the optimization ability of QTFOA, we select 22 functions of four types for testing, and compare the algorithm with FOA, QUATRE, PSO, DE, and GWO. It is obvious from the above experiment result that the optimization performance of QTFOA is higher than the other five algorithms as a whole. To evaluate the capabilities of QTFOA in multiple aspects more comprehensively, we also design experiments for algorithm convergence analysis, the Friedman test, the Wilcoxon signed-rank test, and running time comparison. Most experiments have proved that QTFOA is excellent in different evaluation indexes.
In the end, we apply QTFOA to CVRP. Through 10 sets of cases on VRPLIB, QTFOA is compared with QUATRE, FOA, and SA and the experimental result proves that QTFOA can always find the shortest effective path. But QTFOA still has three obvious shortcomings. First, QTFOA has poor performance on low-dimensional unimodal functions. Second, it has a particularly slow running time. Finally, when solving CVRP, the convergence speed of it is very slow. How to solve these three problems of QTFOA is an improvement direction that can be considered in the future.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.