Dung beetle algorithm (principle)

Original text (with document download)

1 Swarm intelligence optimization algorithm

SI(swarm intelligence)Systems are characterized by interactions between individuals that promote the emergence of intelligent behavior.

SIThe implementation of the optimization process mainly includes the following two steps:

  • Create a set of random individuals within the search space
  • Combine, move, or evolve these random individuals in an iterative process .

Each optimization algorithm differs in how new strategies (especially combinations, moves, or evolutions) are designed during the optimization process, such as:

  • Particle swarm optimization algorithm : During the evolution process, the position of each individual can gradually converge to the global optimal solution, which mainly depends on the following two important positions: 1) One is the optimal position of each individual, 2) The other is The global optimal position of the entire population.
  • Ant colony optimization (ACO) algorithm : In the algorithm, the path of each ant represents a feasible solution, and the paths of all ants constitute the solution space. The choice of pheromone is crucial for the ant colony to search for the global optimal path in the entire optimization problem space. In this case, the shortest path is obtained in the direction with stronger pheromone levels.

In addition to studying the relationship between groups and individuals, Xin SIalso studied the habits of living things. like:

  • Gray Wolf Optimization (GWO) algorithm : This algorithm simulates the leadership levels (including alpha, beta, delta and omega) and hunting behavior of gray wolves. The hunting mechanism of the GWO algorithm mainly includes searching, surrounding and attacking prey.
  • Whale Optimization Algorithm (WOA) : For the first time, a bubble net hunting strategy that imitates the social behavior of humpback whales was proposed.

In addition to the algorithms introduced above, there are many algorithms, and they are all applied in practice, but based on this No Free Lunch (NFL)定理, we know that no algorithm can handle all optimization problems.

In other words, the optimization performance of an algorithm may perform well in one set of problems and perform poorly in another set of problems.

Therefore, the NFL theorem encourages the search and development of more optimizers with satisfactory performance. On the basis of the above discussion, the author proposes a new SIoptimization technology based on - 蜣螂算法(Dung beetle optimizer,DBO), aiming to provide a more efficient optimizer for complex optimization problems.

2. Life habits of dung beetles

Dung beetles feed on animal feces . Research shows that dung beetles have an interesting habit of beating their feces into balls and rolling them out , as shown in the picture.

Rolling ball

roll back

They move their dung balls as quickly and efficiently as possible, which prevents them from competing with other dung beetles (stealing) .

Stealing/competing

Dung beetles, on the other hand, use celestial cues (especially the sun, moon, and polarized light) to navigate , causing their dung balls to roll in straight lines . If there is no light source at all (that is, complete darkness), the beetle's path is no longer straight, but curved , sometimes even slightly circular .

Some natural factors (such as wind and uneven ground) can also cause dung beetles to deviate from their original direction. In addition, the dung beetle is likely to encounter obstacles during the rolling process and be unable to move forward. In this regard, dung beetles typically climb onto balls of dung and dance (consisting of a series of spins and pauses ), which determines their direction of movement .

Dance (twirling and pausing)

Another interesting behavior of dung beetles is that the dung balls they acquire serve two main purposes :

  • Some dung balls are used to lay eggs and raise the next generation
  • The rest is used as food .

Specifically, dung beetles bury dung balls , and the female dung beetles lay eggs in these dung balls .

bury the ball

Reproduction (laying eggs)

Reproduction (nurturing)

Fecal balls are not only a place for the development of larvae, but also provide the larvae with the food necessary for life. Therefore, dung balls play an irreplaceable role in the survival of dung beetles.

A DBO algorithm is proposed based on the dung beetle's rolling, dancing, foraging, stealing and breeding behaviors.

3 Mathematical model

1) Simulate rolling ball behavior

Based on the discussion above, we know that dung beetles need celestial cues to navigate during their rolling process to keep their dung balls rolling in a straight line .

To simulate the behavior of a rolling ball, the dung beetle needs to move in a given direction throughout the search space .

