# Rapid Planning of an Assembly Path by Reusing the Prior Path
## 3 The Path Planning Algorithm Based on PPR
### The Optimal Path Selection Strategy  
The path obtained according to the dual-tree fusion strategy is divided into the following two segments by the connection point pair (\(x_{connect}\), \(p_{connect}\)): the prior path  
Figure 8: Selection of the prior connection node.  
Figure 10: Selection of the nearest exploring node.  
Figure 9: Discovery of the nearest exploring nodes.  
segment \(\Gamma_{prior}\) from the end node \(x_{end}\) backtracking to the connection node \(p_{connect}\) on the prior path tree \(T_{prior}\) and the exploring path segment \(\Gamma_{exploring}\) from the connection node \(x_{connect}\) backtracking to the start node \(x_{start}\) on the exploring path tree \(T_{exploring}\), as shown in Figure 11.  
As the number of sampling points increases, the cost of \(\Gamma_{exploring}\) is made asymptotically optimal by rewiring the exploring tree, and the shortest \(\Gamma_{exploring}\) can be obtained if the number of sampling points is sufficient, as shown in Figure 12.  
Since \(x_{new}\) is randomly generated in the prior space, the connection node pair (\(x_{connect}\), \(p_{connect}\)) obtained by using the dual-tree fusion strategy may be different, such as (\(x_{1}\), \(p_{1}\)), (\(x_{2}\), \(p_{2}\)), and (\(x_{i}\), \(p_{i}\)) shown in Figure 13; thus, the paths obtained according to these pairs are also different, indicated by \(\Gamma_{1}\), \(\Gamma_{2}\), and \(\Gamma_{i}\), respectively, as shown in Figure 14.  
Figure 11: \(\Gamma_{prior}\) and \(\Gamma_{exploring}\).  
Figure 12: The shortest \(\Gamma_{exploring}\).  
Figure 13: Different connection node pairs.  
Therefore, a planned path \(\Gamma_{i}\) based on reuse is expressed as \(\Gamma_{i}=\Gamma_{prior\_i}+\Gamma_{context\_i}\) + \(\Gamma_{exploring\_i}\), where \(\Gamma_{prior\_i}\) is the prior path segment from \(p_{i}\) to \(x_{end}\), \(\Gamma_{connect\_i}\) is the path segment from \(x_{i}\) to \(p_{i}\), and \(\Gamma_{exploring\_i}\) is the exploring path segment from \(x_{i}\) to \(x_{start}\), \(i=1\),..., \(m\).  
According to the composition of the path \(\Gamma_{i}\), the cost of the path \(\Gamma_{i}\) is the sum of the costs of \(\Gamma_{prior\_i}\), \(\Gamma_{connect\_i}\) and \(\Gamma_{exploring\_i}\). Since \(\Gamma_{connect\_i}\) includes only two connection points and is determined by the minimum cost strategy, the cost of \(\Gamma_{connect\_i}\) is negligible due to its small impact on the total cost. Therefore, the cost of \(\Gamma_{i}\) is simplified to the sum of the costs of \(\Gamma_{prior\_i}\) and \(\Gamma_{exploring\_i}\).  
Considering that different parts have different dependences on paths \(\Gamma_{prior}\) and \(\Gamma_{exploring}\), the weight coefficients \(\xi_{prior}\) and \(\xi_{exploring}\) are assigned to \(\Gamma_{prior}\) and \(\Gamma_{exploring}\), respectively, and \(\xi_{prior}+\xi_{exploring}=1\). With an increase in \(\xi_{prior}\), the optimal path asymptotically approaches the shortest prior path segment. With an increase in \(\xi_{exploring}\), the optimal path asymptotically approaches the shortest exploring path segment.