Abstract
Aiming at the disadvantages of slow convergence and the premature phenomenon of the butterfly optimization algorithm (BOA), this paper proposes a modified BOA (MBOA) called reverse guidance butterfly optimization algorithm integrated with information cross-sharing. First, the quasi-opposition concept is employed in the global search phase that lacks local exploitation capabilities to broaden the search space. Second, the neighborhood search weight factor is added in the local search stage to balance exploration and exploitation. Finally, the information cross-sharing mechanism is introduced to enhance the ability of the algorithm to jump out of the local optima. The proposed MBOA is tested in fourteen benchmark functions and three constrained engineering problems. The series of experimental results indicate that MBOA shows better performance in terms of convergence speed, convergence accuracy, stability as well as robustness.
Keywords
Introduction
Global optimization problems (GOPs) attempt to find the best solution among all feasible solutions to solve problems. GOPs exist in numerous fields such as economic models, structural design, image processing and so on, so global optimization algorithm has always been a hot topic in recent decades. Traditional mathematical methods can find the solution to the problems through a large amount of calculation in most cases. However, these methods are not able to find solutions efficiently with the dimensions increasing. Given the drawbacks of conventional methods, the meta-heuristic algorithm is becoming increasingly popular. Under the law of jungle survival, unique living habits protect the surviving creatures from extinction. So the creatures are chosen as search agents to find the best solution to the GOPs, and some of the meta-heuristic algorithms with good performance including particle swarm optimization (PSO) [1], artificial bee colony algorithm (ABC) [2], bat algorithm (BA) [3], firefly algorithm (FA) [4], grey wolf optimization (GWO) [5], whale optimization algorithm (WOA) [6] and so on.
Inspired by the foraging behavior of butterflies, Arora et al. [7] proposed the Butterfly Optimization Algorithm (BOA). The BOA has the adaptability and learning ability to solve complex problems effectively by simulating the foraging and mating behavior of butterflies. BOA, characterized by simple principle structure, fewer control parameters and easy implementation, has attracted extensive attention of an army of scholars. BOA has been successfully applied to some engineering problems, such as feature selection and fault diagnosis in the wind turbine [8], node localization in wireless sensor networks problem [9], artificial neural network training [10] and so on. However, like other swarm intelligence algorithms, this algorithm is slow in convergence speed and prone to precocity. In the late stage of evolution, most search agents get close to the elite agent and the diversity of population declines sharply which leads to a slow convergence rate and trap into local optima. Moreover, the fixed value p, which determines the occurrence of either local search or global search, leads BOA to become weak in exploitation.
Aiming at these deficiencies of BOA, many scholars have put forward numerous improvement strategies. The No Free Lunch theorem (NFL) pointed out that no algorithm can perfectly solve the problem of all kinds of optimization, which led researchers to merge two kinds of algorithms in some way to improve the performance of the algorithm. Arora et al. [11] integrated the differential evolution (DE) algorithm into the butterfly optimization algorithm. While keeping the essential characteristics of BOA, the advantages of DE are fully utilized to accelerate the convergence of the algorithm to the global optimal speed. In the same year, Arora et al. [12] proposed a hybrid butterfly optimization algorithm with the artificial bee colony algorithm (ABC). As a result, the BOA/ABC algorithm achieves a balance between global search and local search, overcoming the BOA’s weakness in exploitation. Wang et al. [13] used the mutualism mechanism to embed the flower pollination algorithm (FPA) into the butterfly optimization algorithm, retaining the exploration performance of the two original algorithms and enhancing the exploitation performance. Sushmita et al. [14] proposed a hybrid butterfly optimization algorithm with symbiosis organisms search (SOS) algorithm called BOSOS. The hybrid algorithm BOSOS makes full use of the better global search ability of BOA and the better local search ability of SOS.
Hybrids of BOA with other meta-heuristic algorithms produce more effective results than standard BOA, but the hybrid algorithms take more time to get the result. In order to improve the global optimization ability of BOA, in addition to hybrid algorithm method, various improved version of BOA has been proposed in succession. Arora et al. [15–17] proposed a variety of improvement strategies based on the original algorithm. For example, in literature [15], additional intensive exploitation stages were added based on the basic butterfly optimization algorithm to improve the efficiency of exploitation. Literature [16] proposed a modified version of BOA called CBOA. CBOA uses a chaotic mapping to initialize the population and interfere with the value of p instead of a fixed value, which greatly increased the population diversity and the ability to jump out of local optima. Literature [17] embedded the learning automata into the butterfly optimization algorithm, and the introduction of this learning strategy accelerated the convergence speed of the algorithm to the global optimal. Bhupinder Singh et al. [18] made the sensory morphology value c change with the number of iterations instead of the original constant value, thus significantly improving the algorithm performance. Sushmita Sharma et al. [19] introduced a mutualism search operator in the global search stage of BOA, which improved the exploitation performance. Lee Sen Tan et al. [20] modified the switching probability parameter p that controls global search and local search, making it vary dynamically with the change of iteration times. The proposed approach is called IBOA, and it has been successfully applied to the calculation of elliptic partial differential equations. Sharma et al. [21] proposed a modified BOA that embeds the bidirectional search in the structure of BOA, and the improved algorithm has been successfully applied to reliability optimization problems.
From these state-of-the-art improvement methods, it can be found that they almost focus on enhancing the exploitation capability of BOA to balance between exploitation and exploration. However, these methods still trap into local optima with population diversity declining in the late stage of evolution. Thus, the information cross-sharing in the stage of evolution is vital to increase the diversity of the population and avoid the premature phenomenon.
To improve the effect of butterfly optimization algorithm, speed up the convergence to the global optimal solution, and improve the performance of getting rid of local optima, this work proposes a reverse guidance butterfly optimization algorithm integrated with information cross-sharing, which has been improved in the following three aspects: In the global search stage, a quasi-opposition operator is introduced to update the butterfly position, which is compared with the butterfly position updated by the original operator, and MBOA greedily selects the better butterfly to improve the exploration performance and convergence accuracy of the algorithm. In the local search stage, the weight factor is added to the neighborhood flight operator, so that butterfly individuals pay more attention to social group learning than their cognitive learning, thus improving the convergence speed to a large extent. Under the inspiration of GA, the mating behavior between butterflies is carried out to achieve cross-sharing of genetic information with neighboring individuals or the optimal individual. Then the next generation realizes random Lé vyflight variation to enhance the ability to prevent falling into local optima.
In order to verify the optimization performance of the improved MBOA algorithm, 14 benchmark functions and 2 engineering problems are solved and calculated. The experimental results show that MBOA has better performance than the algorithm being compared in most cases.
The rest of the paper is organized as follows. Section 2 introduces the mathematical model of the basic butterfly optimization algorithm. The related work about quasi-opposition is overviewed in Section 3. Section 4 proposes the improvement and innovation based on the original algorithm. Section 5 has carried out simulation experiments and solution calculations on the algorithm performance. Finally, conclusions are drawn in Section 6.
Butterfly optimization algorithm
Scholars such as Arora were inspired by the foraging behavior of butterflies and proposed butterfly optimization algorithms. The behavior of a butterfly can be described as a movement to find food sources. Various parts of the butterfly, such as antennae, tentacles, legs, etc., are covered with a variety of sensory organs, which can sense the fragrance in the air and the intensity of the fragrance to determine the direction of movement. At the same time, the butterfly will also emit a certain intensity of fragrances, which is related to the fitness of the butterfly. The butterfly optimization algorithm imitates this behavior to find the optimal solution in the search space, and the butterfly is the search agent in the optimization algorithm. In the process of butterfly movement, the butterfly emits different intensities of fragrance in different positions. The intensity of fragrances is determined by the value of the objective function. The butterflies attract and get close to each other according to the fragrance spreading in the air. When the butterfly in the group perceives the best butterfly that emits the strongest fragrance, it will move towards the best butterfly, which is called the global search stage; when the butterfly does not perceive the fragrance around, it will move randomly, and this stage is called the local search stage.
Compared with other swarm intelligence optimization algorithms, the main advantage of BOA is the adjustment mechanism of fragrance. The formula for calculating the scent of butterflies is as follows:
The algorithm is mainly divided into global search and local search in the iterative stage. In the global search stage, the butterfly moves toward the butterfly with the highest fitness which can be described as Equation (2).
The formula of the local search stage represents as Equation (3).

