An Effective Algorithm for Finding Shortest Paths in Tubular Spaces

: We propose a novel algorithm for Euclidean shortest path (ESP) from a given point (source)


Introduction
Finding the shortest path in the presence of obstacles, referred to as the Euclidean shortest path problem is one of the fundamental problems in path planning [1].This problem arises in many industrial c1 applications.c2 c3 The idea of using a flying robot such as an unmanned aerial vehicle (UAV) to navigate through a tunnel-like environment can be found in the inspection of dam penstocks, [2][3][4], chimneys [5], ventilation systems [6], onshore oil and gas industry [7], narrow sewers [8], and other hazardous deep tunnels [9,10].In addition, many marine applications also require navigating through underwater tunnel-like environments with autonomous underwater vehicles (AUVs).For instance, the inspection of different kinds of underwater structures such as offshore oil platforms [11], flooded spring tunnels [12,13], water delivery tunnels [14], etc.In these applications, shortest path planning that minimizes the total distance travelled by the vehicles plays an important role in optimizing the energy consumption, thus extending the operation time without recharging their batteries [15,16].It may also reduce the travelling time and will be very useful for search & rescue missions during disaster events in underground tunnels [17,18].c4 Another example of the studied problem is to determine the location of a non-elastic chord between to points within a tube.Indeed, this problem can be found in controlling the deformation of slender tube-like robots actuated with an internal tendon(s) [19,20].Calculating the tendon load effect on the tube wall requires determining the tendon location.As it is only attached at the tip, pre-positioned at the base, and the rest freely locates inside c1 Removed text: and medical c2 Removed text: In the industry, the c3 Text added.Version November 1, 2023 submitted to Algorithms https://www.mdpi.com/journal/algorithms the innermost tube, its location results in the shortest path connecting two points at the base and at the tip.

Related works
In general 3D space, the problem of finding the ESP between two given points that does not intersect given obstacles is known to be NP-hard [21], special cases of the problem have been studied afterwards.The author in [22] gave a polynomial time algorithm to calculate ESP for cases where the number of obstacles is 'small' and all of them are convex.Another algorithm was proposed in [23] with the assumption that all obstacles are vertical buildings with k different heights.More recently, [24] presented algorithms for solving approximate ESPs amid convex obstacles.Other approximation algorithms for ESP calculations are detailed in [25].These studies share common features that a collection of finite obstacles are given as forbidden zones in space and the ESP will be found in the space surrounding these obstacles.
In the studied problem, the obstacle is the entire space outside the tube and the ESP must pass through the inner zone of the tubular space.A similar problem can be found in [26] that compute the minimal path in tubular space.The minimal path is typically solved based on the Fast Marching method which only considers grid nodes as the possible vertices of the minimal paths.However, paths detected by the Fast Marching method have been proven to be not always the exact ESPs [1].There also exist several approximation algorithms for finding ESP between two points in 3D space bounded by a closed surface such as a cube-curves [27] or a simple polyhedron [28] using rubberband algorithm.This method is suitable for solving various ESPs in 3D space.Even so, there is a non-trivial gap in geometric shape between the cube-curve and the tubular space.Polyhedron seems like a better choice to represent a tubular space.However, characteristic geometrical properties of tubular spaces should be considered for a dedicated algorithm.
The studies on tubular surface with Bishop frame was proposed in [29].The authors gave some characterizations about special curves lying on this surface (e.g., geodesic and asymptotic curves).However, the problem we study requires considering the interior space instead of just the boundary surface.In addition, the geometrical properties of the ESP inside the tubular space also need to be investigated.The authors in [30] described a simple geometric structure of ESPs where they consist of curved paths on the obstacles connected by straight line segments (see Theorem 1).In this work, we develop the geometric structure of ESPs presented in [30] by considering characteristic properties of tubular spaces.
In practice, the navigation problem can be classified into planning-based and reactive algorithms [31].Planning-based approaches require a global map representation of the environment (e.g., a graph or a network) before searching.The knowledge beforehand of the tubular space allows generating a weighted graph where the weight of each edge (or arc for the directed graph) associated with its length [25].Numerous algorithms are used for shortest path calculation in graph theory (see Chapter 24 and 25 in [32]).A well-known graph-based algorithm among them is Dijkstra's algorithm [33] where the shortest path connects vertices in the graph.Unlike the planning-based approaches, a reactive method allows directly generating motion decisions during the movement based on observed data [31].The reactive shortest path navigation was presented in [34] for an in-plane problem.Such a problem was also found in 3D space where the obtained path is interpolated with a spline curve [35].In this work, we propose an algorithm that based on the observed information of a virtual particle and can be used as a reactive method for the shortest path navigation inside the tubular space.

