# Path Planning of Unmanned Surface Vehicle Based on Improved Sparrow Search Algorithm

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

_{i,j}is the position information of the first sparrow population in the first dimension, $\alpha \in rand(0,1)$, iter

_{max}is the maximum number of iterations, R is a random number obeying a normal distribution, $\mathit{\lambda}$ is a 1 × d matrix with all elements equal to 1, d is the dimension of the unmanned boat path planning problem, ${R}_{2}\in (0,1)$ is the warning value of the sparrow population position, and ${s}_{f}\in (0.5,1)$ is the safety value of the sparrow population position.

_{p}is the optimal population position, X

_{worst}is the worst population position, A is 1 × d matrix, each matrix cell is random-1 or 1, and

**A**

^{+}=

**A**

^{T}(

**AA**

^{T})

^{−1}. When $i>n/2$, the i-th follower cannot find sustenance and must seek it elsewhere by flying. The function of scouts in sparrow populations is to be aware of danger and lead the population to a secure area, accounting for 10–20% of the total population. The iterative formula for generating the random locations of spies within the population is shown in the following equation.

_{best}is the current global optimal position, β is a step control parameter that follows the standard normal distribution, $k\in [-1,1]$ indicates the direction of individual movement, f

_{i}is the current sparrow fitness value, f

_{g}is the global optimal fitness value, f

_{w}is the global worst fitness value, and $\xi $ is a constant to prevent the denominator from being zero. ${f}_{i}>{f}_{g}$ demonstrates that the sparrow is at the edge of the population and vulnerable to external attack; ${f}_{i}\le {f}_{g}$ demonstrates that the scout is aware of the threat and must abandon the current location.

## 2. Improved Sparrow Search Algorithm

#### 2.1. Cubic Chaotic Map

_{n}< 1, c

_{n}≠ 0, n = 0,1,2, …, n; $\rho $ is a control parameter. To analyse the effect of the value of $\rho $ taking on the chaotic value c

_{n}, the simulation is conducted, and the empirical initial value c

_{0}= 0.315 with a step size of 0.01 is used to acquire the chaotic results shown in Figure 1.

_{n}has a reasonable random distribution effect, taking the extreme value $\rho $=2.595, 0 < c

_{n}< 1, and the number of iterations is 2000; Figure 2 displays the results of the sequence distribution of cubic chaotic mapping. Figure 2 demonstrates that the cubic chaotic mapping possesses excellent uniform distribution characteristics.

_{d}before applying Equation (5) to map C

_{d}to individual sparrows:

_{d}and min

_{d}are the maximum and minimum values of dth dimensional variable ${X}_{d}^{\mathrm{new}}$. The results of ${X}_{d}^{\mathrm{new}}$ obtained from cubic chaotic mapping are used as the initial population sequence of the sparrow search algorithm, which improves the initial global search capability of the algorithm.

#### 2.2. Gaussian Random Wandering Strategy

_{a}is the mean of the overall fitness of the sparrow population, f is the control parameter of the standard deviation $\sigma $, and the value of f is as follows:

^{−3}, the population is considered to have fallen into a local optimum during the iterative process. The Gaussian random walk strategy is then used to perturb the best individual of fitness f

_{i}in the sparrow population in order to help the algorithm jump out of the local optimum. The equation for the generation of new sparrow individuals is shown in the following equation:

_{max}is the maximum number of iterations and uses the property that the convex function decreases in the first quadrant: as the number of iterations t increases, the perturbation is gradually reduced. The coarse search and fine search capabilities of the algorithm are balanced.

#### 2.3. Improved Sparrow Search Algorithm Implementation Process

Algorithm 1 Modified Sparrow Algorithm |

int main(void) { %cubic chaotic map initializes N sparrows and their related parameters; N,iter _{max},d,X_{i,j}$,{\mathrm{s}}_{\mathrm{f}},\mathrm{A},\beta $$,\xi $,f_{w},…do (set the basic parameters to be determined) While(when the maximum number of iterations is not exceeded iter _{max})calculate Formulas (1)–(3) and (8); % Calculate and sort fitness values to identify the current best and worst individuals If(calculate Formulas (6) and (7), the standard deviation is less than the specified value 10 ^{−3}?){ % decide to fall into local optima use gaussian walk strategy to perturb the optimal individual; calculate Formula (8) to obtain the perturbed new sparrow population ${X}_{i}^{t+1}$; } else { calculate Formula (1) to obtain the location of the sparrow-finder population; calculate Formula (2) to obtain the location of the sparrow-follower population; calculate Formula (3) to obtain the location of the sparrow-scouter population; } while(when the maximum number of iterations is exceeded iter _{max})output the optimal individual X _{best}, the optimal fitness f_{g};return 0; } |

