Keywords

1 Introduction

The shortest path problem is a well-studied problem in graphs (directed and undirected). It enquires the shortest path between two vertices in a graph such that the sum of the weights of its constituent edges is minimized. The weights of the edges may vary depending on the problem being studied. Shortest path problem is a broadly useful problem solving model in robot navigation, texture mapping, typesetting in , urban traffic planning, optimal pipe-lining of VLSI chip, subroutine in advanced algorithms, telemarketer operator scheduling, routing of telecommunications messages, approximating piecewise linear functions, network routing protocols, and optimal truck routing through given traffic congestion pattern [1]. The complete history of shortest path problem can be found in [13]. The first reported algorithm on shortest path is by Shimbel in 1954 [14], where he had reported few observations on calculating distance and proposed a method which later became known as the Bellman-Ford method.

In 1958, Bellman proposed a dynamic programming based approach for solving shortest path problem in [3] which runs in \(O(n^3)\) time, where n is the number of vertices in the graph. In 1957, Moore proposed another algorithm on shortest paths [11]. In 1959, Dijkstra presented a simpler algorithm which runs in \(O(n^2)\) time in [5]. Most of the works on shortest paths reported so far mainly find paths between two vertices in a graph. However, we are proposing a combinatorial algorithm on shortest paths which finds a path between two points inside a digital object in triangular grid. M. Dutt et al. [6, 7] proposed a combinatorial algorithm to find a shortest isothetic path between two grid points inside a digital object without any holes. In [12], B. Nagy analysed some properties of hexagonal and triangular grid (considering cell model), where distance based neighborhood sequence is defined and an algorithm to calculate shortest distance between two arbitrary points is proposed. In [2], chain-code representation in triangular grid is discussed. There exists another work on finding shortest distance on the hexagonal grid [10], based on the distance function and the neighboring relations. A shortest path in triangular grid is a series of digital straight lines [8].

Fig. 1.
figure 1

A digital object with inner cover (blue), and shortest paths (a) in (red, green) and (b) in (red, green, purple) (Color figure online)

This paper focuses on finding a shortest path between two grid points inside a digital object imposed on a background triangular grid. First, the inner triangular cover of the given object is computed using the algorithm presented in [4]. This is done to ensure that the computed path does not go outside the inner cover and hence outside the object. An appropriate parallelogram is considered keeping the points at diagonally opposite corners. Combinatorial rules are applied on the intersection points generated on intersection of the inner cover with the parallelogram. Two triangular shortest paths are shown in Fig. 1(a) and (b).

The rest of the paper is organized as follows. All the required definitions and preliminaries are presented in Sect. 2. The method to obtain the shortest path is elaborated in Sect. 3. Estimation of running time of the proposed algorithm is explained in Sect. 4. Section 5 presents the experimental results with analysis and the conclusion is presented in Sect. 6.

Fig. 2.
figure 2

Portion of a triangular canvas, the UGTs \(\{T_0 , T_1 , \ldots , T_5 \}\) incident at a grid point p, and the direction codes \(\{0, 1, \ldots , 5\}\) of neighboring grid points of p.

2 Definitions and Preliminaries

A digital object (henceforth referred as an object A) is a finite subset of \(\mathbb {Z}^2\), which consists of one or more 8-connected components. In this paper, a connected hole-free object is considered. A triangular grid (henceforth simply referred as grid) \(\mathbb {T} := (\mathbb {L}_{60}, \mathbb {L}_0, \mathbb {L}_{120})\) consists of three sets of parallel grid lines, which are inclined at \(60^{\circ }\), \(0^{\circ }\), and \(120^{\circ }\) (w.l.o.g) w.r.t. x-axis [9].The grid lines in \(\mathbb {L}_{60}\), \(\mathbb {L}_{0}\), \(\mathbb {L}_{120}\) correspond to three distinct coordinates, namely \(\alpha \), \(\beta \), \(\gamma \). Three grid lines, one each from \(\mathbb {L}_{60}\), \(\mathbb {L}_0\), \(\mathbb {L}_{120}\), intersect at a (real) grid point. The distance between two consecutive grid points along a grid line is termed as grid size, g. A line segment of length g connecting two consecutive grid points on a grid line is called grid edge. The smallest-area triangle formed by three grid edges, one each from \(\mathbb {L}_{60}\), \(\mathbb {L}_{0}\), and \(\mathbb {L}_{120}\), is called unit grid triangle (UGT). For a given grid point, p, there are six neighboring UGTs, given by \(\{T_{i}:i=0,1,\ldots ,5\}\) as shown in Fig. 2. A portion of the triangular grid is shown in Fig. 2 along with direction codes. It has six distinct regions called sextants, each of which is well-defined by two rays starting from (0, 0, 0). For example, Sextant 1 is defined by the region \(\alpha _+ \cap \beta _+\), Sextant 2 is defined by the region \(\alpha \_ \cap \gamma \_\), and so on.

