**Function 2**: *PathShortening*(*P*):

Step 1. Generate the shortcuts of any two consecutive segments by performing the Function 1.

Step 2. Sort the shortcuts by their corresponding length improvements in a descending order.

Step 3. Shorten the original path in a descending order.

**END** {Function of *PathShortening*}.

**Algorithm**: The triangle mesh-based shortest path on the quadric surfaces.

Init Load the data from a GIS map.

A triangle mesh is a type of polygon mesh in computer graphics. It comprises a set of triangles (typically in three dimensions) that are connected by their common edges or corners [18]. With individual triangles, the system has to operate on three vertices for every triangle. In mathematics and computational geometry, the triangle mesh can be expressed in a Delaunay triangulation for a set *V* of vertices in the plane is a triangulation DT(*V*) such that no vertex in

A path that interconnects the two vertices *v* and *v'* of a graph *G* with minimal length for all paths is called the shortest path. Finding a shortest path in a graph *G* can be done in *O*(*n*log *n*) with Ahuja-Dijkstra's single-source shortest path algorithm by using Fibonacci heaps (F-heaps)

A ridge is a curve consisting of ridge point: A point lies on a ridge if its neighbourhood can be subdivided by a line passing through it, and such that the surface in each half-neighbourhood

In this section, a Delaunay triangulation-based method will combine the concepts of Ahuja-Dijkstra algorithm and ridge points to construct a directed graph and to obtain the shortest possible path length on the quadratic surfaces. Compared to another Delaunay triangulation method [4], Fermat points are replaced by the ridge points; this is mainly due to the fact that Fermat points cannot connect the shortest line between two neighbour triangles on the quadratic surface. The initial step of the algorithm is to build a triangle mesh *G* to simulate the earth's surface (the GIS map). Next, a source point and a destination point are spotted, then three ridge points in the same triangle will be connected together to generate an extra small triangle and three extra path segments between the vertices and neighbour triangles diagonal vertices.

These extra connections as shown in **Figure 1(b)** will be used to search for the near-shortest path

Step 1. Create a ridge point between two neighbouring triangles as shown in **Figure 1(a)**. Step 2. Obtain the shortest path by connecting these two vertices *E, F* with the ridge point.

Step 1. Generate the shortcuts of any two consecutive segments by performing the Function 1. Step 2. Sort the shortcuts by their corresponding length improvements in a descending order.

, we can obtain the near-shortest path *P* in graph *G*′

). As we have constructed the directed

if it exists.

*V* is inside the circle of any triangle in DT(*V*) [19].

is monotonically decreasing when moving away from the line [21].