The flowchart of BOA.
In the past, many scholars have done much research on Opposition-based Learning (OBL). It has successfully increased the performance of algorithms.
The concept of OBL was first proposed by Tizhoosh [22] in 2005. Its principle is to endeavor to find a solution from the opposite of the problem. The application of OBL strategy in swarm intelligence algorithm servers two purposes. On the one hand, the OBL strategy can be applied to the population initialization stage to improve the diversity of the population and obtain a more suitable initial population value; on the other hand, it can also be applied to the solution update in the iterative stage to solve the problem. The scheme generates dynamic jumps and enhances the exploration ability of the algorithm. The OBL strategy has excellent effects and has been applied to many optimization algorithms [23–26]. Reverse learning is expressed as
With the in-depth research of scholars, another quasi-opposition strategy (quasi-opposition) [27] is proposed, which is expressed as:
Reverse guidance
Due to the lack of exploitation ability in the global search stage of the butterfly algorithm, inspired by the quasi-opposition idea, a reverse guidance (called QOG) strategy is proposed. QOG work as follows: Equation (6) is employed to reversely guide the butterfly position updated by Eq. (2) to obtain the reverse solution of the butterfly; the fitness value of the two solutions is calculated; and the solution with better fitness value is selected as the final solution. While reverse learning (called OBL) strategy inspired by opposition-based Learning uses Eq. (5) to find the reverse solution of the butterfly position updated by Equation (2).
This article initially compares the experimental results of OBL and QOG to solve the optimal solution of the function. As shown in Fig. 2, it can be seen that the convergence accuracy and convergence speed of QOG show better performance than those of OBL, which verifies the superiority of QOG over OBL. Reverse guidance uses the idea of quasi-opposition to randomly search for a better solution between the reverse point and the midpoint of the search space. Compared with the reverse learning (OBL), the reverse guidance (QOG) that dynamically changes the lower and upper bounds of the search interval makes the randomness stronger, provides a promising direction of travel, and enhances the performance and efficiency of the algorithm for global optimization.