Contributions
In this paper, we propose a novel algorithm to find the shortest path within a tubular space that connects two points at the tube ends.Our contributions include: 1) the description of the ESP geometrical structure inside tubular spaces with mathematical proof, 2) the proposition of a novel algorithm for finding the shortest path in tubular spaces based on the observed data, and 3) the numerical validation and comparison results with Dijkstra's algorithm by considering various types of tubular spaces.As a result, the solution obtained by using the proposed algorithm is shorter, smoother and faster than one provided by Dijkstra's method.
The remainder of this paper is organized as follows.Section 2 formulates the problem.The basics of Dijkstra's algorithm is described in Section 3.Then, we present the proposed algorithm in Section 4. Our computational results is given in Section 5.After that, Section 6 includes some brief discussions.Section 7 concludes the paper.

Problem description
Euclidean geometry is the geometry in daily life [1] where the distance between two points p p p = (x p , y p , z p ) T and q q q = (x q , y q , z q ) T in 3D space is defined as follows: From the discrete point of view, a path (α) from the source P P P to the destination Q Q Q is a finite sequence of nodes x x x i , starting at P P P and ending at Q Q Q.We obtain the length of the path as in Eq. 2: Then, the c1 ESP is the path connecting P P P and Q Q Q, which has the minimum length and has to be through a given tubular space.The mathematical definition of tubular space is given as follows [36]: Definition 1.Let c c c(s) : I → R 3 be a smooth, regular space curve.A tubular surface ∂Ω associated to c c c(s), of radius ρ, is, by definition, the envelope of the family of spheres of radius ρ, with the center on the curve.Definition 2. The storage space of the tube Ω is the 3D space enclosed by the lateral wall (∂Ω) and the two ending cross-sections of the tube.

Self-overlapping
Figure 1.Regular and self-overlapping tube as defined in [29].The regular tube ensures the correctness of the directed graph in the following section.c2 c3 In Definition 1, s is the arc length parameter of the centerline curve.We consider in this work the tubular surface ∂Ω to be regular (Fig. 1).The condition underlying the regularity of a tube is given in details in [29].By κ(s), we denote the curvature of the centerline curve c1 Removed text: searching c2 Removed text: where c3 Text added.c c c(s).In order to avoid singularities as well as self-overlapping, the following condition is required: where L is the length of c c c(s).

Directed graph
We discretize Ω into a series of meshed circular disks corresponding to the crosssections perpendicular to c c c(s).By S 0 , ..., S N+1 we denote the meshed circular disks where S 0 contains the starting point (source) P P P and S N+1 includes the destination Q Q Q.The distance between two consecutive disks along the centerline curve is h = L N+1 .As the shortest path from the source to the destination must obviously pass through each cross-section at only one point, we have the weighted directed graph G(V, A) as shown in Fig. 2.This directed graph is defined by a finite set V of vertices and a set A of arcs between those vertices [1].All vertices of the graph (except P P P and Q Q Q) are located at the nodes of the meshed disks S 1 , ..., S N .We define that two vertices are called adjacent if they are connected by one arc.Then, every two adjacent nodes in the graph are located on two consecutive disks.The source P P P is connected with all nodes of disk S 1 .Each node of disk S i is connected by one arc to every node of disk S i+1 for all i ∈ {1, ..., N − 1}.Eventually, every node of disk S N is connected directly to the destination Q Q Q.

