An Improved Bacterial Foraging Algorithm for Multi-modal Problems

In order to improve the performance of BFO (bacterial foraging optimization) algorithm in multi-modal problems, the algorithm is optimized and improved in this paper. In the chemotaxis operation, the gradient accumulation variable swimming step size is realized, and the convergence speed of the algorithm is accelerated. In the reproduction operation, a new population competition mechanism is added, and a double-index sorting is realized, which improves the ability of the algorithm to jump out of the local optimum and the diversity of the population. In the migration operation, the vitality index of bacteria is added to dynamically affect the migration probability, ensure the survival probability of elite individuals, and further improve the global optimization ability of the algorithm. Finally, a multi-modal function is selected to test. Compared with the genetic algorithm, the improved BFO algorithm is better than the genetic algorithm in speed and quality.


Introduction
Multi-modal optimization algorithms are one of the most challenging issues in the field of optimization. Most real-world problems have more than one solution; therefore, the potential role of multi-modal optimization algorithms is rather significant. Multi-modal problems consider several global and local optima. Therefore, during the search process, most of the points should be detected by the algorithm.
BFO was proposed by passiso in 2002 inspired by the foraging behavior of E.coli in human colon [1]. The surface of E.coli is covered with flagella, which moves and rotates during the foraging process. When the flagella rotates in the counterclockwise direction, the E.coli moves forward. When the flagella rotates in the clockwise direction, the E.coli rotates (turns) in place. Generally, E.coli swims more in an environment with more food, and turns more in food-poor areas. The foraging process of E.coli mainly includes searching for food source area, searching for food in the area and deciding whether to migrate or not according to food consumption. Bacterial foraging algorithm is a kind of bionic search algorithm based on the foraging process of E. coli. Chemotaxis, reproduction and migration are the main steps of BFO algorithm [2].
In Refs. [3,4], the researchers conducted a mathematical analysis of the performance of the trending mechanism under the one-dimensional function optimization situation based on the principle of the Linear Search Descent Method. Following the same idea, Ref. [5] performed a mathematical analysis on the performance of the propagation mechanism in the case of one-dimensional function optimization. In Ref. [6], the researchers used the Laypunov Stability Theorem in control theory to prove and analyze the stability of the trend mechanism under the optimization of one-dimensional functions. In Ref. [7], the researchers improved the chemotaxis operation and proposed two search strategies based on individual information and group information respectively; Ref. [8] proposed a fuzzy bacterial foraging algorithm, using a fuzzy inference mechanism to select the optimal step size; Datta and Mishra proposed an adaptive incremental step size for the chemotaxis operation [9]; Dasgupta and Biswas proposed an improved algorithm based on the adaptive step size mechanism [10]; Chen et al. proposed a collaborative bacterial foraging optimization algorithm [11].
At present, the theoretical research on the BFO algorithm is still at the stage of specific research on one-dimensional functions, but because the problems in scientific research and engineering practice are generally complex multi-dimensional optimization problems, the theoretical analysis of onedimensional problems is limited. It can be seen that expanding the theoretical research of onedimensional BFO to multi-dimensional situations conforms to the development of theoretical research in this field, and will establish a more solid theoretical foundation for the application of BFO in various complex optimization problems.

Improvement of Chemotactic Operation
The chemotaxis of BFO simulates the turnover and swimming of Escherichia coli. The chemotaxis operation calculates the fitness of the individual bacteria to find a better direction to move. First, bacteria swims one step in the random direction, if the fitness in this direction is low, it rotates and swims in other directions. If the fitness in this direction is high, it continues to swim in this direction.
In equation (1) In the traditional BFO algorithm, the step size is usually immutable, which will slow down the optimization process. Therefore, the variable step size of gradient accumulation was improved which is shown as follows: In equation (2), C represents the unit step, which is the step of the first swimming, is a given fixed constant. When the cost of a bacterial individual's swimming in a certain direction vector is reduced, as ( ( 1, , )) i f x j k l + < ( ( , , )) i f x j k l , the historical step is accumulated in this direction. In order to speed up the optimization, prevent the jump of the solution caused by the too fast growth of the step size, the gradient index  to realize the gradient superposition of the step size was added.