Reverse Learning (OBL) vs. Reverse Guidance (QOG).
The local search operator of the butterfly algorithm can be seen in Equation (3). In local search, butterflies utilize social learning experiences
MBOA introduces a relatively small weight to allow the individual butterfly to take full advantage of social experience to guide the direction of flight and improve the ability of local exploitation.
The original butterfly optimization algorithm can be described as the behavior of foraging both in the global search stage and the local search stage. In this process, the butterfly individuals are affected by the experience of the best individuals, and it is easy to gather together and fall into local optima. Therefore, at the right time, individuals can share genetic information to break out of the stuck of local optima by cross-mutating individuals. Inspired by the genetic algorithm, the introduction of genetic evolution factor F can endow butterflies with the behavior of mating and mutation. This behavior allows individuals to achieve gene crossover to achieve the purpose of sharing the information and allows their offspring to have genetic mutations, which increase the population diversity.
The butterfly individual judges whether the mating object is the optimal individual or the neighborhood random individual according to two conditions. The first condition is the range of the absolute value of the fitness difference between the individual and the optimal individual. When the absolute value is relatively large, the butterfly chooses the optimal individual for mating, otherwise, it will mate with two random individuals in the neighborhood. The criteria for judging the absolute value changes dynamically with the number of iterations t; The second condition is to compare the randomly generated uniform distribution number r with the given elite selection probability CR. When r is within the elite selection probability, the butterfly will mate with the best individual, otherwise, it will mate with two random individuals in the neighborhood. When one of the two conditions is met, the corresponding operation will be performed. The absolute value in the first condition is expressed as the formula:
During the mating of an individual butterfly with an elite individual, the three-dimensional genetic information of the elite individual is randomly selected and copied to the corresponding dimensional genetic information of the butterfly individual. The genetic information in other dimensions remains unchanged. Expressed by the formula as:
When a butterfly individual mates with a random individual in the neighborhood, it fully considers the genetic information of the individual in the neighborhood. Expressed by the formula as:
The genes of the next generation after mating may mutate in random dimensions. Here, Lé vy flight perturbation is used to realize the mutation operation. The motion mode described by Lé vyflight is that the jump step length can be changed randomly. This motion mode helps the algorithm to escape the limitation of the local optimum and increase the search space. Lé vy distribution is expressed as:
Mantegna [28] proposed simulation Lé vyflight in 1992, and its calculation formula is:
Lé vyflight variation is expressed by the formula:
Compared with the genetic algorithm, the improved algorithm only has crossover and mutation, and there are no selection steps. This is to prevent the algorithm from falling into the local optimality prematurely due to the rule of survival of the fittest, and at the same time, it can reduce the time complexity. A large amount of literature such as literature [26] shows that the hybrid of biological population optimization algorithms and GA or DE can achieve good optimization results. This is determined based on the different optimization advantages of the two types of algorithms. At the same time, because crossing mutation is time-consuming, such algorithm fusion in MBOA will inevitably increase the time complexity, which is the defect of introducing cross mutation.
The pseudo-code of information cross-sharing is shown in Algorithm 2.
Reverse guidance broadens the search space and speeds up the convergence speed; the neighborhood search weight balances exploration and exploitation; information cross-sharing increases the diversity of the population and avoids the algorithm from falling into local optimality too early. The pseudo-code of the MBOA is displayed in Algorithm 3, and the flowchart of the MBOA is demonstrated in Fig. 3.

