Abstract
Bacteria foraging optimization (BFO) algorithm is easy to fall into the local optimal solution and slow in convergence. In this paper, we have come up with a self-adaptive bacterial foraging algorithm based on estimation of distribution to overcome the mentioned shortages. First, in the chemotactic operator, the swimming step size of bacterium is adaptively adjusted by its fitness value and bacteria move in a random direction. Second, the bacteria obtain the probability of replication based on the fitness value. We choose half of the population for replication by the roulette wheel method. Finally, the possibility of elimination-dispersal is adjusted by the fitness value. Selected bacteria are dispersed to the new locations produced by BOX-Muller formula. Compared with some relative heuristic algorithms on finding the optimal value of ten benchmark functions, the proposed algorithm shows higher convergence speed and accuracy.
Keywords
Introduction
In 2002, Passino [12] put forward a bacteria foraging optimization (BFO) algorithm for optimization problems by the aid of the foraging behavior of Escherichia coli in human intestinal tract. Although BFO algorithm is superior to some other algorithms, it needs to be improved in terms of convergence speed and global search capability since it is really easy to fall into the local optimal solution and slow in convergence. Since then, many scholars have paid attention to BFO algorithm. Mishra [11] proposed fuzzy bacterial foraging in 2005, using fuzzy theory to choose optimal step size, while its performance depends on the selection of membership function. To speed up the convergence, Amin and Ehsan et al. [5] added a fitness function after the swimming of bacteria to calculate the next direction. In application, the fusion of BFO algorithm and other algorithms also have achieved good results. Kim and Abraham et al. [6] proposed GABFO algorithm by introducing crossover operator and mutation operator into BFO algorithm. To improve the performance of the algorithm, many scholars improved its adaptability. Datta, Misra et al. [3] and Majhi, Panda et al. [10] gave the ability of adaptively adjusting step size to bacteria according to the energy bacteria acquired in the whole life cycle. Dasgupta and Biswas [2] advanced a new BFO algorithm based on self-adaptive step size method to improve the fixed step size. Chen and Zhu [1] studied the influence of step size to self-adaptive BFO algorithm. If step size is too big, the ability of local search will be decreased. If step size is too small, the global search ability will be decreased. Based on self-adaptive step size method, Tong [16] introduced the roulette wheel selection into the reproduction operator.
In recent years, BFO algorithm was often applied in various fields with other algorithms. Ofosu et al. [13] used BFO algorithm to obtain optimal PI gains for fuzzy-PI controller and solved the difficulties that the proportional integral and derivative controllers could not overcome. Xiong et al. [17] proposed a risk-based multi-objective optimal allocation model and solved the formulated multi-objective optimization problem by combining the gradient particle swarm optimization algorithm and bacterial foraging algorithm, which decrease the risks of distributed generation and is conducive to the promotion and use of distributed generation. In computing integrals, many primitive functions of integrable functions are not elementary functions. Guo and Zhou [4] used BFO algorithm and the trapezoid quadrature formula to do that. The simulation results are really better than the results using the basic theorem of calculus. Kora et al. [7] combined bacterial foraging and particle swarm optimization to detect the abnormal cardiac beats. This method effectively improves the accuracy of the test results and also greatly helps the medical industry. It can be seen from those studies, BFO algorithm is an algorithm favored by various fields because of its good performance. Therefore, the improvement of BFO algorithm is also necessary for us, so that BFO algorithm may have better applications.
The main aim of this paper is to improve the bacterial foraging algorithm to promote the use of this algorithm in more fields. In the process we improved this algorithm, we find that self-adaptive adjusting various probabilities used in the algorithm and using BOX-Muller formula can reduce the double calculation of the algorithm and improve the effectiveness of proposed algorithm. The article is divided into the following sections: Section 2 introduces the bacteria foraging optimization algorithm. Section 3 describes estimation of distribution algorithm. Section 4 details the improved bacteria foraging optimization algorithm. The experimental analysis is conducted in Section 5. Finally, conclusion is given in Section 6.
Bacteria foraging optimization algorithm
To begin with notice that we shall consider the minimization problem as follows,
The chemotaxis operator can be divided into two parts: choosing direction and flipping. In the chemotaxis operator, each bacterium chooses a random direction to move one step. The random direction can be expressed by
The reproduction operator plays a role in accelerating the optimization of the population in the entire algorithm. In the reproduction operator, all bacteria in the space are sorted by their fitness values. The whole population can be divided into two parts: good performance and poor performance. Half of bacteria with good performance are copied to replace those bacteria with poor performance. We can see that this method also has the disadvantage of reducing population diversity.
The last operator is elimination-dispersal. Randomly generate a number. If the number is smaller than the probability P ed of elimination-dispersal, the bacterium will be dispersed to a new position generated randomly, otherwise the bacterium will maintain the original state. The procedure of elimination-dispersal provides more possibilities to jump out of the local optimal solution, but also increases the possibility of missing the global optimal solution.
In this paper, the method of generating new individuals in literature has been quoted into the elimination-dispersal operator in order to improve the BFO algorithm.
Estimation of distribution algorithm (EDA) [8] is a stochastic optimization algorithm based on statistical principle. This algorithm predicts the best searching area by sampling the search space and statistical learning of the applied model and generates the next population according to the probability model.
First, EDA initializes the original population. Then, it chooses advantaged group and constructs probability model of the population. After that, this algorithm randomly samples in the search space and generates new population according to the sample. Finally, the algorithm determines whether the termination condition is satisfied. If so, it outputs the optimization result. Otherwise, it chooses advantaged population again.
Gauss probability model is widely used to improve continuous EDA. Sebag and Ducoulombier [15] proposed variable independent estimation of distribution algorithm based on Gauss distribution. In 2000, Larra and Etxeberria et al. [9] proposed univariate real number code estimation of distribution algorithm based on Gauss distribution. In addition, the stochastic hill climbing with learning by vectors of normal distribution (SHCLVND) algorithm [14] is also a stochastic optimization algorithm based on Gauss distribution. On this basis, Rudlof and Koppen [14] proposed the application of Gauss distribution model to generate new individuals.
Improved bacteria foraging optimization algorithm
To improve the convergence speed and accuracy of BFO algorithm, the proposed algorithm introduces self-adaptive method and estimation of distribution method into BFO algorithm. The core idea is adjusting step size by self-adaptive method in chemotaxis operator and producing new locations by estimation of distribution method in elimination-dispersal operator. Assumed that the fitness value of bacterium f (i) can be represented as
For the chemotaxis operator, the main improvement is to adjust the chemotaxis step size. Based on the existing research, the adaptive mechanism is introduced into the chemotaxis process and the chemotaxis step length is adjusted according to the fitness value of individual bacterium.
Compared with fixed step size, the new algorithm is adjust the step size according to the fitness value. If the fitness value is smaller than the average of all fitness value, we’ll keep the step size unchanged. If the fitness value is greater than the average fitness value, we’ll modify the step size according to the following formula
The original reproduction operator directly ranks bacterial individuals according to fitness values and eliminates half of bacterial population with a bad fitness value, which may decreases the diversity of bacterial populations and kill some potential excellent individuals accidentally. The optimal fitness of the whole population remains unchanged which may slow down the convergence speed of the algorithm. Therefore, this algorithm adopt a new reproduction selection method.
First, we define the possibility of reproduction by the fitness value which can be expressed as follows
Based on the possibility of reproduction, we will choose half of bacteria to copy and the rest of bacteria are replaced by new bacteria. In this way, the number of individuals in the bacterial population can remain the same. This replication method can not only make bacteria with better fitness value have greater possibilities to be replicated, but also give chance to the potential excellent individual to continue searching optimal solution.
Elimination-dispersal operator is the operator of this algorithm which can make the algorithm have global search ability. In the original bacterial foraging algorithm, elimination-dispersal operator has a fixed dispersal probability. If the corresponding random number produced by the bacterial individual is less than the probability, the bacterial individual will be dispersed to a random location in the space. Otherwise, no further processing will be done on the bacterium.
In the novel optimization algorithm, we use the estimation of distribution method in [14] to disperse individual bacteria. After chemotaxis and reproduction, each bacterial individual produces a corresponding random number and adjusts the dispersal probability adaptively according to the individual fitness value. The bacteria with better fitness value have less probabilities to disperse. Otherwise the dispersal probability will be amplified. Compared the random number with the adjusted dispersal probability, if the random number is less than the set dispersal probability, the dimensions of the bacteria’s position vector are independent of each other, and each dimension conforms to Gaussian distribution, we calculate the mean and standard deviation of each dimension of the bacterial population at first. Then, according to the BOX-Muller formula, we generate a random number consistent with Gauss distribution r
norm
as follows,
According to this new dispersal method, bacteria aren’t dispersed to a completely random location. In the initial elimination-dispersal operator, the new location is completely random, which means there are a number of bacteria recover to initial conditions in each elimination-dispersal operator. This operation causes all previous work to invalid, which also causes the whole algorithm converge slowly.
The improved algorithm consists of chemotaxis, reproduction and elimination-dispersal operators. The steps of self-adaptive bacteria foraging algorithm based on estimation of distribution (BFOED) can be described as follow:
Algorithm flow chart is as the following Algorithm 1.
Experimental analysis
Benchmark functions and parameter setting
In order to test the performance of the improved algorithm, we select several benchmark functions and use the proposed algorithm to search the minimum value. Some of these functions have many local optimal values. With the increase of dimensions, the number of local optimal values increases exponentially, which also increases the difficulty of finding the minimum value. See Table 1 for the standard test functions.
Benchmark functions
Benchmark functions
Population space is the same as problem space. In problem space, a feasible solution is a vector, so we use bacterial coordinates to represent a feasible solution. It can be understood that if a feasible solution is X = (x1, x2, ⋯ , x25), then the corresponding bacterial coordinate is also X = (x1, x2, ⋯ , x25). In order to better explain the corresponding relationship between problem space and population space, we give the Table 2.
Corresponding relationship between problem space and population space
In this paper, genetic algorithm (GA), bacterial foraging optimization (BFO) algorithm [12], bacterial foraging optimization algorithm based on self-adaptive method (BFOSA) [16] and the algorithm proposed in this paper (BFOED) are used to optimize the above functions. We calculate the mean, standard deviation, minimum of the experimental results and analyze the performance of the algorithm according to the data.
In order to compare the optimization effects of different algorithms in the same situation, we need to set the parameters of the algorithm uniformly. In bacterial foraging algorithm, bacterial foraging algorithm based on self-adaptive method and the algorithm proposed in this paper, The initial population size P is 60, the dimension of the space bacteria search is 25, maximum steps of chemotaxis N s is 4, the times of chemotaxis, reproduction and elimination and dispersal N c , N r , N ed are equal to 40, 4, 2. According to the work principle of BFO, the total iteration is relevant to N c , N r , N ed , can be represented as
Parameter settings of algorithms
Different algorithms are good at solving different problems. We can not guarantee that the algorithm proposed in this paper is suitable for all benchmark functions. We use the algorithms to optimize the benchmark functions (where n = 25) for 30 times, from which we can choose the average best results μ, standard variances σ and best values as shown in Table 4 and rank-based results are provided in Tables 5 and 6.
Rank-based Results of GA, BFO, BFOSA and BFOED on f1 - f5
Rank-based Results of GA, BFO, BFOSA and BFOED on f6 - f10
According to the Table 4, we can see that the results of BFOED is better than that of other algorithms for most benchmark functions. f5, f7, f8 are low-dimensional benchmark functions. Among them, BFOED has the best optimization for f7, f8 in the four algorithms. The average optimal value of BFOED for f5 is slightly less effective than GA, but the standard variance of BFOED is smaller. In other words, BFOED is more stable than GA for f5. Other functions are high-dimensional benchmark functions, some of which have lots of local optimums that can increase the difficulty of searching global optimal value. For f2, f3, f4, f10, not only for the average value, but also for the best value, the result of BFOED is the best. For f1, the optimized effect of BFOED is slightly worse than that of GA. In all results, the optimized effect of BFO for f6 and f9 is much better than that of the other three algorithms. According to the Tables 5 and 6, the optimization results of BFOED are the best in most cases. The capability of optimization of BFOED is still effective on the whole.
From the aspect of algorithm, BFOED strengthens the control of bacterial activities, including the adjustment of step size, the method of reproduction, P ed and the new location generated in the elimination-dispersal operator. In each operator of proposed algorithm, BFOED always adjusts the features of each bacterium according to its states. However, the original algorithm does the same thing for all bacteria, so in each optimization process BFO is not flexible enough. This is why BFOED is more stable than other algorithms. After analyzing the improvement effect of BFOED, let’s analyze the convergence and stability of BFOED. This part mainly make analysis for benchmark function f1 as a case.
Figures 1, 2 and 3 are the results of optimizing the benchmark function f1 with BFO, BFOSA and BFOED, respectively. The time of chemotaxis is 30, the time of reproduction is 3, the time of dispersal is 2. Through Fig. 1, we can see that in the process of BFO optimization, there will be two places with great fluctuation in the optimization of bacterial population and there is a gap between the optimal value of the final optimization result and the overall average value. In other words, the overall optimization effect of BFO is not mature enough. Figure 2 is the optimization result of BFOSA for f1. It can be seen that the average optimization value only fluctuates once and the fluctuation amplitude decreases. There is still a large gap between the optimal value and the overall average value. We think the reason for the upward oscillation is that the elimination-dispersal process of BFO and BFOSA initializing the positions of some bacteria results in the invalidation of the preliminary work of the algorithm, so the oscillation will appear in the figure. The second downward shock may due to the reproduction operator according to the position where it appears. The population performs the replication operation and accelerates the average optimization value of the population.