Basics of Dijkstra's Algorithm
c1 The concept of this method, based on the lemma about the relationship between global minimum and local minimum, was first presented by E.W. Dijkstra in 1959 (see [33], Problem 2).c2 Although also based on Lemma 1, Algorithm 1 c3 applied for the directed graph has a run time in O(|A|) instead of O(|V|log|V| + |A|) like the conventional Dijkstra's algorithm used for a weighted graph in general [1].Lemma 1. (Dijkstra algorithm, 1959) "If r r r is a node on the minimal path from p p p to q q q, knowledge of the latter implies the knowledge of the minimal path from p p p to r r r".This lemma can be proved easily by contradiction.The shortest path from the source P P P to the destination Q Q Q will be traced by extending all extendable paths by one edge to a node not yet visited on this path until Q Q Q is reached.Consequently, extending all the extendable paths from the source by one arc in the directed graph becomes turning the c1 Remove text: Dijkstra's algorithm solves the problem of finding the shortest path between a point (source) and any other point (destination) in a given graph.Algorithm 1: Dijkstra's algorithm

, M};
// From the source to S 1 // Between S 1 and S N // From S N to the destination examined disk into its adjacent disk towards the destination.Once examining a disk, the shortest path between the source and every node on the previous disks has been identified, so we do not need to revisit these points.Set r r r [i][j] (i ∈ {1, ..., N}, j ∈ {1, ..., M}) be the node j th on the meshed disk S i .In addition, we denote D(x x x) as the minimum length from node P P P to node x x x, w(x x x, y y y) as the length of the arc connecting two adjacent nodes x x x and y y y, and L [i][j] as the list of the nodes on the shortest path from the source P P P to node r r r . We obtain Dijkstra's algorithm applied for this ESP problem as given in Algorithm 1.
c1 During the operation, all currently visited nodes always belong to the same crosssection.Thus, all possible paths will reach the destination at the same time.When the destination is reached, there will be no longer extendable paths in the directed graph and we can point out the shortest path.For that reason, the algorithm becomes a breadth-first search algorithm [1].c2 Thus, the time complexity of c3 Algorithm 1 is O(|A|) with |A| is the number of arcs in the directed graph.As a conventional method, the solution by Dijkstra's algorithm is given as a series of vertices of the graph G.Then, the solution path obtained is generally a polyline.To increase the accuracy of the result as well as make it smoother, the mesh of the discretized cross-section must be finer.However, increasing the number of nodes on the mesh results in significantly slowing down the calculation speed.We then proposed a new method that takes atage of the geometrical properties of tubular spaces to improve the searching solution.Among them, the blue one is the longest-length-of-sight, an important concept used in the following method.

Not continuous Unique and continuous
Not unique

Figure 4.
The visible area of a cross-section S i is described by the yellow zone(s) which must be unique and continuous.

The ESP Searching Algorithm Based on Visibility
The algorithm we propose hereafter c1 is based on a visible tube portion that can be "seen" by the VP moving along the searching shortest path.The ESP will be gradually figure our by determining the correct moving direction of the particle from the source P P P to the destination Q Q Q.For convenience, we firstly define some concepts used in this section.