The triangular distance (\(d_{t}\)) between two points \(p(\alpha _{p},\beta _{p},\gamma _{p})\) and \(q(\alpha _{q},\beta _{q},\gamma _{q})\) is defined by \({d_{t}}(p,q) = max (|\alpha _{p}~\alpha _{q}|,|\beta _{p}~\beta _{q}|,|\gamma _{p}~\gamma _{q}|)\).

The 6-neighborhood of a point \((\alpha ,\beta ,\gamma )\) is given by \(N_6(\alpha ,\beta ,\gamma )=\{(\alpha ',\beta ',\gamma '):max(|\alpha - \alpha '|,\) \(|\beta - \beta '|,|\gamma - \gamma '|)=1\}\).

A (finite) polygon \({P}\) imposed on the grid \(\mathbb {T}\) is termed as a triangular polygon if its sides are collinear with lines in \(\mathbb {L}_{60}\), \(\mathbb {L}_0\), and \(\mathbb {L}_{120}\). It consists of a set of UGTs, and is represented by the (ordered) sequence of its vertices, which are grid points. Its interior is defined as the set of points with integer coordinates lying inside it. An inner triangular polygon (or simply inner polygon) tightly inscribes A such that its border is a subset of A and the number of its constituting UGTs is maximum. An inner triangular hole polygon (or inner hole polygon) tightly circumscribes a hole and its border is a subset of A. The inner triangular cover (ITC), \(\underline{P}\), is the set of inner polygons and inner hole polygons, such that the region given by the union of the inner polygons minus the union of the interiors of the inner hole polygons, contains a UGT if and only if it is a subset of A. In this paper, ITC containing one inner polygon is considered.

A (simple) triangular path \(\pi \) from a grid point p to a grid point q is a sequence of n distinct points \(p_1,p_2,\ldots ,p_n\) with \(p_1=p\) and \(p_n=q\) such that \(p_i\in N_6(p_{i+1})\), for \(1<i<n\). The length of a given triangular path is the sum of distances traversed along each axis. A triangular path \(\pi \) is said to be shortest if it is of minimum length. A path \(\pi \) in triangular grid is monotone if it consists of only one direction or two consecutive directions. Otherwise \(\pi \) is said to be non-monotone. In Fig. 1(a), the triangular path contains two monotone sub-paths whereas in Fig. 1(b), the triangular path contains three monotone sub-paths.