The movement trajectory of the dung beetle is shown in the figure. In this image, a dung beetle can be seen using the sun to navigate , with the red arrow indicating the direction of roll .

Movement trajectory

In this article, it is assumed that the intensity of the light source also affects the dung beetle's path . During the rolling process, the position of the rolling dung beetle is updated , which can be expressed as:

x i ( t + 1 ) = x i ( t ) + α × k × x i ( t − 1 ) + b × Δ x , ( 式 1 ) Δ x = ∣ x i ( t ) − X w ∣ \begin{aligned} x_{i}(t+1) & =x_{i}(t)+\alpha \times k \times x_{i}(t-1)+b \times \Delta x, \quad (式1)\\ \\ \Delta x & =\left|x_{i}(t)-X^{w}\right| \end{aligned} xi(t+1)Δ x=xi(t)+a×k×xi(t1)+b×Δ x ,( Formula 1 )=xi(t)Xw

In the formula:

  • tRepresents the current number of iterations
  • x i ( t ) x_{i}(t) xi( t ) representsthe position informationithe dung beetle at the firsttiteration
  • k∈(0,0.2)Represents a constant value , representing the defect coefficient
  • bRepresents a constant value(0,1) belonging to
  • a \alphaα isthe natural coefficientof-1or1
  • X w X^{w} Xw representsthe global worst position
  • Δ x \Delta xΔx is used to simulatechangesinlight intensity

(k和b)It is crucial to choose appropriate values ​​for the two parameters , k和bwhich are set to respectively in this article 0.1和0.3.

a \alphaα means that manynatural factors(such as wind and uneven ground) can cause dung beetles to deviate from their original direction. Among them,α \alphaα = 1 meansno bias,α \alphaα =−1 indicatesdeviation from the original direction.

In order to simulate the complex environment in the real world, this paper uses the probability method to convert α \alphaα is set to 1 or -1.

Likewise, Δ x \Delta xThe higher the Δx value,the weaker the light source. It has the following two advantages:

  • Explore the entire problem space as thoroughly as possible during optimization
  • Pursue stronger search performance and reduce the possibility of falling into local optimality .

Therefore, X w X^{w}Xw is more suitable for controllingΔ x \Delta xΔx value to expand the search range .

When a dung beetle encounters an obstacle and cannot move forward , it needs to reposition itself through dance to obtain a new route.

2) Simulate dancing behavior

To simulate dancing behavior, we use the tangent function to get the new scroll direction .

We only need to consider the interval [0, π] [0, \pi]The value of the tangent function defined on [ 0 , π ] , as shown.

Once the dung beetle successfully determines a new direction , it should continue rolling the ball backwards . Therefore, the location of the Rolling Ball Dung Beetle is updated and defined as follows:

x i ( t + 1 ) = x i ( t ) + tan ⁡ ( θ ) ∣ x i ( t ) − x i ( t − 1 ) ∣ ( 式 2 ) x_{i}(t+1)=x_{i}(t)+\tan (\theta)\left|x_{i}(t)-x_{i}(t-1)\right| \quad (式2) xi(t+1)=xi(t)+tan ( θ )xi(t)xi(t1)( Formula 2 )

  • θ ∈ [ 0 , π ] \theta\in[0,\pi]i[ 0 , π ] : Deflection angle.
  • ∣ x i ( t ) − x i ( t − 1 ) ∣ \left|x_{i}(t)-x_{i}(t-1)\right| xi(t)xi(t1 ) :The difference betweenithe dung beetle in the firsttiteration andt - 1in the second iteration. Therefore, the location updates of the Rolling Ball Dung Beetle are closely related to current and historical information.

If θ \thetaθ is equal to 0,θ / 2 \theta/2θ / 2θ \thetaθ , the dung beetle's position will not be updated.

The dung beetle will roll the dung ball to a safe place and hide the ball (see picture below). In order to provide a safe environment for their offspring , it is crucial for dung beetles to choose a suitable place to lay their eggs.