Geometric properties of the ESP in tubular space
Definition 3.For every point X X X ∈ S i ⊂ Ω, i ̸ = N + 1, the cross-section S i divides Ω into 2 sub-spaces, a direction from X X X is said to be positive (+) if it is towards the sub-space containing the destination.
According to Definition 3, any point in Ω (not belonging to S N+1 ) will have an infinite number of positive directions (see Fig. 3).Obviously, during the movement, the correct direction of the particle is always a positive direction.Definition 4. Two points X X X, Y Y Y ∈ Ω are said to see each other if the line segment joining them XY XY XY is totally contained by Ω. Definition 5. A cross-section S ⊂ Ω is visible from a point X X X ∈ Ω if there exists a point Y Y Y ∈ S that can be seen by X X X. Lemma 2. If a point X X X inside the tube can see a cross-section S of the tube, the area part in S that can be seen by X X X must be a convex set (as illustrated in Fig. 4).
The proof of this lemma is detailed in the Appendix A.1.Definition 6.From a point X X X ∈ Ω, the "length of sight" corresponding to a positive direction is the distance between X X X and the farthest point in ∂Ω that can be seen by X X X along the positive direction.The line segment corresponding to this length is called the line of sight.c1 Text added.
We then have the geometric structure of the shortest path between two points (not see each other) in a tubular space.Theorem 1.By f f f , we denote the shortest path between two arbitrary points X X X and Y Y Y inside the tubular space Ω.If X X X cannot see Y Y Y, then there exist curved parts of f f f lying on the inner lateral wall of the tube ∂Ω.Outside these parts, f f f consists of a union of straight line segments which are tangent to the boundary surface ∂Ω.
Theorem 2. The curved parts of f f f are geodesic paths on ∂Ω.Moreover, they are on the surface of negative curvature.
Proof: The proof of Theorem 1 was presented in [30].To prove Theorem 2, we employ Lemma 1.As the curved parts of f f f are also the shortest paths connecting their ends, they must be geodesic paths on the boundary surface ∂Ω [37].Moreover, if there exists a curved path of f f f that is outside the surface of negative curvature, we always find on this path two neighboring points that can see each other (see Fig. 5).As the straight line segment joining these points is shorter than the geodesic path between them, then f f f is not the shortest one connecting X X X and Y Y Y.This contradicts the definition of f f f (Q.E.D.).
These two theorems lead us to two important corollaries.Corollary 1.Let X X X be a point on the ESP p p p(s) that can see a point Y Y Y so that the ray XY XY XY is not the direction ṗ p p(s X ) of the ESP at X X X.Let (α) be an arbitrary plane containing XY XY XY.If the angle between ṗ p p(s X ) and (α) is not zero, then the direction ṗ p p(s) at any point on the ESP segment between the cross-sections containing X X X and Y Y Y will always point away from (α).
Proof: From X X X, the particle moves away from (α) (the angle between ṗ p p(s X ) and (α) is not zero).Using Theorem 1, we obtain that the particle only changes its direction at points on the geodesic paths.As these curves must be on surface of negative curvature (Theorem 2) where vector p p p(s) points out of the tube, thus the ṗ p p(s) will always point away from the plane (α) (see Fig. 6).
Corollary 2. If X X X on the ESP can see a cross-section S of the tubular space Ω via a positive direction, the correct direction at X X X ( ṗ p p(s X )) must be towards a point Y Y Y in the visible area of S by X X X.
Proof: The above corollary can be proved by contradiction.By σ X (S), we denote the visible area of the cross-section S by X X X.Let Y Y Y be the intersection of the straight line containing ṗ p p(s X ) and the plane containing S (denoted by β(S)).We need to prove that Y Y Y ∈ σ X (S).We consider the following hypothesis of contradiction: In other words, the ray XY XY XY passes through the boundary ∂Ω.Let M M M be the passing point that is closest to X X X.In (α) is an arbitrary plane containing XY XY XY but not containing ṗ ṗ ṗ(s X ).The ESP p p p(s) only changes its direction ṗ p p(s) on its geodesic segment(s).S is an arbitrary cross-section of the tube where the geodesic segment crosses.(Right) On the projection view plane that is perpendicular to (α) ((α) degenerates to a straight line), as p p p(s) points outside the envelope of S, it also points away from (α).As ṗ p p(s X ) points away from (α), by mathematical induction ṗ p p(s) will point away from (α the visible area σ X (S).Let W W W be the intersection point that is closest to Y Y Y.Then, W W W must be on the boundary of σ X (S) (denoted by ∂σ X (S)).In addition, there is a total of two relative positions of W W W: W W W ∈ ∂Ω and W W W ̸ ∈ ∂Ω (see Fig. 7).In the following, we define a plane (α) and a closed surface (C) for these two mentioned cases: is the plane that contains XW XW XW and the tangent at W W W of σ X (S).If XW XW XW is not tangent to ∂Ω, we can always find in β(S) a circle with center W W W and radius ϵ small enough so that the entire circle can be seen by X X X (as there is no obstacle between X X X and this circle).Then there exist points outside σ X (S) (which is part of the circle) that can be seen by X X X.This contradicts the definition of σ X (S).Thus XW XW XW is tangent to ∂Ω.Let T T T be the tangent point that closest to X X X and P T (∂Ω) be the tangent plane of ∂Ω at T T T. If P T (∂Ω) ̸ ≡ (α), P T (∂Ω) will divides σ X (S) into two subsets.However, as the line of sight of a visible point in σ X (S) must pass through the cross-section at T T T of the tube, then only one subset of σ X (S) can be observed by X X X.This contradicts the definition of σ X (S).Thus, P T (∂Ω) ≡ (α).We can then define a closed surface (C) enclosed by (α), the cross-section at X X X, and part of ∂Ω which contains M M M (see Fig. 7 Left).
• (W W W ∈ ∂Ω).(α) is the plane that contains XW XW XW and the tangent at W W W of S.Then, (C) is the closed surface containing M M M and enclosed by ∂Ω, (α), and the cross-section at X X X of the tube (see Fig. 7 Right).
By using the definition of (C), we obtain that from X X X, the VP will go into the inner space of (C).Since the destination Q is outside (C), the particle must pass the boundary of (C) at somewhere on (α).However, by applying Corollary 1, the direction vector ṗ p p(s) will always point away from (α), thus the particle cannot return to (α) for a passing point.Therefore, the hypothesis (4) cannot be true, then Y Y Y ∈ σ X (S).(Q.E.D.).
Employing the above lemma, theorems and corollaries leads us to an important result about the partitions of the ESP inside a tubular space as given in Remark 1.
Remark 1.For any type of tubular space, the searching shortest path p p p(s) can be segmented into three partitions: • Partition 1 (P1) : Includes points that can see the destination Q Q Q.The direction ṗ p p(s) at any point in this partition is always towards Q Q Q.

•
Partition 2 (P2) : Includes points that can see the ending cross-section S end , but cannot see Q Q Q.The direction ṗ p p(s) at any point X X X in this partition is always towards a visible point Y Y Y in the ending cross-section such that the angle between XY XY XY and X X XQ Q Q is the smallest one.

•
Partition 3 (P3) : Includes points that cannot see the ending cross-section S end .The direction of ṗ p p(s) at any point in this partition is the positive direction corresponding to the longestlength-of-sight.
The three partitions of the searching shortest path inside the tube are described in Fig. 8.The proof of this remark is given in the Appendix A.2.It is important to note that a tube does not necessarily contain all 3 partitions.For instance, a straight tube only contains partition 1 for any positions of the source and the destination.

The Proposed Algorithm
The principle of this method is based on Remark 1. Ensuring two points can see each other in the discrete approach is equivalent to proving that the line segment joining those points must cross all the meshed circular disks between them.In the Algorithm 2, we use C C C i to denote the intersection point between the searching shortest path and the cross-section S i , i ∈ {0, ..., N + 1}.The objective of the Algorithm 2 is then equivalent to Algorithm 2: Proposed method Input: P P P, Q Q Q, and r r r [i][j] , ∀i ∈ {1, ..., N}, ∀j ∈ {1, ..., M}.

Oriented Drilling Process
To determine effectively the longest-length-of-sight from an arbitrary point X X X inside the tube, we employ Lemma 2. The operation scheme of finding the longest-length-of-sight direction illustrated in Fig. 9 comprises a series of expanding and deepening processes.Without loss of generality, we assume that C C C i−1 can see a point T T T in a forward section S j .By employing Lemma 2, we expand discretely the examined direction from the direction passing through T T T to others passing through its nearby nodes on the same mesh S j until c1 Remove text: is belong c2 Text added.The oriented drilling process : 1) C C C i−1 can see T T T in section S j , 2) expand the examined direction in the vicinity of T T T until seeing T T T new in section S k (k > j), 3) update T T T by T T T new , S j by S k and repeat step 2 for the new T T T and S j , 4) repeat step 3, 5) the expanding process is over and we do not find any farther section S k = ∅, we then compare all the length of sight passing through the visible area in S j to obtain the direction corresponding to the longest-length-of-sight, and 6) initialize the next correct point of the shortest path C C C i as the intersection point between the correct direction and cross-section S i .discovering a point T T T new in a farther disk S k (k > j).As a deepening process, we then update T T T by T T T new and also the examined cross-section S j by S k .The operation is then repeated until the expanding process is over.The condition to stop the expanding process is when the boundary of the visited area in S j just comprises the invisible nodes and the boundary points of S j .Finally, we compare the length of sight corresponding to all visible points in farthest visible cross-section and find the longest one.The next correct point C C C i is the intersection point between this line of sight and the next cross-section S i .One atage of this method is a significant improvement in computation time as we do not need to visit all the nodes of the graph.For the expanding process, on the examined disk S j , we just need to expand the investigated nodes until the current exact point C C C i−1 can see farther, then we jump further into the more in-depth cross-section.Otherwise, if there is no new disk observed by C C C i−1 , we stop the process and indicate the next correct point of the ESP C C C i .Moreover, as this is an inheritable algorithm, in the next searching process, we can use directly the previous correct direction as the initial examined orientation.Thus, we skip the disks that were examined in the previous loop.For several circumstances such as points on the straight-line segments of the shortest path (the ESP consists of straight-line and geodesic curve segments, see Theorem 1-2), the next searching process can stop right after choosing this initial examined orientation.That is also the reason why we call this method Oriented Drilling.Imagine that every time we find the correct direction for the point C C C i−1 like we drill a hole in that direction.For the next searching process, as there was already a hole, the searching is much more comfortable.The whole process becomes adjusting the direction of the drill so that it can drill deeper.Consequently, the drilling direction will be oriented closer and closer to the deepest drill hole (the longest-length-of-sight).

