Modified differential evolution algorithm with onlooker bee operator for mixed discrete-continuous optimization

For solving non-linear programming problems containing discrete and continuous variables, this article suggests two modified algorithms based on differential evolution (DE). The two proposed algorithms incorporate a novel random search strategy into DE/best/1 and DE/cur-to-best/1 respectively. Inspired by the artificial bee colony algorithm, the random search strategy overcomes the searching unbalance of DE/best/1 and DE/cur-to-best/1 by enhancing the global exploration capability of promising individuals. Two numerical experiments are given to test the two modified algorithms. Experiment 1 is conducted on the benchmark function set of CEC2005 in order to verify the effectiveness of the improved strategy. Experiment 2 is designed to optimize two mixed discrete-continuous problems to illustrate the competitiveness and the practicality of the proposed algorithms. In particular, the modified DE/cur-to-best/1 finds the new optima of two engineering optimization problems.

colony is classified into three groups depending on their duties: employed bees, onlooker bees and scouts. The number of employed and onlooker bees is equal to one half of the population size. Based on the information shared by employed bees, onlooker bees select different food sources at different probabilities and explore their neighborhood. Some numerical comparisons (Civicioglu and Besdok 2013;Karaboga and Basturk 2007) have demonstrated that the performance of the ABC algorithm is competitive with other population-based algorithms, and it has the advantage of employing fewer control parameters.
The evolutionary operators of the DE and ABC are similar and, in some ways, complementary. Some recent studies combining the two algorithms have been proposed to benefit from their advantages and overcome their drawbacks. Yang et al. (2013) proposed a hybrid ABC-DE algorithm, in which employed bees use the mutation and crossover strategies of DE to enforce their exploration ability, while onlooker bees keep their original updating strategy to retain the exploitation capability. Gao et al. (2012) proposed a modified ABC algorithm, which is based on the fact that each bee searches only around the best solution of the previous iteration. Gao (2013) gave an accelerated ABC algorithm based on DE for solving the Van der pol-Duffing oscillator problem. Álvaro et al. (2012) developed a multi-objective ABC/DE algorithm by combining the collective intelligence of the honey bee swarms with the properties of the DE algorithm. Many other successful combinations (Gao and Liu 2011;Li and Yin 2012;Li et al. 2013) of the two algorithms have also demonstrated complementarity of the operators in the searching ability.
In order to enhance the exploration ability of the DE/best/1 and DE/cur-to-best/1 mutation strategies, the present study proposes two modified DE algorithms with an onlooker bee operator, called mDEOB (i.e., mDEOB/best/1 and mDEOB/cur-to-best/1). Inspired by ABC, the two mDEOB algorithms run the classical mutation and crossover operators of DE followed by a random search guided by an onlooker bee operator. The random search enhances the ability to explore promising individuals. Two numerical experiments were conducted on the benchmark function set of CEC2005 and a class of engineering design problems. Statistical analyses and comparative analyses were performed on the results of the two experiments.
The rest of this paper is structured as follows: "Classical differential evolution" section briefly introduces the classical DE algorithm; "Modified differential evolution algorithm with onlooker bee operator" section presents and analyzes the proposed mDEOB algorithms; numerical experiments and analyses are then presented in "Numerical experiment" section, followed by conclusions in "Conclusion" section.