The flowchart of MBOA.
In order to increase the probability that the butterfly optimization algorithm jumps out of the local optima and speeds up the convergence of the algorithm to the global optimum, various scholars have given different improvement schemes. For example, chaotic mapping theory increases population diversity [16]; increasing adaptive inertia weight balances exploration and exploitation [18]; introducing a mutually beneficial mechanism speeds up convergence [19]. However, only one single improvement strategy is put forward in each of the above three schemes. Therefore, in this article, the butterfly optimization algorithm is further improved to obtain better optimization results by combining reverse guidance, neighborhood search weight factors, and information cross-sharing mechanism. This article conducts numerous experiments to verify the optimization effect of MBOA. All experiments are carried out under the hardware environment conditions of Windows7 64-bit operating system, 8 G running memory, and 3.20 GHz CPU. The debugging and running of the algorithm are based on MATLAB R2014b. The population size is set to 60, the maximum number of iterations of the algorithm is 1000, and each group of experiments is run independently 30 times to prevent errors caused by a single measurement. In addition, all test problems are initialized with the same random seed.
So as to examine the optimization performance of the improved algorithm from all aspects, 14 classical benchmark test functions with different optimization characteristics were selected. These functions include unimodal functions F1 F6 for testing the convergence speed and accuracy of an algorithm and multimodal functions F7∼F14 for checking the algorithm’s ability to jump out of local optima and global exploration capabilities. The relevant information of the 14 benchmark functions is shown in Table 1, where Dim represents the dimension of the variable and Range represents the boundary of the search space. At the same time, considering that the dimension is also an important parameter that affects the global optimization ability of the algorithm, the dimension setting ranges from 10 to 200 to verify the algorithm’s ability to solve low-dimensional and high-dimensional. The purpose is to investigate the MBOA performance more comprehensively.
The relevant information of the 14 benchmark function
The relevant information of the 14 benchmark function
This paper has conducted the following five simulation experiments to comprehensively verify the performance of the improved butterfly optimization algorithm (MBOA) in all aspects: Sensitivity analysis of genetic evolution factor F, elite selection probability CR, and switch control parameter p. The butterfly optimization algorithm that introduces the reverse guidance strategy (OBOA), the butterfly optimization algorithm that employs the neighborhood search weight factor (WBOA), and the butterfly optimization algorithm that embeds the information cross-sharing mechanism (GBOA) are compared and analyzed. The paper verifies the effectiveness of different improvement strategies. To verify the excellence of MBOA, MBOA was compared with BOA, two BOA variants including CBOA [16], IBOA [20], several classic metaheuristic algorithms like MDE-WOA [29], MDE-GWO [26], CSSA [30], CSBA [31], and three variants of DE including JADE [32], DEGL [33], LSHADE [34]. The experimental results of MBOA and other comparison algorithms BOA, IBOA, CBOA, MDE-GWO, MDE-WOA, CSSA, CSBA, JADE, DEGL, and LSHADE are tested by Wilcoxon’s rank sum test and Friedman test to verify the significant differences between the algorithm and the comparison algorithms, which reflects the superiority of MBOA. Three structural engineering optimization problems were selected to verify the feasibility and effectiveness of MBOA algorithm in engineering applications.
From the previous analysis of the algorithm flow of MBOA, it can be concluded that the genetic evolution factor F and the elite selection probability CR play a pivotal role in achieving a balance between the global search and the local search, and at the same time, it will affect the accuracy of the algorithm convergence. Therefore, it is necessary to discuss the parameters F and CR that maximize the accuracy of the algorithm.
F is to determine the probability of genetic evolution or foraging behavior of a butterfly, and CR is to determine the probability of mating behavior of butterfly individuals with neighboring random individuals or elite individuals. Parameters F and CR change from 0 to 1 with a step length of 0.2, respectively. The switch control parameter p, the stimulus intensity a, and the sensory form c remain unchanged from the original text, and the neighborhood search weight factor w and the cross factor A are set as 0.5 in advance, respectively. For each group of changing F and CR, the convergence precision is solved and the most suitable parameter value is obtained through analysis. In order to prevent the errors caused by randomness, each function is solved 30 times. The optimal fitness value obtained each time is normalized to [0,1], so as to avoid the result deviation caused by the difference of data magnitude. Then the convergence accuracy of the algorithm for each function can be obtained by averaging the 30 normalized values. Finally, the comprehensive accuracy of the algorithm can be obtained by averaging the convergence accuracy of the algorithm for 14 functions. The comprehensive convergence accuracy of each group of F and CR values is shown in Table 2.
The influence of parameters F and CR on convergence accuracy, where the bold represents a higher convergence accuracy
The influence of parameters F and CR on convergence accuracy, where the bold represents a higher convergence accuracy
Preliminary experimental results indicate that the switch control parameter p has a greater impact on the experimental results. Therefore, this paper performs a parameter sensitivity analysis on p when F and CR take the best value obtained from the analysis in Table 2, and other parameters remain unchanged. The authors let p vary from [0,1] with a step length of 0.1, and the average value of the optimal value in 30 experiments is shown in Table 3. For the other parameters involved in MBOA, the same processing method is adopted to obtain the optimal parameters, which will not be discussed in detail due to limited space.
The influence of parameter p on convergence accuracy, where the bold represents a higher convergence accuracy
It can be seen from Table 2 that the changes of parameters F and CR are sensitive to the effect of convergence accuracy. When F remains unchanged, the comprehensive convergence accuracy shows a concave function trend about CR, and the comprehensive convergence accuracy is higher when CR is between [0.2, 0.6]. On the whole, when CR remains unchanged, F between [0.2, 0.4] can achieve higher comprehensive convergence accuracy. Finally, we set F as 0.2 and CR as 0.3 to conduct the below experiments.
It can be seen from Table 3 that except functions from F10 to F13 that are not sensitive to the parameter p, the convergence accuracy of other functions alters with the change of the parameter p. The convergence accuracy of the two functions F7 and F8 increases as p increases, and the convergence accuracy of other functions decreases as p increases. It can be further realized that the parameter p has a balancing effect between the local search and the global search. In order to obtain a higher comprehensive convergence accuracy, the value of p is set as 0.2 based on the data in Table 3.
To verify the effectiveness of each improvement strategy, the selected test functions are step function F6 and Penalized 1.1 function F13. The F6 function will produce a mass of local optimums at step. F13 is an inseparable multimodal function, and the local optimums are far away from the global optima. It is because these two kinds of functions are difficult to converge to the global optimal solution that these functions can be used to investigate the effect of each improvement strategy. This paper compares MBOA with the algorithm OBOA that only adopts the reverse guidance strategy, the algorithm WBOA that only employs the neighborhood search weight factor, and the algorithm GBOA that only introduces the information cross-sharing. In this section, the convergence curve is used to describe the convergence speed and accuracy of the algorithm. The parameter settings of each comparison algorithm are shown in Table 4. Each algorithm is run independently 30 times, and the convergence curve is shown in Figs. 4 and 5.
Main parameters of the algorithm
Main parameters of the algorithm