Deriving the Inner Triangular Cover (ITC): The inner triangular cover of A, \(\underline{P}\), is constructed using the same method as outer triangular cover as explained in [4], but in the reverse manner. A grid point q is classified as a vertex of the inner cover, if and only if at least one (and at most five) of the six UGTs incident at q is fully occupied by the object A i.e., \(T_i^{q} \cap A = T_i^{q}\) where \(i \in \{0,1,2,3,4,5\}\). The object occupancy vector, \(A_q=\langle a_0a_1 \ldots a_5 \rangle \), where \(a_i=1\) if \(T_i^{q}\) is fully occupied else it is 0, is used to determine the type of the vertex. Let k denote the number of fully occupied UGTs, then for \(k=0\): q is an exterior point of \(\underline{P}\), \(k=6\): interior point, \(k=1\): a \(60^0\) vertex (included angle is \(60^0\)), and \(k=5\): \(300^0\) vertex. For other cases, \(k=2,3, 4\), Type of q is derived based on the incoming (d) and outgoing direction (\(d'\)) at q. If the incoming direction is d, then \(a_j=1\) and \(a_{(j+1)\mod 6}=1\) where \(j=(d+2) \mod 6\). Now, j is incremented until the next 1-bit in \(A_q\), say at \(j'\), \(a_{j'}=1\), then the outgoing direction, \(d'=j'\). A Type 3 vertex is considered as edge point. Type 1, 2 vertices are considered as convex vertices and Type 4, 5 vertices as concave vertices. The construction of \(\underline{P}\) keeps \(A'\) (background) to the right during the traversal. The polygon is traced to the next grid point \(q_n\), type of \(q_n\) is determined and the direction of traversal from \(q_n\) is computed. The traversal continues until the start vertex, \(v_s\) is reached. During the construction of \(\underline{P}\), 4 lists are maintained L, \(L_{\alpha }\), \(L_{\beta }\), and \(L_{\gamma }\), where, L is a doubly linked list of vertices (corner points) of \(\underline{P}\) and \(L_{\alpha }\), \(L_{\beta }\), and \(L_{\gamma }\) simultaneously contain vertices as well as edge points of \(\underline{P}\) in lexicographically sorted order with their respective primary and secondary keys. The primary key for \(L_{\alpha }\) is \(\alpha \) and secondary key is \(\beta \), similarly the primary and secondary keys for \(L_{\beta }\) and \(L_{\gamma }\) can be defined. An index (in increasing order) is assigned to each vertex of \(\underline{P}\) in order of their occurrence in \(\underline{P}\).

3 Finding Shortest Path

To find a shortest path between two points p and q, an appropriate parallelogram, B, is constructed keeping p and q at diagonally opposite corners and then a traversal is made along one of the semi-perimeters. Throughout this work, the object is assumed to lie in sextant 5 and 6, point p is assumed to be above q and the left semi-perimeter is traversed to find shortest path. Three different types of parallelogram are considered depending on the positions of point \(q(\alpha _q,\beta _q,\gamma _q)\). Regions are separated by red lines as shown in Fig. 3 and are determined as follows, q is in Region 1 if \(\beta _q < \beta _p\) and \(\alpha _q < \alpha _p\); q is in Region 2 if \(\alpha _q > \alpha _p\) and \(\gamma _q > \gamma _p \) and finally q is in Region 3 if \(\beta _q < \beta _p\) and \(\gamma _q < \gamma _p\). If q lies on the region separator, then there will be only one shortest path (as object does not have holes) and determining the shortest path is straight-forward. The reason behind the construction of parallelogram is that the semi-perimeters are the shortest distance between the two points (if semi-perimeters lie completely within the object). So, to construct a shortest path the traversal is made along one of the semi-perimeters. During this traversal if the semi-perimeter does not lie completely inside the object, intersection points between the semi-perimeter and the inner cover of the object are determined. The traversal is then guided through those intersection points possibly applying the reduction rules to shorten the path in such a way that the path lies inside the object. It is to be noted that not all intersection points will be important to guide the traversal and are eliminated using few combinatorial rules as explained in Sect. 3.1. The traversal continues this way applying the reduction rules whenever necessary until it reaches q. The reduction rules are explained in Sect. 3.2.

Fig. 3.
figure 3

Three regions and corresponding orientations of bounding parallelogram (a, b, c) (Color figure online)

3.1 Finding Intersection Points

W.l.o.g, let p be always above q in the bounding parallelogram B and \(c_1, q, c_2\) are the vertices in order, to the left of p in anti-clockwise direction. Then the left semi-perimeter of B is defined by \(\overline{pc_1}\) and \(\overline{c_1q}\) (Fig. 3). The procedure CONTROL-POINTS in (Algorithm 1) finds out the points which guide the traversal via the semi-perimeter. If the semi-perimeter \(\overline{pc_1}\),\(\overline{c_1q}\) lies entirely within the object, then the semi-perimeter itself will be a shortest path. Otherwise, the intersection points of \(\overline{pc_1}\) with the inner cover of the object are found out by searching \(L_x, x \in \{\alpha , \beta , \gamma \}\) depending on the orientation of \(\overline{pc_1}\) and stored in \(M_1\) and those of \(\overline{c_1q}\) stored in \(M_2\). If an intersection point \(w_i\) lies on the edge \(v_jv_{j+1}\) of \(\underline{P}\), then its index is set to \(j+0.5\) to maintain the order that it appears after \(v_j\). The lists are further examined and some of the points are removed as they will not be important to find the shortest path. The points in two appropriate lists among \(M_{\alpha }, M_{\beta }, M_{\gamma }\) are considered in pairs and if a convex (concave) vertex is followed by a concave (convex) vertex, then the vertex with greater (lower) index is discarded using REMOVE-POINTS (Steps 1 and 2) (as shown in Algorithm 1). In Steps 3–9, the final list of intersection points M, is formed by concatenating \(p,M_1,c_1\) (if it is inside A), \(M_2\) and q. In steps 16–22, the indices of the pairs of intersection points are checked to find whether they are in increasing or decreasing order and whether the index falls within indices of the extreme two points in M, namely M[1] and \(M[k+k^\prime ]\), where k is the total number of intersection points. The value of \(k^\prime \) indicates whether \(c_1\) has been included in M(\(k^\prime =1\)(Step 5)) or not (\(k^\prime =0\) (Step 8)) (Fig. 4).

Fig. 4.
figure 4

Illustration of removal of unimportant intersection points. Dashed line represents one side of the parallelogram. (a) A concave vertex, \(w_1\), is followed by a convex vertex \(w_2\), \(w_1\) is removed because it has lower index. (b) \(w_4\), a concave vertex with higher index, is removed as it is preceded by a convex vertex, \(w_3\).

If the test in Step 16 succeeds, then three consecutive intersection points in M are removed when \(c_1\) is the second next point from M[i] (Step 18); else next two consecutive points are removed (Step 20). Finally M is the required list. Let \(M=\left\langle p,w_1,w_2,\ldots ,w_k,q \right\rangle \). When the left semi-perimeter of B lies inside \(\underline{P}\), (semi-perimeter of)B is traversed; otherwise, \(\underline{P}\). So \(pw_1\) is traversed along B, then \(w_1w_2\) along \(\underline{P}\), next \(w_2w_3\) along B, again \(w_3w_4\) along \(\underline{P}\) and so on. Such an alternate traversal is made possible by reordering the vertices in Steps 16–22 if the index ordering does not hold.

figure a

3.2 Reduction Rules

While traversing from p via the semi-perimeter of B, the intersection points in M are also encountered to reach q. This path may include convexities which are to be removed to shorten the path. The rules are discussed here. The convexities are detected when the turn at a vertex or the sum of the turns at two consecutive vertices is equal to or greater than \(120^{\circ }\). A clockwise (anticlockwise) change in direction at a vertex is considered as a positive (negative) turn by the corresponding angle. All possible cases are depicted in Fig. 5. A Type 1 vertex makes a turn of \(120^{\circ }\) so it is a convex vertex. Similarly turn at two consecutive vertices of types 22, 21 creates a turn of \(120^{\circ }\) or more and hence create convexities. Pattern 12 and 11 also create convexity.

Fig. 5.
figure 5

Types of convexities present in \(\underline{P}\)

It is to be noted that although a Type \(\mathbf {2}\) vertex is treated as a convex vertex, unlike Type \(\mathbf {1}\) vertex, it alone cannot create a convexity. The proposed algorithm maintains with each vertex, its Type (t), length (l), and the outgoing direction (d). Removal of convexity sometimes requires removal of some or all vertices that are involved in the convexity and the deletion of vertex needs adjustment of those information with vertex that precedes or follows convexity. If the convexity is created by a Type \(\mathbf {1}\) vertex, four consecutive vertices, \(v_0 v_1 v_2 v_3\), where \(v_2\) is the vertex of Type \(\mathbf {1}\) and \(v_3\) is the most recently visited vertex, are considered to apply the rule to remove convexity. On the other hand, if the convexity is created by two consecutive convex vertices (of Type \(\mathbf {22}\) or \(\mathbf {21}\)) then five consecutive vertices \(v_0 v_1 v_2 v_3 v_4\), where \(v_1\) and \(v_2\) are convex vertices and \(v_4\) is the most recently visited vertex; are considered to apply the rule to remove convexity. The type of the start (p) and end (q) vertices are set to \(\mathbf {6}\) since in general the path is found between two points that lie inside the cover. The rules are explained as follows.

Pattern \(<t_1\mathbf {1}t_{3}>\) \(t_1,t_3 \in \{4,5,6\}\)

This pattern implies a convex region created by a single Type \(\mathbf {1}\) vertex and it is preceded or followed by concave vertices. We consider four most recently traversed vertices, \(v_0 (t_0 , l_0 )v_1 (t_1 , l_1 )v_2 (t_2 , l_2 )v_3 (t_3 , l_3 ), v_3\) being the most recent. Depending on the lengths \(l_1\) and \(l_2\), three rules are as follows.

figure b

After application of the rule whichever necessary, if type of any of the vertices is \(\mathbf {3}\) then its length is added to the vertex that precedes it and the vertex is deleted. For example, if the type of vertex \(v_3\) becomes \(\mathbf {3}\) then \(l_3\) is added to length of \(v_2\) and \(v_3\) is deleted. The illustration of rule R1 is shown in Fig. 6. Pattern \(<t_1 t_2 t_3 t_4>\) where \(t_2 , t_3 \in \{1,2\} \) and \(t_1 , t_4 \in \{4, 5, 6\}\).

This pattern implies two consecutive convex vertices followed and preceded by concave vertices. There will be three possible cases depending on the length of \(v_2\) and \(v_3\) as explained in the following rules (illustrated in Fig. 7).

figure c
Fig. 6.
figure 6

Illustration of rules: (a) R11, (b) R12, (c) R13

Fig. 7.
figure 7

Illustration of rules (a) R21, (b) R22, (c) R23

Pattern \(<t_1 t_2 t_3 t_4>\) where \(t_2, t_3, t_4 \in \{1, 2\}\) and \(t_1 \in \{4, 5,6\}\).

This pattern implies a concave vertex (\(t_1\)) is followed by 3 consecutive convex \(t_2 , t_3 , t_4\) vertices. The total turn at these three consecutive convex vertices may be more than \(180^{\circ }\) and if \(l_1 >l_3\) the traversal may enter into a convoluted region which should be avoided to obtain shorter path. This is explained with the help of a sample case shown in Fig. 8. Consider the line h along \(v_2v_1\) and the line \(h'\) in the direction of \(v_2v_3\) projected at \(v'v_4\) (h and \(h'\) meet at \(v'\)). To avoid the convoluted region, a traversal is made from \(v_4\) and every time it reaches a new vertex, a check is made to determine whether it has entered the free region defined by \(v_1,v',v_4\). For example when the traversal is at vertex \(v_{41}\) or \(v_{42}\) or \(v_{43}\), it is on or to the right of the line \(h'\) and below (right of) the line h and hence they are within the convoluted region. When the traversal reaches \(v_5\), it is on the left of \(h'\) and below h which is the free region. The vertices starting from \(v_2\) to \(v_{43}\) are deleted, length \(l'\) from \(v'v''\) and \(l''\) from \(v''\) to \(v_5\) are determined and set accordingly. The type of \(v''\) i.e. \(t''\) is calculated from incoming and outgoing direction at \(v''\) by the formula \((d_{in}-complement(d_{out})+6) \mod 6\). The rule is given below.

figure d

However, if \(l_1 \le l_3\), the convexities can be avoided using Rule 2. One or more concavity can be intruded inside a convex region. In a convex region, we have to find the concavity which is mostly intruded. This checking has to be performed while applying reduction rules. For example, the convexity created by vertices \(v_1,v_2,v_3\), shown in Fig. 9(a) is of type \(<t_11t_3>\) with \(l_1=l_2\). Within the convex region a concave portion is there. To keep the shortest path inside the object the path should pass along the concavity line which is mostly intruded in the convex region (dashed line via \(v'\) as shown in Fig. 9(b)). To locate the required concavity line, the intersection points with line \(v_1v_3\) (dotted line in Fig. 9(b)) are found out by searching the appropriate list (\(L_{\alpha },L_{\beta }, L_{\gamma }\)). If there is no intersection point, then appropriate reduction rule is applied directly. On the other hand, if there are intersection points then a traversal is made in the portion of \(\underline{P}\) starting from one intersection point to the next intersection point to find out the nearest concavity line. For example, in Fig. 9(b) line \(v_1v_3\) intersects \(\underline{P}\) at \(v_1'\) and \(v_3'\). A traversal is made from \(v_3'\) to \(v_1'\), finding distance from every new vertex it meets to \(v_2\) and choosing the one with minimum distance, \(v'\) in this case. So the reduction is made upto \(v'\) via the dashed line. This introduces two new vertices \(v_2'\) and \(v_2''\) and their length and types are adjusted as shown in Fig. 9(c). If the distance of \(v_2\) from \(v'\) is d, then length of \(v_1\) and \(v_2''\) is set to \(l_1-d\) and \(l_2-d\) respectively. Length of \(v_2'\) is set to d and \(v_2\) is deleted.

Fig. 8.
figure 8

Illustration of Rule 3

Fig. 9.
figure 9

Nearest concavity line

3.3 Algorithms

The algorithm FIND-STP (Algorithm 2) takes the inner cover \(\underline{P}\), the lists \(L_{\alpha },L_{\beta },\) and \(L_{\gamma }\), source and destination points, p and q, as input. The point of intersections of B with the semi-perimeter \(\overline{pc_1}\), \(\overline{c_1q}\) are obtained (Steps 3–4) and non-essential points are removed using the procedure CONTROL-POINTS (Algorithm 1) (Step 5). p is appended to the shortest path, \(\pi \). In the while loop (Steps 8–23), each point in M is considered until it reaches q. If M[i] is the corner point \(c_1\), then it is appended to \(\pi \) and then reduced (Steps 10–11). The procedure REDUCE uses the reduction rules to remove the convexity in \(\pi \). In Steps 15–16, M[i] is added and reduction rules are applied if needed. In Step 17, the portion of \(\underline{P}\) between M[i] a 19, \(M[i+1]\) is added to \(\pi \) and reduced if needed.

In the procedure TRAVERSE in Algorithm 3, if the index of M[i] is less than that of \(M[i+1]\), then \(\underline{P}\) is traversed in an anticlockwise manner (Steps 1–11); otherwise, \(\underline{P}\) is traversed clockwise (Steps 12–22). In Steps 2–3, \(l^\prime \) and \(l^{\prime \prime }\) indicate the pointers to the neighbor vertices of M[i] and \(M[i+1]\) in \(\underline{P}\), taken appropriately. After adding \(\underline{P}[l^\prime ]\) to path \(\pi \) (Step 4 or 15), each vertex on the path is appended to \(\pi \) in the while loop (Steps 7–11 or 18-22) until the vertex \(\underline{P}[l^{\prime \prime }]\) is reached. Appropriate reduction rules are applied by calling REDUCE in Steps 5 and 16, 9 and 20 as and when necessary. Procedure REDUCE is explained in Sect. 3.2 with reduction rules, and procedure SEARCH is used to search intersection points of the boundary of \(\underline{P}\) with the semi-perimeter of the bounding parallelogram.

figure e

4 Time Complexity

To compute the running time of the proposed algorithm let us look at the steps involved and the cost of each step. Initially the inner cover of the object is computed by the algorithm presented in [4] which costs O(n / g) time, n being the number pixels in the perimeter of the object and g is the grid size. During the construction of inner cover three sorted lists \(L_{\alpha },L_{\beta }\) and \(L_{\gamma }\) are also constructed in \(O(n/g \log n/g)\) time. The intersection points on the inner cover of the object with the semi-perimeter of the parallelogram are found by searching \(L_{\alpha }\) or \(L_{\beta }\) or \(L_{\gamma }\) in \(O(\log n/g)\) time. The algorithm to find shortest path uses control points to reach the destination and applies reduction rules whenever necessary. Reductions can be performed in O(1) time. So, the overall running time of the algorithm amounts to \(O(n/g)+O(n/g \log n/g)+O(\log n/g) + O(1) \simeq O(n/g \log n/g)\).

Fig. 10.
figure 10

Shortest Path of three different objects with \(g=8\) and \(\#\) monotone paths, m, {(a), (b)} Kangaroo, {(c), (d)} Device

Fig. 11.
figure 11

Shortest Paths of two different objects with \(g=8\) from single source (black) to multiple destinations (red) (Color figure online)

5 Experimental Results and Analysis

The proposed algorithm is implemented in C in Ubuntu 12.04, 64-bit, kernel version 3.5.0-43-generic, the processor being Intel i5-3570, 3.4 GHz FSB and tested exhaustively to show the efficacy and correctness of the algorithm. Two instances of shortest paths for two different objects along with the bounding parallelogram (purple) through which the shortest path is calculated are shown with \(g=8\) in Fig. 10. The number of monotone sub-paths (m) with different colors are also shown under each object in the results. Figure 11 also shows shortest paths from a single source to multiple destinations for two different objects. It is evident from the results that the reported shortest path is not only the shortest path between the two points but also there exists a set of shortest paths having same path-length and our algorithm reports one of the paths between the two points.

6 Conclusions

A combinatorial algorithm to find a shortest triangular path between two points inside a digital object is presented here, which is not unique. Our algorithm reports one of the shortest triangular paths. Thus in future, this work can be extended to determine all shortest paths between two points. The number of monotone triangular sub-paths depends on the position of the two points inside the digital object and also on the shape of the object. The number of monotone triangular sub-paths and other related properties, e.g., length of the path, distance between two points, can be used to determine shape complexity of the object. These metrics will also be useful for determining shape signatures.