Computational Results
In this section, we will compare the efficiency of the proposed algorithm with Dijkstra's one.There are several criteria for this comparison result: the length of the obtained ESP, the computation speed, the smoothness and the position error of the solution.The experiments were ran on a machine with an Intel Core i5-8400 CPU @ 2.80 GHz processor.It has a 6-core CPU and the available RAM was 16 GB.All algorithms were implemented in Matlab.

Computation Time
We firstly implemented them considering a tube with the centerline in 3D space consisting of a 4 cm straight length and two curved segments belonging to two perpendicular planes.The radii of both curves are 12 cm and their lengths are 16 cm and 20 cm respectively as detailed in Fig. 10.The inner diameter of the tube is 3 cm.We chose the discretization step h = 2 mm (N = 199).Each meshed disk is made by dividing the cross-section into c1 c2 25 concentric circles (N ρ = c3 c4 25) whose circumference are divided into 4 equal arcs (N θ = 4).
As shown in Fig. 10, the proposed method allows us to obtain a shorter and smoother solution than Dijkstra's method with the same mesh (detailed analysis will be provided in the next sub-section).Another atage of the proposed algorithm compared to Dijkstra's method is the computation speed as a large number of unimportant vertices and arcs can be ignored in the process (see Fig. 10).As the time complexity of the proposed method has a huge variation depending on the specific shape of the tubular space, the computation time (instead of the theoretical time complexity) will be consider for the comparison result.Table 1 shows how the computation times of the two methods depend on the number of nodes in the meshed circular disks.As we can see the computation time of Dijkstra's method will increase by a factor of 4 if M is doubled (M is the number of nodes in a c1 Remove text: 20  ).For the proposed method, this increasing rate is less than two.

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 (waveshaped torus on a sphere, helical, spiral, and complex shape).c1 Each meshed disk is chosen with N ρ = 25 and N θ = 4.In all these cases, the proposed algorithm always gives shorter, smoother and faster results than Dijkstra's algorithm with the same mesh.Unlike conventional graph-based methods (e.g.Dijkstra'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 necessary a node of the mesh and leads to a smoother and shorter solution than one by Dijkstra'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 case that the tendon locates freely inside the tube [19].
Besides 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 directly related to the deformation direction of the tube.Thus, the position error of the obtained ESP to the exact solution need to be investigated.We consider the ESPs given by Dijkstra'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 ϵ D i and ϵ P i are the position errors within cross-section S i of the solution by Dijkstra'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 Dijkstra's solution are given in Eq. 5 and Eq. 6 (the same for the proposed method just by replacing super index D by P). c1 Text added.