The convergence curve of Step function (10 dimensions).

The convergence curve of Penalized1.1 function (30 dimensions).
It can be clearly understood from the figure that the curve trend of GBOA and MBOA is roughly similar, indicating that the information cross-sharing mechanism plays a dominant role in the optimization process of the two functions of MBOA. Compared with GBOA, MBOA has higher convergence accuracy because of the superimposed effect of reverse guidance strategy and neighborhood search weight factor. At the beginning of the iteration, the convergence curves of OBOA and WBOA drop rapidly, indicating that the reverse guidance strategy and the neighborhood search weight factor have the effect of accelerating the convergence speed, which has a more obvious effect on the optimization of the unimodal function. As shown in Fig. 4, the acceleration of the convergence speed can improve the convergence accuracy to some extent. In the two figures, after GBOA intersects with OBOA and WBOA curves, the convergence speed of MBOA accelerates and the convergence accuracy of MBOA improves. This phenomenon indicates that when both OBOA and WBOA stagnate in the middle of iterations, the introduction of GBOA guides the algorithm MBOA to jump out of local optima.
In summary, although the introduction of the neighborhood search weight factor does not make the algorithm converge to the global optimum, it accelerates the convergence process; the information cross-sharing mechanism strategy enables the algorithm to expand the search space; in the early stage of the algorithm iteration, the reverse guidance continues to update the up and down bounds which increase the probability of jumping out of the local optima and speeds up the convergence rate. Even if the reverse guidance and the weighting factor stagnate in the later stages of the iteration, the accelerated convergence in the early stage has a significant advantage for the easy-to-converge unimodal function. Furthermore, the information cross-sharing mechanism provides a promising search direction. All three strategies have positive effects. The combination of the three strategies improves the performance of the algorithm qualitatively.
To verify the effectiveness of the modified algorithm, MBOA was compared with BOA, two excellent variants of BOA and other metaheuristic algorithms which produced a positive optimization effect. The selection of parameters of some algorithms is shown in Table 7. The parameter settings for MBOA are determined through the method described in Section 5.1, and the parameters of other algorithms are all adopted in the original paper. Each algorithm was executed 30 times, respectively, and the standard deviation (std.Dev), the mean, the best value, the worst value are taken for comparative analysis. The experimental results are shown in Table 5 and Table 6. The optimal value, worst value, and mean value can all reflect the optimization accuracy of the algorithm, and the standard deviation reflects the robustness of the algorithm.
Comparison of test function results (Best, Worst), where the bold represents a higher convergence accuracy
Comparison of test function results (Best, Worst), where the bold represents a higher convergence accuracy
Comparison of test function results (Mean, Standard), where the bold represents a higher convergence accuracy
According to Table 5, MBOA is quite competitive than other algorithms. It almost outperforms all others for the best and worst results on F1-F14 except F5, F6, F13. For F6 and F13, MDE-GWO, MDE-WOA, JADE, DEGL obtain the best results followed by MBOA. At the same time, MDE-GWO can get the same best results as MBOA for F1, F2, F3, F7, F10, F12 and F14. In particular, MBOA can reach the theoretical accuracy value on F1-F14 except F5, F6, F11, F13. Even if the dimensions increase, such as F1, F2, etc., the algorithm MBOA can still find the optimal solution, suggesting the advantage of the algorithm in solving high-dimensional problems. Although MBOA does not obtain the theoretical optimal solution zero for F11, it outperforms the other compared algorithms. It can be obviously concluded that the MBOA’s average and standard deviation on nearly all functions are smaller than the other ten algorithms from Table 9. Specifically, MBOA provides the best or near the best results on twelve out of fourteen test functions, and it ranks second in two other test functions including F6 and F13. For the function F5 with noise interference, although the effect of MBOA is not significantly improved compared with the comparison algorithm, all 4 indicators are the most excellent.
The convergence curve can better intuitively describe the optimization performance of the algorithm, such as the convergence speed and accuracy of the algorithm. The convergence curve of F1∼F14 is shown in Fig. 6. Except the convergence speed of MBOA in F6 and F13 which is lower than that of JADE, DEGL, MDE-WOA, the rate of convergence of the other 12 functions is better than that of the comparison algorithm. For high-dimensional functions F1 (200-dimensional), etc., it can converge to the global optimal solution in 500 generations. From the curves, we can see that MBOA converged rapidly in the early stage of the iteration process due to the reverse guidance which helps the agent search for the promising regions and converges to the optima more quickly than BOA. It is precisely because of the integration of information cross-sharing mechanism that MBOA can still maintain a relatively fast convergence speed and avoid falling into the local optimum. This behavior is evident in all test functions.

