## 4 Beetle Swarm Optimization (BSO) Method
### Standard Beetle Antennae Search (BAS) Algorithm  
The standard beetle antennae search (BAS) algorithm belongs to a kind of heuristic optimization technique that runs with a high efficiency and a low complexity by simulating the beetle's movement to find the food in nature step by step, which is quite similar to the particle swarm optimization (PSO), genetic algorithm (GA), and firefly algorithm (FA). After several rounds of moves, the beetle in BAS can locate the global optimum solutions for a very complicated problem. This is now widely used in optimization fields.  
There are two main stages in the current standard BAS algorithm. The first is the search stage, and the other is the detection stage. There is only one beetle in the standard BAS. Every time this beetle moves in a random direction, it is correspondingly defined as the search stage. Subsequently, in order to simulate the randomness of this beetle's movement in the search stage, a random unit vector \(\overrightarrow{\mathbf{b}}\in\mathbf{R}^{N}\) is formulated to describe the beetle's random moving direction. With this assumption, the position coordinates of this beetle's right antennae and left antennae in the search space, which are denoted as \(x_{R}\) and \(x_{L}\), respectively, can be calculated using Equation (8).  
\[\left\{\begin{array}{l}x_{R}=x^{k}-\frac{d_{0}}{2}\cdot\overset{\rightarrow}{ \mathbf{b}}\\ x_{L}=x^{k}+\frac{d_{0}}{2}\cdot\overset{\rightarrow}{\mathbf{b}}\end{array}\right. \tag{8}\]  
In Equation (8), \(k\) means the \(k\)th move of the beetle during the search process. \(x^{k}\) is the centroid of the beetle's current position in the \(k\)th move. \(d_{0}\) is the distance between the beetle's right antennae and the left antennae, which also represents the beetle's search area. The value of \(d_{0}\) is only decided by the size of the beetle; namely, a bigger beetle means a larger \(d_{0}\). Actually, it highly depends on the scale of a specific optimization problem.  
Once the beetle's search stage is finished, the detection stage starts, which can be performed using Equation (9). There is no doubt that the position of the \(k\)th move is related to (\(k-1\))th position. \(Step^{k}\) is the step size in the \(k\)th move, which could be set as a constant or a variable. \(sign(x)\) is a sign function which can only give two results, namely \(1\) and \(-1\). The value of \(1\) or \(-1\) is only determined by the plus or minus of the independent variable \(x\).  
\[x^{k}=x^{k-1}-Step^{k}\cdot\overset{\rightarrow}{\mathbf{b}}\cdot sign(f(x_{ L})-f(x_{R})) \tag{9}\]  
\(f(x)\) is a defined cost function that can also be set as the objective function. Only the beetle positions introduce less cost that can be saved during each move. \(f(x_{R})\) and \(f(x_{L})\) are the cost of the right antennae and left antennae, respectively. Repeatedly, by several moves, the optimum positions with the least cost can be finally obtained.  
However, the convergence of the standard BAS is highly dependent on the beetle's random direction in every move, which can easily lead to a local optimum instead of the global best solutions. Also, the step size of the beetle's move cannot guarantee that the current objective value is better than the previous one in the iterative process.