# Improvement of Dung Beetle Optimization Algorithm Application to Robot Path Planning
## 2 Related Works and Method
### Method  
Dung beetles update their positions in parallel in different ways and finally select the optimal solution. The proportions of various dung beetles in the population are 20%, 20%, 25%, and 35% [22].  
1. Rolling behavior Celestial navigation is used by dung beetles during the rolling process to keep the ball of dung rolling in a straight trajectory. The environment influences the dung beetle'srolling path, and the dung beetle's position is impacted by changes in the surrounding environment. The rolling behavior is represented by Equations (1) and (2).  
\[\left\{\begin{aligned} x_{i}(t+1)&=x_{i}(t)+\alpha \times k\times x_{i}(t-1)+b\times\Delta x\\ &\Delta x=\left|\,x_{i}(t)-X^{\alpha}\right|\end{aligned}\right. \tag{1}\]  
\[x_{i}(t+1)=x_{i}(t)+\tan(\theta)\left|\,x_{i}(t)-x_{i}(t-1)\right| \tag{2}\]  
In Equation (1), \(t\) is the current iteration number, \(x_{i}(t)\) represents the position information of the \(i\)th dung beetle at the \(t\)th iteration, \(k\) is a constant between (0,0.2), we choose \(k\) to be 0.1, \(b\) is a constant between (0.1), and we choose it to be 0.3, and \(\alpha\) is a natural coefficient of \(-1\) or 1, which represents the natural factor. When \(\alpha\) is \(-1\), it means that the dung beetle encounters obstacles in the process of moving forward, and the direction deviates. When \(\alpha\) is 1, it means that the dung beetle has no obstacles and the direction does not deviate. \(X^{W}\) is the global worst position, and \(\Delta x\) is the environmental variation.  
In Equation (2), \(x_{i}(t)-x_{i}(t-1)\) is the difference between the position of the \(i\)th dung beetle at the \(t\)th iteration and the position at the \(t-1\)st iteration. It can be seen that the position update of the rolling dung beetle is closely related to the current and historical information. If the angle is 0, \(\pi/2\), \(\pi\), then the position of the dung beetle is not updated.  
(2) Reproductive behavior  
Each female dung beetle lays only one egg at a time after deciding on a good spawning location by rolling their dung balls to a safe location and then hiding. The number of iterations dynamically modifies the spawning area, and the egg ball's position correspondingly changes, which is expressed by Equation (3).  
\[B_{i}(t+1)=X^{*}+b_{1}\times(B_{i}(t)-Lb^{*})+b_{2}\times(B_{i}(t)-Ub^{*}) \tag{3}\]  
In Equation (3), \(X^{*}\) is the current local optimal position, \(Lb^{*}\) and \(Ub^{*}\) are the lower and upper limits of the spawning area, \(B_{i}(t)\) denotes the position of the \(i\)th sphere at the \(t\)th iteration, \(b_{1}\) and \(b_{2}\) are independent random vectors of \(1\times D\), and \(D\) is the dimension of the optimization problem.  
(3) Foraging behavior  
To lead the small dung beetle to forage once the larvae hatch, the ideal foraging area must be determined. Equation (4) expresses the process.  
\[x_{i}(t+1)=x_{i}(t)+C_{1}\times\left(x_{i}(t)-Lb^{b}\right)+C_{2}\times\left( x_{i}(t)-Ub^{b}\right) \tag{4}\]  
In Equation (4), \(Lb^{b}\) and \(Ub^{b}\) are the lower and upper bounds of the optimal foraging area. \(C_{1}\) is a random number that follows a normal distribution, and \(C_{2}\) is a (0,1) random number.  
(4) Stealing behavior  
In dung beetle populations, taking food made by other dung beetles is a common competitive action. Equation (5) represents the positional update of the stealing dung insects.  
\[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) \tag{5}\]  
In Equation (5), \(X^{b}\) is the optimal food source, \(S\) is a constant, and \(g\) is a \(1\times D\) random vector obeying a normal distribution.