BFO for f1 (25 dimensions).

BFOSA for f1 (25 dimensions).

BFOED for f1 (25 dimensions).
Figure 3 is the optimization result of BFOED for f1. Obviously, the optimization effect of BFOED for the overall average value is good and there is no fluctuation in the whole process. In the process of optimization, the global average value is continuously decreasing as the optimal value. In addition, the final optimal value and the overall average value almost coincide. The optimization of BFOED for f1 not only eliminate the fluctuation in BFO, but also reduce the interval between the optimal value and the overall average value. It can also be seen that BFOED has good convergence and stability and can jump out of the local optimal solution. Table 7 is the specific data of Figs. 1–3.
Optimization results of f1
In order to prove the BFOED has faster convergence speed than BFO and BFOSA, we give the line charts of the optimal results of BFO, BFOSA and BFOED, which record the optimal values every ten iterations.
The ten subgraphs of Figs. 4–13 can not only reflect the convergence results of the three algorithms, but also reflect their convergence speed. The closer the broken line is to the x-axis, the faster the convergence speed is. From Figs. 4–13, we can see that most of the broken lines of BFOED are located at the bottom of the image. It can be seen that BFOED has higher convergence rate under the same iteration number. The following Table 8 gives the average optimized value of BFOED optimizing the test function 100 times in 25-dimensional space and the average iteration number of reaching the average optimized value.