by using the Ahuja-Dijkstras algorithm (expressed by *E*<sup>f</sup>

Step 3. Shorten the original path in a descending order.

and radix heaps [20].

94 Advanced Path Planning for Mobile Entities

**3. Algorithm and illustration**

connected graph *G*′ = *G* ∪ *E*<sup>f</sup>

**Function 2**: *PathShortening*(*P*):

**END** {Function of *PathShortening*}.

**Function 1**: *FindingExtraConections*():

**END** {Function of *FindingExtraConections*}.

Step 1. Construct a triangle mesh *G* by the Delaunay triangulation on the data, locate a source point and a destination point.

Step 2. Compute the shortest path between the neighbouring vertices based on the ridge points on the quadric surface by performing Function 1.

Step 3. Construct the directed connected graph *G*′ with the extra connections.

Step 4. Obtain the shortest path in graph *G*′ if it exists by Ahuja-Dijkstras algorithm.

Step 5. Call the Function 2 *PathShortening*(*P*).

**END** {Algorithm of the triangle mesh-based shortest path}.

**Figure 2** illustrates the detailed process. **Figure 2(a)** shows the initiation of a triangle mesh *G*, then a source point *S* and a destination point *D* are depicted in **Figure 2(b)**. Next, ridge points will be inserted into the triangle mesh in order to generate extra path connections

**Figure 1.** Illustration of the ridge points. (a) A ridge point of ∆ABC and ∆ACD. (b) The connections between the ∆ABC and neighbour triangles vertices and ridge points.

**Proof:** We can generate Delaunay triangulation as a triangle mesh with time of *O*(*n*log *n*) [22],

Path Planning on Quadric Surfaces and Its Application http://dx.doi.org/10.5772/intechopen.72573 97

The number of the ridge points is bounded by *O*(*n*); thus, the number of connections in Step 3 is also bounded by 9 × *O*(*n*). We therefore know that all the time complexity for Steps 2 and 3 are *O*(*n*). In Step 4, the time complexity of the Ahuja-Dijkatras algorithm using Fibonacci heaps and radix heaps is *O*(*n* + *n*log *n*) = *O*(*n*log *n*) [20]. In Step 5, as the number of points are *n* − 3, the time complexity will be dominated by *O*[(*n* − 3)*log*(*n* − 3)] = *O*(*n* log *n*). Therefore, the overall

In conclusion, the time complexity is 9 × *O*(*n*) + *O*(*n* log *n*) = *O*(*n* log *n*) from Steps 1–5.

**Theorem 2.** The space complexity of constructing the triangle mesh in the quadratic surface is

**Proof:** According to Euler characteristic, the number of triangles is less than *T* = 2 × (*k*<sup>C</sup> × *n*) − *h* – 2 once the triangle mesh is generated, where *h* is the number of corners of the triangles. Therefore, the space complexity is bounded by *O*(*n*). Furthermore, the number of edges including the original edges of triangles, edges connecting ridge points to the vertices of triangles, and connection between ridge points is also bounded by (6 + 3/2) × *T* = 7.5 *T*. Hence, the space complexity is *O*(*n*).

The performance of Delaunay triangulation-based path algorithm has been analysed for evaluating the near-shortest path with several real GIS maps in the Matlab Language. The analysis was performed on an Intel Core2 Quad CPU Q9550@2.83 GHz processor with 8 GB memory. **Figure 3** shows one of the experimental results with a GIS map, where the solid line

Next, we have compared this algorithm to the KS's algorithm with 1, 3, 5, 7, 9, 19 and 29 Steiner points and summarised the comparison results on the average path length and the average runtime in **Table 2**. In KS's algorithm, each edge of the triangle has been divided into multiple segments to generate more connections for path searching. **Figure 4(a)** and **(b)** illus-

When compared to one Steiner point, the average path length difference of the Delaunay triangulation-based algorithm is 6.14% better than the KS's algorithm, and computation time between the Delaunay triangulation-based algorithm and the KS's algorithm is same. When it increased three Steiner points, the length difference is only 0.28%, but the computation time is 31.71 times faster. When 29 Steiner points for the KS's algorithm are applied, the KS's results can be assumed as the shortest path; however, the length difference is 2.81% longer and computation time is 4216 times faster. This proves that the Delaunay triangulation-based algorithm can solve the NP-hard problem and also obtain fast computing features. From the statistical view, **Figure 5** shows the prediction of the average computation time and length

as a result, time complexity in Step 1 is *O*(*n*log *n*) [23].

time complexity for *PathShortening* is *O*(*n*log *n*).

is the near-shortest path and dashed lines are the shortcuts.

difference if the number of KS's Steiner points is infinity.

trates the average running time and path length between two algorithms.

*O*(*n*), where *n* is the number of triangles.

**5. Experimental result**

**Figure 2.** Illustration of the Delaunay triangulation algorithm. (a) Initialise (aerial view). (b) Spot source point and destination point (top view). (c) Insert ridge points (top view). (d) Extra connections (aerial view). (e) Obtain the shortest path (aerial view). (f) PathShortening (top view).

as shown in **Figure 2(c)**. **Figure 2(d)** shows that each ridge point will connect with the others in the same triangle and three extra path segments between the vertices and neighbour triangles diagonal vertices. Thereafter, the shortest path can be obtained in the graph *G*′ by Ahuja-Dijkstras algorithm presented as a red line shown in **Figure 2(e)**. Finally, **Figure 2(f)** shows the final result after the *PathShortening*.
