*3.3. The Strategy of Real-Time Optimization (RO)*

The improved algorithm based on the PPD strategy can greatly reduce the path planning time, but the number of path points still needs to be optimized. Therefore, a strategy of real-time optimization was proposed in this paper. We calculated the distance *Dnew* between the new point and the target point, and if *Dnew* can satisfy both Equations (2) and (3), the generation of the new point is considered to beneficial to the growth of the random tree. The core idea of the real-time optimization strategy is to determine whether the new point has a positive impact on the subsequent growth of the random tree immediately after the new point is generated, as shown in the process of Algorithm 3. The real-time optimization of the RO policy can effectively reduce the number of redundant points of the random tree.

**Algorithm 3.** PPRO-RRT algorithm.

a. Initialize the random tree *Pinit*.

b. Set the point *Pnew* by the exploration process of PPD-RRT algorithm.

c. Calculate the distance from the new point, the parent point and its two nearest ancestor points

to the target point according to Equation (2), respectively.

d. Determine whether the new point *Pnew* is reserved according to Equation (3), and if it is satisfied, then it is reserved.

e. Repeat the above steps b–d until the target point *Pgoal* is added to the random tree.

$$\begin{cases} \begin{array}{l} D\_{\text{ancestor1,2}} = \sqrt{\left(P\_{\text{ancestor1,2}(x)} - P\_{\text{goal}(x)}\right)^2 + \left(P\_{\text{ancestor1,2}(y)} - P\_{\text{goal}(y)}\right)^2} \\\ D\_{\text{parent}} = \sqrt{\left(P\_{\text{parent}(x)} - P\_{\text{goal}(x)}\right)^2 + \left(P\_{\text{parent}(y)} - P\_{\text{goal}(y)}\right)^2} \end{array} \tag{2}$$

$$\text{in} \left( D\_{\text{ancestor1}} > D\_{\text{new}} \right) \text{or} \left( D\_{\text{ancestor2}} > D\_{\text{new}} \right) \text{or} \left( D\_{\text{parent}} > D\_{\text{new}} \right) \tag{3}$$

The random tree expansion diagram of the improved algorithm based on the RO strategy is shown in Figure 3. Once a new point is generated, Equations (2) and (3) are used to decide the point to be left. If this new point does not contribute to the growth of the random tree, it is rejected, which avoids growing more redundant points from that point. Therefore, the number of redundant points is greatly reduced by a real-time judgment that prevents the generation of more redundant points.

**Figure 3.** Random tree expansion diagram of the improved algorithm based on the RO strategy. The red circle indicates the starting point, and the green circle indicates the target point. The black circle indicates the path point, the solid black line indicates the path, and the green dashed line indicates the distance from the point to the target point. *Pancestor*1~*Pancestor*<sup>2</sup> denote the ancestor points, *Pparent* denotes the parent point, and *Pnew* denotes the new point.

#### **4. Experiment and Analysis**

The PPD strategy can effectively reduce the path planning time, and the RO strategy can reduce the number of redundant points. In order to further evaluate the performance of the PPD-RRT algorithm and the PPRO-RRT (parent point priority determination-real-time optimization-RRT) algorithm, we will conduct simulation experiments in 3-dimensional space for the above improved algorithm and the existing improved algorithm to verify the high-dimensional reliability and efficiency of the improved algorithm in this paper.