Discussion
In this section, the extended application scope of the proposed algorithm and the ability to apply it as a reactive method for the navigation problem in unknown environments will be discussed.

Extended Applications
We can extend the application scope of the proposed method for general tunnels with convex and variable cross-sections (see Fig. 11).Indeed, with a minor modification on Remark 1 for points in P3: the correct direction is towards the (only) visible point of the farthest visible cross-section instead of considering the longest-length-of-sight, one can confirm that the correctness of Remark 1 will still be preserved (see the Appendix A.2).

A Reactive Method
In this work, we used the same directed graph for Dijkstra's algorithm and the proposed one for the aim of simplify the validation and the comparison results.It is important to note that the proposed method does not require the knowledge of the entire volume Ω to obtain a weighted graph before searching.In fact, the correct direction of the particle can be determined based on the observation in front of it.While using Dijkstra's algorithm, we cannot figure out which path is the ESP until visiting all nodes and arcs of the graph and need to store all possible paths during operation, the proposed method allows directly generating motion decision during the movement there by the ESP is gradually traced.Thus, it can be applied as a reactive method for robots that need to explore unknown tubular spaces such as lava tubes on an astronomical object [40] or environments in the absence of GPS signals [41].In practice, the proposed algorithm should be run together with a given safety boundary constraint for collision avoidance of the inspection robots.