Improvements in Reproduction Operations
The fitness of a single bacterium is affected by other bacterial individuals in the population [12]. When a large number of bacterial individuals in the population gather in a region, the individuals in the region will have a greater rejection effect. On the contrary, when the population is relatively scattered, the bacterial individuals will have a greater attraction effect. The population can be achieved through the attraction and rejection effect among the bacterial individuals in the population. The In equation (3), In general, the influence function and the objective function jointly produce the dimension that affects the population sorting in a certain way, and the single dimension population sorting may discard the potential high-quality solution. Therefore, this paper makes improvements and adds a new population competition mechanism ( ) k R cell , which is expressed as follows: In equation (4), the cost of the objective function under the current solution Cos ( ) best t cell is generally the value of the objective function, which refers to the cost of the objective function under the optimal solution in the current population. The significance is the difference between the current solution and the current optimal solution, the larger the difference is, the smaller the survival ability of the solution is. The bacterial life-force evaluation index is formed, together with the bacterial nutrition value, they make up the sorting mechanism for bacteria to rank in the population. The processes of competition are independent of each other, and two mechanisms each take the first half of the population individuals to form a new generation of population. The reproduction operation of doubleindex competition mechanism reflects the rationality of population competition.

Improvement of Migration Operation
Migration operation means that some bacteria will migrate to the new environment to find the nutrition source after the dramatic changes of the living environment. After the bacterial population completes a reproduction operation, a migration operation will take place. Each bacteria decides whether a migration operation will take place with a certain probability. The migration operation is expressed as follows: Equation (5) indicates that the current bacterium destroy and randomly produce a new bacterial individual when they meet the migration probability. In the traditional migration operation, the migration probability is a fixed value, which means each bacteria is destroyed randomly in different places without difference. This operation may discard the high-quality solution without difference. Therefore, a variable probability of migration is realized in this paper. The migration probability function is expanded as follows: In equation (6),  and  respectively represent the upper and lower boundaries of migration probability, () stren x is the vitality of current bacterium based on the current solution. The higher the value is, the smaller the migration probability will be. This function improves the survival probability of high-quality solution and avoids the disadvantages of non-differential migration operation.  Figure 1 shows the whole process of the improved BFO optimization algorithm. The improvement in this part is to add the vitality index of bacterial individuals, which is used to rank in parallel with the nutritional content index of bacterial individuals. At the same time, the first 1/2 of the two dimensional ranking is selected to merge into a new population to achieve a reproduction operation. Another improvement in this part is the variable migration probability function of migration operation. This function is related to the individual vitality index of bacteria and reduces the migration probability of high-quality solution. Figure 2 represents the specific process of the chemotaxis operation of the improved BFO algorithm, which traverses all bacterial individuals, initializes the cost (objective function value), nutrient content and vitality index of the current bacterial individuals, and swims according to the gradient accumulation variable step on the randomly generated direction vector. If the current solution cost is lower than that of the previous step, it will continue in a limited number of swimming times, accumulate the variable step size according to the gradient, update the current solution and accumulate the nutritional value of the current bacterial individuals. Otherwise, the swimming process of the current bacterial individuals will be stopped.

Experimental Results
In order to test whether the performance of the improved BFO algorithm proposed in this paper has obvious improvement in the accuracy, convergence speed and global optimization ability, a multimodal objective function with certain complexity was selected, and the mathematical expression of the function is as follows: Equation (7) is a binary multi-modal function with many local minimum values, but only one global minimum value. At the point (0, 0), the minimum value is 0. And the farther the local minimum is from the origin, the greater the function value is at this point, and its geometric characteristic diagram is shown in figure 3. The algorithm operator settings are shown in table 1, the result curves are shown in figures 4 and 5.

Conclusion
In order to improve the performance of BFO algorithm in multi-modal function problem, three operational steps of traditional BFO algorithm are improved and optimized in this paper. The gradient accumulation variable swimming step size in the chemotaxis operation is realized to improve the optimization speed. In order to improve the diversity of population, a new population competition mechanism is added in the reproduction operation, and a two-index sequencing is realized. In order to ensure the survival probability of high quality solution, the vitality index of bacteria is added to dynamically affect the migration probability. Finally, a complex multi-modal function is selected to test and compare with the genetic algorithm. It can be seen from the results that the improved BFO is superior to the genetic algorithm in the convergence rate of solution vectors, and the improved BFO has higher precision and less fluctuation than the genetic algorithm.