3) Simulate spawning behavior

Inspired by the above discussion, a boundary selection strategy is proposed to simulate the area where female dung beetles lay eggs, which is defined as:

L b ∗ = max ⁡ ( X ∗ × ( 1 − R ) , L b ) , U b ∗ = min ⁡ ( X ∗ × ( 1 + R ) , U b ) ( 式 3 ) \begin{array}{l} L b^{*}=\max \left(X^{*} \times(1-R), L b\right), \\ \\ U b^{*}=\min \left(X^{*} \times(1+R), U b\right) \end{array}\quad (式3) Lb=max(X×(1R),Lb),Ub=min(X×(1+R),Ub)( Formula 3 )

  • X ∗ X^{*} X representsthe current local best position
  • L b ∗ L b^{*} Lb sumU b ∗ U b^{*}Ub representsthe lower limit and upper limit of the spawning area
  • R = 1 − t / T m a x R = 1−t/T_{max} R=1t/Tmax T m a x T_{max} TmaxRepresents the maximum number of iterations
  • L b Lb L bU b UbU b representsthe lower bound and upper bound

As shown in the figure, the current local best position X ∗ X^{*}X is represented by abig brown circle, whileX ∗ X^{*}XThe small black circlearound indicatesthe ovule. Each egg ball contains a dung beetle egg. The small red circlesrepresentthe upper and lower boundaries.

spawning area

Once the egg-laying area is determined, the female dung beetle will select the egg balls in this area to lay eggs. For the DBO algorithm, each female dung beetle only lays one egg in each iteration .

It can be clearly seen from (3) that the boundary range of the spawning area changes dynamically and is mainly Rdetermined by the value.

Therefore, the position of the nest ball is also dynamic during the iteration process :

B i ( t + 1 ) = X ∗ + b 1 × ( B i ( t ) − L b ∗ ) + b 2 × ( B i ( t ) − U b ∗ ) ( 式 4 ) B_{i}(t+1)=X^{*}+b_{1} \times\left(B_{i}(t)-L b^{*}\right)+b_{2} \times\left(B_{i}(t)-U b^{*}\right) \quad (式4) Bi(t+1)=X+b1×(Bi(t)Lb)+b2×(Bi(t)Ub)( Formula 4 )

  • B i ( t ) B_{i}(t) Bi( t ) isthe position informationithe th ball at the firstt iteration
  • b 1 b_1 b1and b 2 b_2b2are two independent random vectors1 × D of size
  • Dis the dimension of the optimization problem

Note that the position of the nest ball is strictly limited to a certain range , that is, the spawning area.

4) Simulate foraging behavior

Some adult dung beetles emerge from the ground to feed. This article calls it the little dung beetle . In addition, optimal feeding areas need to be established to guide the beetles to feed, as shown in the image below.

The boundaries of the optimal foraging area are defined as follows:

L b b = max ⁡ ( X b × ( 1 − R ) , L b ) U b b = min ⁡ ( X b × ( 1 + R ) , U b ) ( 式 5 ) \begin{array}{l} L b^{b}=\max \left(X^{b} \times(1-R), L b\right) \\ \\ U b^{b}=\min \left(X^{b} \times(1+R), U b\right) \end{array} \quad (式5) Lbb=max(Xb×(1R),Lb)Ubb=min(Xb×(1+R),Ub)( Formula 5 )

  • X b X^{b} Xb isthe global best position
  • L b Lb L bU b UbU b are the lower and upper boundsof the optimal foraging area respectively, and other parameters are defined in(3).

Therefore, the position of the little dung beetle is updated as follows:

x i ( t + 1 ) = x i ( t ) + C 1 × ( x i ( t ) − L b b ) + C 2 × ( x i ( t ) − U b b ) ( 式 6 ) x_{i}(t+1)=x_{i}(t)+C_{1} \times\left(x_{i}(t)-L b^{b}\right)+C_{2} \times\left(x_{i}(t)-U b^{b}\right) \quad (式6) xi(t+1)=xi(t)+C1×(xi(t)Lbb)+C2×(xi(t)Ubb)( Formula 6 )

  • x i ( t ) x_{i}(t) xi( t ) isthe position informationithe dung beetle in the firsttiteration
  • C 1 C_1 C1is a random number that obeys a normal distribution
  • C 2 C_2 C2is a random vector(0,1) belonging to

5) Simulate theft

Some dung beetles, known as thieves , steal dung balls from other dung beetles (see photo below), which it should be noted is a very common phenomenon in nature.

In addition, it can be seen from (5) that X b X^{b}Xb isthe best food source. Therefore, it can be assumed thatX b X^{b}XNear b is the bestplace to compete for food. During the iteration,the thief's location information is updated:

x i ( t + 1 ) = X b + S × g × ( ∣ x i ( t ) − X ∗ ∣ + ∣ x i ( t ) − X b ∣ ) x_{i}(t+1)=X^{b}+S \times g \times\left(\left|x_{i}(t)-X^{*}\right|+\left|x_{i}(t)-X^{b}\right|\right) xi(t+1)=Xb+S×g×(xi(t)X+xi(t)Xb)

  • x i ( t ) x_{i}(t) xi( t ) isthe xi (t) x_{i}(t)i ththiefat thetiterationxi(t)
  • g is a random vector1 × D of size obeying the normal distribution ,
  • Sis a constant value

4 Algorithm framework

Based on the above discussion, the pseudo code of the DBO algorithm proposed in this article is as follows.

  • First, let T max T_{max}Tmaxis the maximum number of iterations , NNN isthe overall size.
  • Then all agents of the DBO algorithm are randomly initialized , and their distribution settings are as shown in the figure below.

In this graphic, the number of small rectangles represents the overall size . Assume that the overall size is 30 : the blue, yellow, green and red rectangles represent the rolling dung beetle, the nest ball, the little dung beetle and the thief respectively.

  • After that, according to steps 2-27 , it is known that the rolling ball dung beetle, nest ball, little dung beetle and thief are constantly updated during the optimization process.
  • Finally output the best position X b X^{b}Xb and its fitness value.

To sum up, for any optimization problem, the DBO algorithm, as a new SIoptimization technology based on DBO, has six main steps, which can be summarized as:

  1. Initialize the dung beetle group and DBO algorithm parameters
  2. Calculate the fitness value of each agent according to the objective function
  3. Update the locations of all dung beetles
  4. Determine whether each agent is out of bounds
  5. Update the current optimal solution and its fitness value
  6. Repeat the above steps until tthe termination criterion is met, and the global optimal solution and its fitness value are output.

5 Summary

The DBO algorithm was compared with seven other optimization techniques in terms of convergence speed, solution accuracy, and stability, showing competitive search performance.

Theoretically, the reasons why the DBO algorithm is more competitive than other algorithms in exploration or development have the following characteristics:

  1. A new rolling ball dung beetle search mechanism is proposed . Different search modes allow us to: A) use information from different time periods to thoroughly explore the search space; b) pursue stronger search capabilities to avoid falling into local Optimal.
  2. The R parameter has the characteristics of dynamic change , which can further stimulate the exploration and development status of the DBO algorithm.
  3. Different area search strategies (including spawning areas and optimal foraging areas) can promote the utilization behavior of the DBO algorithm.
  4. Different update rules can ensure that the developed DBO algorithm maintains a sufficient balance between local and global search capabilities.

matlab code:

https://www.mathworks.com/matlabcentral/fileexchange/121278-dung-beetle-optimizer-dbo

参考:
Xue, J., Shen, B. Dung beetle optimizer: a new meta-heuristic algorithm for global optimization. J Supercomput (2022). https://doi.org/10.1007/s11227-022-04959-6.

Guess you like

Origin blog.csdn.net/mengjizhiyou/article/details/128266805