Classical differential evolution
DE is often used for dealing with the continuous optimization problem. This paper supposes that the objective function to be minimized is f (� x), � x = (x 1 , . . . , x D ) ∈ R D , and the feasible solution space is = j=D j=1 [L j , U j ]. The classical DE (Hu et al. 2008(Hu et al. , 2014(Hu et al. , 2016Su and Hu 2013) works through a simple cycle of operators including mutation, crossover and selection operator after initialization. The classical DE procedures are described in detail as follows.

Initialization
The first step of DE is the initialization of a population with N D-dimensional potential solutions (individuals) over the optimization search space. We shall symbolize each individual by � x g i = (x g i,1 , x g i,2 , . . . , x g i,D ), for i = 1, . . . , N , where g = 0, 1, . . . , g max is the current generation and g max is the maximum number of generations. For the first generation (g = 0), the population should be sufficiently scaled to cover the optimization search space as much as possible. Initialization is implemented by using a uniformly sampling to generate the potential individuals in the optimization search space. We can initialize the jth dimension of the ith individual according to where rand(0, 1) is a uniformly distributed random number confined on the range [0,1].

Mutation operator
After initialization, DE creates a donor vector v g i corresponding to each individual x g i in the gth generation through the mutation operator. This article is interested in the following two operators: DE/best/1: DE/current-to-best/1: where x g best denotes the best individual of the current generation, the indices r 1 , r 2 ∈ S r = {1, 2, . . . , N }\{i} are uniformly random integers, mutually different and distinct from the sequential index i, and F ∈ (0, 1] is a real parameter, called mutation or scaling factor.
If the element values of the donor vector v i exceed the pre-specified upper bound or lower bound, we can change the element values by the periodic mode rule as follow:

Crossover operator
Following mutation, the crossover operator is applied to further increasing the diversity of the population. In crossover, a trial vector, u g i , is generated by the binomial crossover, which combines the elements of the target vectors, x g i , and the donor vector, v g i .
where CR ∈ (0, 1) is the probability of crossover, j rand is a random integer on [1, D].

Selection operator
Finally, the selection operator is employed to maintain the most promising trial individuals in the next generation. The classical DE adopts a simple selection scheme. It compares the objective value of the target x g i with that of the trial individual u g i . If the trial individual reduces the value of the objective function, it is accepted for the next generation; otherwise the target individual is retained in the population. The selection operator is defined as Modified differential evolution algorithm with onlooker bee operator DE/best/1 and DE/cur-to-best/1 algorithms find the global optimum of simple optimization problems rapidly (e.g., low-dimensional convex optimization problems); however, both algorithms may easily become trapped in the local optima when solving complex multimodal problems, for the reason that exploration and exploitation capabilities are both necessary for a population-based optimizer. In fact, the exploration and exploitation requirements are mutually contradictory. In order to achieve a good performance, the two capabilities should be well balanced, but the solution search Eqs. (1) and (2), which are used to generate new candidate solutions, are based on the information of the current best solution. Thus the search ability of the algorithms is good at exploitation but poor at exploration.
In order to promote the balance of the exploitation and exploration capabilities, the present study adapts the ABC algorithm and proposes two modified differential evolution algorithms with an onlooker bee operator, called mDEOB (i.e., mDEOB/best/1 and mDEOB/cur-to-best/1). The mDEOB algorithms enhance DE's exploration ability by adding some random searches around the promising individuals under the guidance of onlooker bees. The mDEOB algorithms work incorporate the two-stage cycle shown in Fig. 1, the first stage is the classical DE phase (including DE mutation, crossover and selection operators). The second stage is the onlooker bee phase inspired by the ABC algorithm. The implementation process of the onlooker bee phase is detailed below.

Algorithmic flowchart
In the ABC algorithm, the artificial bee colony consists of three groups of bees: employed bees, onlookers and scout bees. Each employed bee exploits a food source, bring the information about the food source back to the hive and shares the information with onlooker bees waiting in the hive for this information. Each food source is a candidate solution of the problem. The amount of nectar in a food source represents the quality of the solution represented by the fitness value. An onlooker bee chooses a food source (candidate individual) depending on the probability value P i associated with the amount of nectar(fitness). The probability P i of the individual x i is formulated as follows: Note that the fitness should be changed appropriately when solving minimization problems. Here N denotes the number of food sources (population size). .
Unlike the original ABC algorithm, the onlooker bees in mDEOB use the following Eq. (6) to generate new candidate solutions.
Obviously, Eq. (6) brings to the selected individual x g i a perturbation whose center is its own value and whose radius is the difference between two randomly selected individuals. The greedy selection operator [Eq. (4)] is used to decide whether x g i or y g i will survive to the population generated next. In each mDEOB cycle, N (population size) onlooker bees are sent to choose individuals in roulette wheel fashion: the greater the individual's fitness, the greater its perturbation chance. .

Initialize population
Generate donor vectors by Generate trial vectors by formulate (3) Select better vectors from and by formulate (4) Calculate selection probability for each individual by formulate (5 ) Select better vectors by formulate (4 ) for the next generation population onlooker bee phase Choose satisfied individuals according to the probability to disturb by formulate (6) Do N times loops In Fig. 2, it is readily seen that the population distributions have the following characteristics: • For the same function evaluations (FEs), i.e., sub_figures (a) versus (d), (b) versus (e), (c) versus (f ), the sub_figures (d), (e), (f ) associated with mDEOB more diverse than those associated with DE. • In the sub_figures (e) and (f ), the candidate solutions are located on both sides of the global optimum, whereas they are located on one side in sub_figures (b) and (c).It is well known that the case where candidate solutions are distributed about the global optimum is more conducive to DE search. Thus, with the help of the onlooker bees, the mDEOB generates better more useful population distributions than DE alone. • In sub_figure (e), many candidate solutions cover the global optimum and the population maintains better diversity; DE/best/1 (shown in sub_figure (c)) fails to do so. The figures illustrate the process by which this population diversity expedites more accurate solutions than is achievable using DE.
In summary, the numerical experiment results indicate that the modified strategy enhances the diversity of evolving populations, leading to improved of global searching in the solution space. This mitigates to some extent the disadvantages caused by the search imbalance in the DE/best/1 and DE/cur-to-best/1 algorithm. Set parameters: population size N = 30, problem dimension D = 2, mutation factor F = 0.5, crossover probability CR = 0.9. The global optimum of the third function

Numerical experiment
In order to test mDEOB/best/1 and mDEOB/cur-to-best/1 and show their performance, two numerical experiments are given in this section. One is conducted on the benchmark function set of CEC2005, the other is a group of application-oriented numerical examples related to two mixed discrete-continuous optimizations.

Experiment 1: test on CEC2005
This subsection deals with the following tasks: • Two comparative experiments on the benchmark function set of CEC2005 are conducted for mDEOB/best/1 versus DE/best/1 and mDEOB/cur-to-best/1 versus DE/ cur-to-best/1. • Sign Tests on the experimental results are used to demonstrate the advantage of mDEOB algorithms. • Convergence figures on the first 14 benchmark functions, which include all functions except for 11 hybrid composition functions, are given to show the difference of convergence speed on the differential algorithms.
The number of decision variables, D, is set to be 10 for all the 25 benchmark functions. The population size, N, is set to be 60 for all the algorithms. The mutation factor, F, is set to be 0.5 while the crossover probability, CR, is set to be 0.9. For each algorithm and each test function, 25 independent runs are conducted with 150000 function evaluations (FEs) as the termination criterion.

Statistical analysis of experimental results
According to Suganthan et al. (2005), Table 1 reports seven results of 25 independent runs on each function by DE/best/1 and mDEOB/best/1: the minimal error of 25 runs, the 7th error, the 13th error, the 19th error, the maximal error, the average error (mean) and the standard deviation (std.) of 25 runs, in turn. In the "compare" row, simple comparison analyses are given. The priority of the comparison analyses is the best solution, the mean and the standard deviation in turn. cur-to-best/1 and mDEOB/cur-to-best/1. From Table 1, we can see that mDEOB/best/1 outperforms the DE/best/1 on the 5 unimodal functions and 9 multimodal functions. Especially, as shown in Table 2, mDEOB/cur-to-best/1 outperforms the DE/cur-tobest/1 on all unimodal functions and all hybrid composition functions except for f17. mDEOB/cur-to-best/1 is superior to DE/cur-to-best/1 on the 5 functions (i.e., f6, f7, f10, f11 and f12) among the other 9 multimodal functions. Sign Test Derrac et al. (2011) is a popular statistical method to compare the performances of algorithms. As we all known, the average error (mean) and the best value are two most important factors for the performances of algorithms. So this paper uses Sign Test method to analyze the average errors and the best values, which are shown in Tables 1 and 2. Here the null hypothesis is that the performances of the two algorithms are not significantly differential, while the alternative hypothesis is that the performances are clearly differential. As shown in Table 3, for the results in Table 1, the probability value of supporting the null hypothesis of Sign Test on the average errors equals 1.000, but the probability on the best values is 0.021, which is less than the significance level 0.05. That is to say, we cannot reject the null hypothesis according to the average errors, but we can reject the null hypothesis according to the best values. This indicates that (1) judging by the average errors, the performances of the two algorithms are not significantly differential, but (2) judging by the best values, the performances of the two algorithms are obviously differential. So the overall performance of mDEOB/best/1 algorithm is obviously differential with the other. Combining with the front "compare" rows in Table 1, we can then draw a conclusion that the overall performance of mDEOB/ best/1 is better than DE/best/1. For the results in Table 2, the probability values of supporting the null hypothesis of Sign Test on the average errors and on the best values are equal to 0.004 and 0.167 respectively. In the similar way, we may draw a conclusion that mDEOB/cur-to-best/1 outperforms DE/cur-to-best/1. Figure 3 shows the evolution landscapes of the average error of the best function values on 25 running derived from all the four algorithms on all unimodal functions and all basic multimodal functions (i.e., f1-f12). It is not difficult to find the overall superiority of mDEOB algorithms at the convergence speed.
In summary: we can get that onlooker bees strategy has positive effect on the performance of DE/best/1 and DE/cur-to-best/1.

Experiment 2: mixed discrete-continuous
In order to further illustrate the capabilities of the proposed algorithms, two mixed discrete-continuous optimization problems (i.e., Design of a coil spring and a speed reducer) are optimized here.

Design of a coil spring
The design of a coil spring Sandgren (1990), Shen et al. (2009) is a nonlinear engineering design optimization problem, which is designed to minimize the the volume of spring steel wire used to manufacture the spring (minimum weight). As shown in Fig. 4, the spring is to be a helical compression spring. The designing parameters are the number   Tables 1 and 2 'Neg. Dif. ' and 'Pos. Dif. ' denote the number of the negative and positive differences, respectively 'P value' denotes the probability value supporting the null hypothesis In Table 1 In Table 2 Neg of spring coils, x 1 , the outside diameter of the spring, x 2 , and the spring wire diameter, x 3 . Let f (x 1 , x 2 , x 3 ) denote the objective function. The problem is formulated as follows:

Fig. 4 Spring design
Here the above formula includes nine constants: F max = 1000.0, S = 189,000.0, l max = 14.0, d min = 0.2, D max = 3.0, F p = 300.0, σ pm = 6.0, σ w = 1.25, G = 11.5 × 10 6 . x 1 is an integer variable, x 2 is a continuous variable and x 3 may take on only discrete variables according to the available standard of the spring steel wire diameters. The detailed explanation about the coil spring design can be found in reference Sandgren (1990), Lampinen and Zelinka (1999).
As reference Lampinen and Zelinka (1999), the two proposed mDEOB algorithms employ the soft-constraint (penalty) approach to handle the constraint functions, and employ the INT() function to handle the integer variable. The algorithmic parameters are set as follows, D = 3, N = 40, F = 0.9 and CR = 0.8. 100 independent runs are conducted with 2650 times iterations as the termination criterion.
As shown in Table 4, the solutions of the coil spring problem are reported and compared with the results obtained by other researchers. From the table, we can draw conclusions as follows: • Firstly, the proposed algorithms, mDEOB/best/1 and mDEOB/cur_to_best/1, can find the minimal objective value obtained in literatures. The best results obtained by other researchers in Table 4 is 2.65856. mDEOB/best/1 and mDEOB/cur_to_ best/1 can also find the optimal solution with the average CPU times of 0.02578s and 0.02322s in 100 independent runs. • Secondly, mDEOB/cur_to_best/1 finds another optimal solution. The find provides another designing strategy of the coil spring. From Table 4, the optimal solution reported by Lampinen et.al. is (9, 1.223041, 0.238) of (x 1 , x 2 , x 3 ). DE/best, mDEOB/ best/1 and DE/cur_to_best/1 algorithms find the same optimal solution, while mDEOB/cur_to_best/1 finds another optimal solution, (10, 1.18104, 0.283). • Thirdly, the percentage of successfully achieving the optimal value in multiple runs demonstrates that the modified strategy of mDEOB is effective. The last row of Table  4 reports the percentage in 100 runs of successfully achieving the optimal value. The percentages of DE/best and DE/cur_to_best/1 are 69.0, 90.0% respectively, while those of the proposed mDEOB/best/1 and mDEOB/cur_to_best/1 are 88.0, 95.0%. This indicates that the robustness of mDEOB/best/1 and mDEOB/cur_to_best/1 algorithms are better than the corresponding DE algorithms. This improvement of algorithmic robustness could be only due to employing the onlooker bee operator.
In the constraint handling strategy and the handling method of integer variable x 3 , the proposed mDEOB/cur_to_best algorithm respectively employs the soft-constraint (penalty) approach and the INT() function in reference Lampinen and Zelinka (1999) . The algorithmic parameters are set as follows, D = 7, N = 50, F = 0.9 and CR = 0.8. 100 independent runs are conducted with 2500 times iterations as the termination criterion.
In summary: The improved algorithms, especially mDEOB/cur_to_best algorithm, have strong competitiveness on this kind of complex constrained optimization problems.
All the above algorithms were implemented in Visual C++ and the experiments were conducted on a computer with a Intel(R) Xeon(R) CPU E3-1230 v3 @ 3.30GHz and 8GB RAM.

Conclusion
Two new algorithms, mDEOB/best/1 and mDEOB/cur-to-best/1, are proposed to deal with the imbalance between exploration and exploitation capabilities of the DE/best/1 and DE/cur-to-best/1 algorithms. Inspired by the ABC algorithm, these offer improved exploration abilities by employing a random search guided by onlooker bees. Numerical experiments were conducted to test the two proposed algorithm on CEC2005 benchmark functions and two engineering optimization problems. The results on the CEC2005 benchmark functions indicated the effectiveness of the improved strategy. Comparison with other algorithms for the engineering optimization problems showed the competitiveness of the proposed algorithms. In particular, the mDEDE/cur-to-best/1 algorithm found the new optima in both problems.

Authors' contributions
All authors conceived the study, participated in its design and coordination. In addition, YM did much work for the later revision of this paper. QS drafted the manuscript. ZH performed the majority of the experimental work. XX carried out the manuscript editing. All authors read and approved the final manuscript.