#### 2.4. Kinematic Physical Model of USV

## 3. Environment Modelling

#### 3.1. Preprocessing of Navigational Information

#### 3.2. Grid Method and Obstacle Swelling Treatment

## 4. Experimental Simulation and Evaluation

## 5. Conclusions

- By optimising the algorithm in the population initialisation stage of the traditional sparrow search algorithm, the global search ability can be improved and the Gaussian random walk strategy can avoid the algorithm falling into the local optimal;
- Compared with the traditional algorithm, the total path planning time of the optimised sparrow search algorithm is increased by about 10% but the optimal fitness value is reduced by 10.13%, which slightly improves the adaptability of the algorithm;
- The improved sparrow search algorithm can reduce the inflection point of the track, which is very good for the driving habits of the real ship. The intelligent ship can reduce the use of the rudder and have a good energy-saving effect, so this part is worth applying and recommending;
- Compared with the results of mean variance, the robustness of the algorithm is improved and the routes obtained are more stable.

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Li, S.Y. Start a New Voyage and Create a New Future for Shipping; China Communications Press: Beijing, China, 2021. [Google Scholar]
- Yu, Y.L.; Su, R.B.; Feng, X. Tracking control of backstepping adaptive path of unmanned surface vessels based on surge-varying LOS. Chin. J. Ship Res.
**2019**, 14, 163–171. [Google Scholar] - Hossain, M.A.; Ferdous, I. Autonomous robot path planning in dynamic environment using a new optimization technique inspired by bacterial foraging technique. Robot. Auton. Syst.
**2015**, 64, 136–141. [Google Scholar] [CrossRef] - Polvara, R.; Sharma, S.; Wan, J.; Manning, A.; Sutton, R. Obstacle avoidance approaches for autonomous navigation of unmanned surface vehicles. J. Navig.
**2018**, 71, 240–256. [Google Scholar] [CrossRef] - Gao, F.; Zhou, H.; Yang, Z.Y. Global path planning of surface unmanned ship based on improved A* algorithm. Appl. Res. Comput.
**2020**, 37, 125. [Google Scholar] - Zhang, Q.; Tian, T.; Luan, T.Y. Research on path planning of unmanned boat routes based on improved artificial potential field algorithm. Ship Sci. Technol.
**2022**, 44, 78. [Google Scholar] - Guo, R.X. Research on the Path Planning for USV Based on Reinforcement Learning. Ph.D. Thesis, Harbin Engineering University, Harbin, China, 2020. [Google Scholar]
- Wang, C.; Ren, J.; Zhang, Y. Unmanned surface vessel path planning based on improved ant colony algorithm. Nat. Sci. J. Hainan Univ.
**2021**, 39, 242–250. [Google Scholar] - Liu, C.A.; Wang, X.P.; Liu, C.Y. Three-dimensional route planning for unmanned aerial vehicle based on improved grey wolf optimizer algotithm. Huazhong Univ. Sci. Tech. Nat. Sci. Ed.
**2017**, 45, 38–42. [Google Scholar] - Wang, S.R. Research on Stanley Algorithm Based on Improved Whale Optimization Algorithm. Ph.D. Thesis, Jilin University, Changchun, China, 2022. [Google Scholar]
- Liu, J.H.; Yang, J.G.; Liu, H.P.; Tian, X.; Gao, M. An improved ant colony algorithm for robot path planning. Soft Comput.
**2017**, 21, 5829–5839. [Google Scholar] [CrossRef] - Xue, J.K.; Shen, B. A novel swarm intelligence optimization approach: Sparrow search algorithm. Syst. Sci. Control. Eng.
**2020**, 8, 22–34. [Google Scholar] [CrossRef] - Lyu, X.; Mu, X.D.; Zhang, J.; Zhen, W. Chaos sparrow search optimization algorithm. J. Beijing Univ. Aeronaut. Astronaut.
**2021**, 47, 1712–1720. [Google Scholar] - Ouyang, C.T.; Zhu, D.L.; Wang, F.Q. UAV path planning based on refracted sparrow search algorithm. Electron. Opt. Control.
**2022**, 29, 25–31. [Google Scholar] - Ge, C.; Qian, S.Q. Path planning of unmanned vehicle based on improved sparrow search algorithm. J. Navig. Position.
**2022**, 1–5. [Google Scholar] - Li, P.; Chen, S.J.; Yang, S.S. Otsu image segmentation method optimized by fruit fly optimization algorithm based on Logistic mapping. Foreign Electron. Meas. Technol.
**2022**, 41, 9–17. [Google Scholar] - Li, Q.F.; Yuan, Z.J.; Tang, G.Y. Map environment modeling and path planning of unmanned boats. In Proceedings of the 2021 Academic Conference of Test Technology Group, Ship Mechanics Academic Committee, Kunming, China, 11–24 October 2021; pp. 490–496. [Google Scholar]
- Li, P.; Ding, Q.W. OSTU segmentation algorithm based on sparrow algorithm optimization. Electron. Meas. Technol.
**2021**, 44, 148–154. (In Chinese) [Google Scholar]