Conclusion
In this paper, we presented a novel algorithm for solving the ESP problem inside tubular spaces based on its geometric properties.Computational results were conducted on various types of tubular spaces.We demonstrated that the achieved efficiency of the proposed algorithm is c1 better than Dijkstra's one.Concretely, the proposed method provided smoother and more precise results with a faster calculation speed than one obtained by Dijkstra's algorithm with the same grid.The strength of the proposed method is also reflected in the fact that it can work without knowing the environment in advance which allows it to process as a reactive method.Even though the algorithm was described for the tubular space it is also strongly promising for more complex tunnel spaces, to which it can directly be applied with the mentioned minor modification.c2 A limitation of this method is that it is only applicable to unbranched tubular spaces.In order to apply this method for a branched tubular space, additional information will be required to make decisions at the junctions of branches.
As the ESP may lie on the tubular surface, the requirement of using a collision-free method together with the proposed algorithm has been left for future research.Our plans for future work concern some applications such as on-line trajectory generation of navigation robots in unknown tunnels or determine the deformation of a tendon drive tube-like robot in medical that is also our domain of interest.inner zone of σ X (S end )), then the ESP goes into the inner space of (C 1 ) with the direction ṗ ṗ ṗ(s X ).As Q is outside (C 1 ), the ESP must pass the boundary of (C 1 ).We denote H H H as the passing point.Since X X X can see H H H, the part of the ESP connecting X X X and H H H is not the shortest path (as it is longer than XH XH XH).This leads to a contradiction with Lemma 1. Hence: In addition, if W W W ̸ ≡ Y Y Y, then W W W ̸ ∈ (α).By using Corollary 1, we can confirm that the particle will move far away from (P c ) so it cannot reach Q Q Q on (P c ).Thus, W W W ≡ Y Y Y. (Q.E.D.) iii.Case 3: X X X ∈ P3 (X X X cannot see S end ) As X X X cannot see S end , there exists the farthest cross-section S f of the tube that can be seen by X X X.We will prove that X X X can see only one point in this cross-section.In S f , if there exist two different visible points Y m Y m ̸ ∈ ∂Ω, we infer that S f is not the farthest visible cross-section by X X X (X X X can see farther with the line of sight through Y m Y m Y m ).Thus, there is only one visible point Y Y Y in S f that can be seen by X X X, and XY XY XY is the correct direction of the tendon according to Corollary 2.Moreover, we can demonstrate that XY XY XY is also the longest-length-of-sight from X X X.One can easily confirm that XY XY XY must be tangent to ∂Ω at a point T T T of the cross-section S T .Let (α) be the corresponding tangent plane.Let Ω v be the space enclosed by ∂Ω, (α), and the cross-section containing X X X as illustrated in Fig. A2.Then, Ω v contains all the visible points by X X X of Ω located behind the cross-section S T .The problem now is to prove that XY is the longest length of sight in Ω v .As the tube does not overlap itself, we obtain: XY XY XY ≥ TY TY TY ≥ 2R.Thus, one can confirm that Ω v is totally contained by the sphere (χ) center X X X and the radius XY XY XY.We then have XY is the longest length of sight from X X X.  c2 It is evident that every point on the ESP must belong to one of the three partitions (P1: see Q Q Q, P2: see S end , but not see Q Q Q, and P3: not see S end ) and as the correct direction is unique for each position, if the VP follows the proposed correct direction throughout its journey, its moving path will describe the ESP.(Q.E.D).

