# An Effective Algorithm for Finding Shortest Paths in Tubular Spaces
## 5 Computational Results
### Accuracy and Smoothness  
In the following, we extend the comparison results between the two algorithms for different types of tubular spaces as shown in Table 2. Depending on the properties of the centerline, we have two main classes of the tubular spaces: in plane centerline (parabolic, elliptical, hyperbolic, sinusoidal, and evolvent of a circle); and in space centerline (wave-shaped torus on a sphere, helical, spiral, and complex shape). Each meshed disk is chosen with \(N_{\rho}=25\) and \(N_{\theta}=4\). In all these cases, the proposed algorithm always gives shorter, smoother and faster results than [PERSON]'s algorithm with the same mesh. Unlike conventional graph-based methods (e.g., [PERSON]'s searching algorithm) in which the shortest path is made up of the graph nodes, the proposed method allows finding each correct point on the ESP by determining the intersection point between the exact moving direction (line of sight) and the next cross-section. This intersection point is not necessarily a node of the mesh and leads to a smoother and shorter solution than that by [PERSON]'s algorithm. The smoothness of this path is important, especially in mechanical applications when the derivatives of the path with respect to the arc length \(s\) of the tube is required such as using the coupled Cosserat rod and string model [38] to find the deformation of a flexible tendon drive robot in the case that the tendon locates freely inside the tube [18]. \begin{table}
\begin{tabular}{l l l} \hline \hline
1. Plane Parabolic Centerline & 2. Plane Elliptical Centerline & 3. Plane Hyperbolic Centerline \\ \hline L.P = 27.22, L.D = 27.29, L.E = 27.21 (cm) & L.P = 25.70, L.D = 25.74, L.E = 25.68 (cm) & L.P = 27.97, L.D = 28.10, L.E = 27.96 (cm) \\ T.P = 0.68, T.D = 2.57 (s) & T.P = 1.02, T.D = 2.65 (s) & T.P = 0.73, T.D = 2.64 (s) \\ \hline
4. Plane Sinusoidal Centerline & 5. Plane Evolvent of a Circle & 6. Wave-Shaped Torus on a Sphere \\ \hline
7. Tubular Helical Surface & 8. Tubular Spiral Surface & 9. Complex Shape Tubular Surface \\ \hline L.P = 20.05, L.D = 20.31, L.E = 20.01 & L.P = 18.87, L.D = 19.02, L.E = 18.71 & L.P = 110.96, L.D = 111.22, L.E = 110.92 \\ T.P = 1.00 (s), T.D = 2.74 & T.P = 1.17 (s), T.D = 2.88 & T.P = 5.90 (s), T.D = 11.29 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Compare the proposed method and [PERSON]’s method with many tubular surfaces. In addition to the length and the smoothness of the obtained ESP, its location inside the tube is also very important. For example, in the mechanical problem just mentioned above, the tendon location is directly related to the deformation direction of the tube. Thus, the position error of the obtained ESP to the exact solution needs to be investigated. We consider the ESPs given by [PERSON]'s and the proposed algorithms to be a series of points located on the cross-sections of the tube. Then, the position error of each point is the distance between itself and the exact solution within the containing cross-section. Let \(\epsilon_{i}^{D}\) and \(\epsilon_{i}^{p}\) be the position errors within cross-section \(S_{i}\) of the solution by [PERSON]'s algorithm and by the proposed method, respectively. In this test, we expect to consider the relative errors instead of the absolute ones. As the obtained paths must be inside the tubular space, to limit the relative errors by 100%, we compare the absolute position error to the inner diameter of the tube \(d\). The root mean square error (\(RMSE\)) and the maximum error (\(E_{max}\)) of [PERSON]'s solution are given in Equations (5) and (6) (the same for the proposed method just by replacing super index \(D\) by \(P\)):  
\[RMSE^{D} =\frac{1}{d}\sqrt{\frac{1}{N}\sum_{i=1}^{N}\left(\epsilon_{i}^{D} \right)^{2}} \tag{5}\] \[E_{max}^{D} =\min_{i\in\{1,\ldots,N\}}\left(\frac{\epsilon_{i}^{D}}{d}\right) \tag{6}\]  
Here, we do not consider the two ending cross-sections (\(S_{0}\) and \(S_{N+1}\)) as the position error is obviously zero at the source and the destination.