The convergence graph of each contrast function above the benchmark function.
Although CBOA has a greater degree of improvement relative to BOA, the optimization results of CBOA are weak in terms of stability. It is because CBOA uses chaotic mapping to initialize the population and interfere with the value of p, which leads to uncertainty in the evolutionary process and cannot guarantee a good convergence effect every time. In addition to the two functions F6 and F13 where IBOA shows some advantages, it does not show significant advantages in other types of optimization functions. Among the test functions in this article, the optimization effects of MDE-GWO and MDE-WOA are second only to the algorithm MBOA proposed in this article. For the three DE variants JADE, DEGL and LSHADE, they just show some advantages in the four functions including F6, F7, F8, F13, and the optimization effect of other functions is not very significant. In conclusion, other algorithms show different degrees of limitations in processing different types of optimization functions, but the algorithm MBOA proposed in this paper has achieved an excellent effect among all test functions.
To sum up, regardless of the high-dimensional or low-dimensional conditions, among the comparison algorithms, the MBOA algorithm performs significantly well in terms of the optimization speed, optimization accuracy, and stability of the function.
It is difficult to comprehensively evaluate the optimization performance of the algorithm only from the optimal value, worst value, average value, and standard deviation. Statistical tests are used to verify the improved algorithm’s differences compared with other algorithms to evaluate the optimization effect more accurately. Therefore, this paper employs Wilcoxon’s rank sum test [35] to verify whether the improved butterfly algorithm MBOA is significantly different from other algorithms, and the statistical test is carried out at the 5% significance level. The null hypothesis is to assume that there are no significant differences between algorithms. When the p-value is more than 0.05, the null hypothesis is accepted and the performance of the algorithms is similar. Otherwise, the null hypothesis is rejected and the two algorithms are considered to be significantly different. In addition, the Friedman test is also introduced to verify the superiority of the proposed approach. Like Wilcoxon’s rank sum test, the smaller p-value of Friedman’s test is, the more significant differences occur between the proposed algorithm and other algorithms in performance.
The Wilcoxon’s rank sum results are listed in Table 7, where the bold represents worse results that p ⩾ 0.05. MBOA is statistically significant if and only if the p-value is less than 0.05. From Table 7, the p-value is more than 0.05 between CBOA and MBOA for F11, and it is also more than 0.05 between MDE-WOA and MBOA for F10. Except these cases, the p-value is less than 0.05 in most cases. In conclusion, it can be found that the p-values are less than 0.05 in general, which strongly proves the remarkable superiority of MBOA compared with other algorithms. According to Table 8, it can be seen that the p-value obtained from the Friedman test is 1.9244e-15 far less than 0.05. Thus, there is a significant difference between the performance of algorithms. In Table 8, the average ranking of the algorithms is depicted with MBOA obtaining the best averaging ranking.
Wilcoxon rank sum test results
Wilcoxon rank sum test results
Friedman test results
In addition to the benchmark functions, this paper also selects three engineering example problems to judge the optimization ability of the algorithm under constrained conditions. These constrained examples include a pressure vessel and a welded beam design problem, which are widely used to analyze the performance of metaheuristic algorithms [36–38]. An effective method to handle constraints is to employ penalty functions. In this paper, the static penalty function described in literature [39] is used for constraint processing. The optimization results of engineering examples are compared with those of other algorithms. The optimization results of other algorithms are obtained from the original literature for the sake of fairness.
Tension/compression spring design
This engineering problem aims to calculate the minimum weight of the spring, which is a real-world problem that has been usually employed as a benchmark for testing the performance of meta-heuristics algorithms. It involves three decision variables including wire diameter (d), mean coil diameter (D) and the number of active coils (N) (see Fig. 7). The problem subjects to some constraints such as shear stress, surge frequency, and minimum deflection, and the mathematical formulation of this problem is as follows:

Tension/compression spring design problem.
The decision variables
Minimize
Subject to
Variable range
The results of the tension/compression spring design problem are shown in Table 9. It can be concluded that the proposed approach MBOA gains the best results compared with GWO [5], WOA [6], GA [40], AIS-GA [41], DE [42], cricket algorithm [43].
Tension/compression spring design problem results, where the bold represents the better results in each row
The goal of the pressure vessel design problem is to minimize the total cost including four variables, which are the thickness T s (x1) of the shell, the thickness T h (x2) of the head, the radius of the shell of cylindrical R (x3), and the length of the shell L (x4) (see Fig. 8). The mathematical formulation of this problem is as follows:

Pressure vessel design problem.
The decision variables
Minimize
Subject to
The optimization results of pressure vessel design are listed in Table 10. MBOA gains the best solution compared with PSO [44], HS [45], GA [40, 46], WOA [6], MDE-WOA [29] among the data.
Pressure vessel design results, where the bold represents the better results in each row
As shown in Fig. 9, it is a schematic diagram of the welded beam model. The fitness function is the total manufacturing cost. This problem contains four decision variables: thickness (h) of the weld, length (l) of attached part of the bar, height (t) of the bar, thickness (b) of the bar, which is represented by x1, x2, x3 and x4, respectively. The optimization problem finds the variable value that makes the manufacturing cost the lowest under the condition of satisfying the seven constraints. The mathematical model and formula of welded beam design are as follows:

Design of a welded beam problem.
The decision variables
Minimize
Subject to
where
The optimization results of welded beam design are displayed in Table 11. According to these data, the optimal solution found by MBOA is better than that of PSO [44], GA [40, 46], GWO [5], and is equivalent to that of HS [45] and GSA [47].
Weld beam design results, where the bold represents the better results in each row
To sum up, the proposed MBOA has excellent capabilities to address engineering problems. Therefore, MBOA can solve both constrained and unconstrained problems.
In conclusion, a modified version of BOA (called MBOA) is proposed to address the problem of the decreasing population diversity and slow convergence speed. Starting from the deficiencies of the original butterfly optimization algorithm, this paper adds reverse guidance in the global search stage to broaden the search space and improve convergence accuracy. Meanwhile, the neighborhood search weight factor is introduced to speed up the convergence rate. Above all, MBOA can increase the diversity of the population and jump out of local optima due to the information cross-sharing mechanism. The combination of the three improvement strategies effectively balances the contradiction between exploration and exploitation, which makes the algorithm speed up the convergence speed to a certain extent, and at the same time promotes it to break out of the constraints of local optima. From the results of optimization experiments and statistical tests of fourteen benchmark functions, it can be seen that MBOA is excellent in convergence accuracy, convergence speed, and stability, despite some limitations in the optimization of function with noise. Moreover, MBOA finds the best solution in three constrained engineering problems. In future research work, the MBOA is expected to be applied to the image threshold segmentation problem to verify the performance of the algorithm in solving real-world problems.