Figure 2 .
Figure 2. Discrete approach for the ESP problem.(Left): Inner space of the tube transformed into a series of meshed circular disks and (Right): the directed graph.

c1Figure 3 .
Figure 3. (Left): The dashed red rays describe the positive directions.(Right): A A A can see B B B and D D D because the line segments AB AB AB and AD AD AD are totally contained by Ω.Also by this definition, A A A cannot see C C C. The green and blue dashed lines terminating at the boundary ∂Ω illustrate the line of sights.Among them, the blue one is the longest-length-of-sight, an important concept used in the following method.

Figure 5 .
Figure 5. Curved segments lying on surfaces of positive and zero curvatures where A and B can see each other.

Figure 6 .
Figure 6.(Left) Tube portion between the cross-sections containing X X X and Y Y Y which can see each other.(α) is an arbitrary plane containing XY XY XY but not containing ṗ ṗ ṗ(s X ).The ESP p p p(s) only changes its direction ṗ p p(s) on its geodesic segment(s).S is an arbitrary cross-section of the tube where the geodesic segment crosses.(Right) On the projection view plane that is perpendicular to (α)((α) degenerates to a straight line), as p p p(s) points outside the envelope of S, it also points away from (α).As ṗ p p(s X ) points away from (α), by mathematical induction ṗ p p(s) will point away from (α), ∀s ∈ [s X , s Y ].

Figure 7 .
Figure 7. Point X X X can see cross-section S. Y Y Y be the intersection of the direction of the ESP ṗ ṗ ṗ(S X ) and the plane containing S. In β(S) and through Y Y Y, we draw an arbitrary straight line that intersects the visible area σ X (S).Let W W W be the intersection point that is closest to Y Y Y. (Left): W W W is in the inner zone of S. (Right): W W W is on the boundary of S.

Figure 8 .
Figure 8. Three partitions of the shortest path corresponding to three sections of the tube.At A A A belonging to P3, the VP cannot see the ending cross-section S end .The correct direction corresponds to the longest-length-of-sight.At B B B belonging to P2, it can see S end , but not Q Q Q.The correct direction is towards the visible point Y Y Y in S end so that the angle θ between BY BY BY and BQ BQ BQ is the smallest one.At C C C in P1, the particle can see Q Q Q.The correct direction is towards Q Q Q.

9 θ
← +∞ ;// Angle between the correct direction and of C C C i .It is important to note that C C C i is not necessarily a node of G(V, A).Indeed, the algorithm figures out the correct direction of C C C i−1 thereby determining the position of C C C i as the intersection point between this direction and the next cross-section S i .The correct direction of C C C i−1 is found using Remark 1 by checking which partition C C C i−1 c1 c2 belongs to (with precedence from P1 to P3).The value 1 of f lag marks that C C C i−1 can see the ending cross-section S N+1 .The Oriented Drilling Process is an algorithm employed for Partition 3, which returns to the next value of C C C i series by the intersection point between the longest-length-of-sight direction and the next cross-section.

Figure 9 .
Figure9.The oriented drilling process : 1) C C C i−1 can see T T T in section S j , 2) expand the examined direction in the vicinity of T T T until seeing T T T new in section S k (k > j), 3) update T T T by T T T new , S j by S k and repeat step 2 for the new T T T and S j , 4) repeat step 3, 5) the expanding process is over and we do not find any farther section S k = ∅, we then compare all the length of sight passing through the visible area in S j to obtain the direction corresponding to the longest-length-of-sight, and 6) initialize the next correct point of the shortest path C C C i as the intersection point between the correct direction and cross-section S i .

Figure 10 .
Figure 10.Tubular space with two curved segments in space.By L.P, and T.P, we denote the tendon length and the computation time for the solution obtained by the proposed method.Similarly, L.D, and T.D for Dijkstra's algorithm.The exact solution is determined by using Dijkstra's method with N ρ = 144 and N θ = 64.

Figure 11 .
Figure 11.Canal space with convex and variable cross-sections. c1

Figure A2 .
Figure A2.X X X cannot see the ending cross-section.It can see only one point Y Y Y on the furthest visible cross-section S f .

Table 3 .
Root mean square and maximum position errors of the ESP obtained by the two algorithm.The tube number is as given in Table2.