Line chart of BFO, BFOSA and BFOED for f1.

Line chart of BFO, BFOSA and BFOED for f2.

Line chart of BFO, BFOSA and BFOED for f3.

Line chart of BFO, BFOSA and BFOED for f4.

Line chart of BFO, BFOSA and BFOED for f5.

Line chart of BFO, BFOSA and BFOED for f6.

Line chart of BFO, BFOSA and BFOED for f7.

Line chart of BFO, BFOSA and BFOED for f8.

Line chart of BFO, BFOSA and BFOED for f9.

Line chart of BFO, BFOSA and BFOED for f10.
The average optimized value and average iteration number of BFOED
The average iteration number is the average of iteration numbers at which the algorithm reaches the average optimization value for 100 times. From the Table 8, we can see that BFOED has the fastest convergence speed for f7 and f8. The average iteration number required is small. For other functions, the convergence speeds are relatively average. The average iteration number required for all functions is 173.709, which can guarantee the stability in the later period. On the whole, BFOED has good convergence.
The analysis of the computational complexity of the proposed algorithm is divided into time complexity and space complexity. We mainly draw a conclusion by comparing the average CPU computational time of different algorithms in 25 dimensions and the average CPU computational time of BFOED in different dimensions. The unit of CPU computational time is seconds. All algorithms are coded with Python and performed in a computer with Intel(R) Core(TM) i5-7200U CPU @2.50GHz(4 CPUs)∼2.70GHz and 8192MB RAM.
Table 9 is the result of the average CPU computational time of different algorithms in 25 dimensions. We can see that GA has the best average CPU computational time for each function and there is a gap between BFO and GA in average CPU computational time. This is because BFO, as a new intelligent optimization algorithm, has higher control power in the optimization process, so it takes longer. We know that the time complexity of the algorithm is closely related to the number of times the algorithm calls the objective function in the optimization process. Compared with BFO, BFOED calls the objective function more times, so BFOED has no advantage in time complexity and has higher time cost. Because f5, f7, f8 have specific dimensions, we just test the other functions in different dimensions. In the Table 10, we can see that with the increase of dimensions, it is more difficult for the algorithm to find the optimal value, the optimal value that BFOED can obtain gradually becomes larger and the average CPU computational time also becomes longer. In addition to giving specific data, we can also use the following method to analyze the time complexity.
Average CPU computational time of algorithms on f1-f10
Average CPU computational time of algorithms on f1-f10
Optimization results in different dimensions
The proposed algorithm mainly consists of five steps: initializing bacterial population, chemotaxis operator, replication operator, elimination-dispersal operator and stopping judgment. Assuming that the number of bacterial population is P, the maximum iteration number of the algorithm is T in the D dimensional search space. When initializing bacterial population, there are two cycles P and D, so the time complexity of initialization stage is O (P * D). In the process of chemotaxis, replication and elimination-dispersal, the algorithm includes three cycles P, D and T, so the time complexity of these three processes is O (P * D * T). For the process of jumping out of the loop, his time complexity is O (1). Therefore, the total time complexity of BFOED is O (P * D * T).
In BFOED, the number of individuals of bacterial population is P, and its space is D dimensional, so the space complexity of BFOED is O (P * D).
It is found that the optimization process of bacteria foraging optimization (BFO) algorithm is accompanied by oscillation phenomenon, and the final average optimal value is far from the optimal value, so it is meaningful to improve the BFO. Proposed algorithm (BFOED) effectively overcomes the shortcomings that BFO easily falls into the local optimal solution by introducing estimation of distribution method and self-adaptive mechanism.
The convergence speed of BFOED is significantly improved compared to BFO. BFOED much early reaches a stable state and quickly converges to the optimal solution. Embedding estimation of Gaussian distribution in the elimination and dispersion operator greatly speeds up the convergence speed of the algorithm and avoids inefficient search and invalidation of previous work. In addition, for the optimizations of high-dimensional multi-peak benchmark functions, the optimization results of BFOED are better than those of GA and BFO and its accuracy has been improved. Through the test of the function dimension, we find that the function dimension also has an impact on the optimization result of the algorithm. The higher the dimension, the more difficulty find the optimal solution with. In the future work, we plan to study the convergence of the BFOED from the perspective of a random process and make more comparisons with other algorithms.
Acknowledgments
This work is supported by the National Natural Science Foundation of China (Grant No. 61673011).
