**4. Performance analysis**

A near-shortest path algorithm on the Quadratic surface is the fastest in the literature.

**Theorem 1.** The time complexity of the algorithm in the triangle mesh *G* is *O*(*n*log *n*), where *n* denotes the number of triangles.

**Proof:** We can generate Delaunay triangulation as a triangle mesh with time of *O*(*n*log *n*) [22], as a result, time complexity in Step 1 is *O*(*n*log *n*) [23].

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 time complexity for *PathShortening* is *O*(*n*log *n*).

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 *O*(*n*), where *n* is the number of triangles.

**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*).
