# Dynamic Heterogeneous Search-Mutation Structure-Based Equilibrium Optimizer
## 5 DHSMEO for UAV Mountain Path-Planning Problem
### DHSMEO-Based UAV Mountain Path-Planning Method  
To handle the UAV mountain path-planning issue described by Section 5.1, as well as, ulteriorly, evaluating the practicality for DHSMEO, this subsection proposes a UAV mountain path-planning method that integrates a quasi-uniform cubic B-spline curve with DHSMEO.  
A smooth path facilitates stable UAV flight. To meet this requirement, the B-spline curve method is adopted in constructing the smooth path of UAV [38]. The coordinates\((\mathbf{Q}x(t),\mathbf{Q}y(t),\mathbf{Q}_{z}(t))\) of a UAV path in three-dimensional space generated via the B-spline curve method are calculated as follows:  
\[\left\{\begin{aligned} \mathbf{Q}_{x}(t)&=\sum_{h=0}^{H}\mathbf{x}_{ h}B_{h,M}(t),\\ \mathbf{Q}_{y}(t)&=\sum_{h=0}^{H}\mathbf{y}_{h}B_{h,M}(t),\\ \mathbf{Q}_{z}(t)&=\sum_{h=0}^{H}\mathbf{z}_{h}B_{h,M}(t), \end{aligned}\right. \tag{28}\]  
where the following applies: \((x_{h},y_{h},\mathbf{z}_{h})\) represents the coordinates of the \((h+1)\)th control point of the B-spline curve; \(M\) is the order of the B-spline curve; and \(B_{h,M}(t)\) is the B-spline basis function, which is defined by the following recursive formulas:  
\[\left\{\begin{aligned} & B_{h,M}(t)=\left\{\begin{array}{ll}1,t_{h} \leq t<t_{h+1},& M=1,\\ 0,&\text{otherwise}\;,\end{array}\right.\\ & B_{h,M}(t)=\frac{t-t_{h}}{t_{h+1}-t_{h}}B_{h,M-1}(t)+\frac{t_{h+M}-t}{t_{h +M}-t_{h+1}}B_{h+1,M-1}(t),M\geq 2,\\ &\text{definition }\frac{0}{0}=0,\end{aligned}\right. \tag{29}\]  
where \(t_{h}\) varies within the range \([t_{0},t_{1},\cdots,t_{H+M}]\), whose values needs to satisfy \(t_{0}\leq t_{1}\leq\cdots\leq t_{H+M}\). Among different configurations of B-spline curves, the quasi-uniform cubic B-spline curve efficiently forms the smooth path by determining a small number of control points. It ensures that the obtained path crosses the starting and ending control points, and it allows for local modifications by adjusting the control points.  
In sum, the specific steps involved in handling the UAV mountain path-planning issue using DHSMEO combined with the quasi-uniform cubic B-spline method are shown below:  
**Step 1**. Initialize the three-dimensional mountain map \(Map\) according to Equation (23).  
**Step 2**. Initialize the path order, \(M\), the number of control points, \(H+1\), the starting position \((x_{0},y_{0},z_{0})\), and the ending position \((x_{H},y_{H},\mathbf{z}_{H})\), along with other elements related to the UAV mountain path-planning problem.  
**Step 3**. Initialize the current iteration number, \(l\), the maximum iteration number, \(l_{\text{max}}\), the particle size, \(N\), the particle dimension, \(H+1\) (determined by the number of control points), and other related parameters required for DHSMEO.  
**Step 4**. Construct the fitness function for DHSMEO in accordance with Equation (25).  
**Step 5**. Determine control points of three-dimensional quasi-uniform cubic B-spline curve except the starting position and ending position using the concentration initialization strategy in DHSMEO, and form initial path via fitting the control points of three-dimensional quasi-uniform cubic B-spline curve.  
**Step 6**. Optimize the control points from three-dimensional quasi-uniform cubic B-spline curve except the starting position and ending position in the generated path using DHSMEO to search the minimum-distance path connecting the starting position and ending position in a three-dimensional mountain map \(Map\).  
**Step 7**. Repeat **Step 6** until the preset termination condition of DHSMEO is satisfied.  
**Step 8**. Return the best path connecting the starting position and ending position.