**Figure 4.**ENC chart of Zhenjiang port–Yangzhou port (Green is the water area, purple is the dotted line area is the channel).

**Figure 7.**Grid method and obstacle swelling treatment. (

**a**) Grid environment; (

**b**) Obstacles schematic; (

**c**) Swelling treatment.

**Figure 10.**Both algorithms result in a grid environment. (

**a**) Result of traditional algorithm; (

**b**) Particle swarm search algorithm results; (

**c**) Improved algorithm result.

Parameters | Value |
---|---|

Number of populations N | 100 |

Number of iterations iter_{max} | 500 |

Warning value R_{2} | 0.8 |

Percentage of discoverers | 0.3 |

Percentage of followers | 0.2 |

Proportion of scouts | 0.15 |

Solution space dimension | 20 |

Parameters | Value |
---|---|

Number of populations N | 100 |

Number of iterations iter_{max} | 500 |

$\mathrm{Learning}\mathrm{factor}{c}_{1}$ | 2.5 |

$\mathrm{Learning}\mathrm{factor}{c}_{2}$ | 2.5 |

Inertia weights | 1 |

Path Metrics | Particle Swarm Search Algorithm | Traditional Sparrow Search Algorithm | Improved Sparrow Search Algorithm |
---|---|---|---|

Optimum fitness value | 33.68 | 33.17 | 29.81 |

Number of Turns | 11 | 10 | 3 |

Mean value | 35.96 | 35.34 | 30.11 |

Mean time | 0.60 | 0.67 | 0.94 |

Variance | 17.03 | 18.62 | 9.33 |

Parameter | Value | Parameter | Value |
---|---|---|---|

length/M | 2.5 | Propulsion mode | Two engines and two OARS |

width/M | 1.5 | speed/KN | 6 |

Mean value | 0.6 | Unilateral propulsion power/W | 750 |

Connecting steel frame length/M | 1.6 | Garbage full load capacity/L | 50 |

Connecting steel frame width/M | 0.7 | Maximum total displacement/KG | 400 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Liu, G.; Zhang, S.; Ma, G.; Pan, Y.
Path Planning of Unmanned Surface Vehicle Based on Improved Sparrow Search Algorithm. *J. Mar. Sci. Eng.* **2023**, *11*, 2292.
https://doi.org/10.3390/jmse11122292

**AMA Style**

Liu G, Zhang S, Ma G, Pan Y.
Path Planning of Unmanned Surface Vehicle Based on Improved Sparrow Search Algorithm. *Journal of Marine Science and Engineering*. 2023; 11(12):2292.
https://doi.org/10.3390/jmse11122292

**Chicago/Turabian Style**

Liu, Guangzhong, Sheng Zhang, Guojie Ma, and Yipeng Pan.
2023. "Path Planning of Unmanned Surface Vehicle Based on Improved Sparrow Search Algorithm" *Journal of Marine Science and Engineering* 11, no. 12: 2292.
https://doi.org/10.3390/jmse11122292