1 Introduction
The travelling salesman problem (TSP) is one of the best studied problems in operational research. This is not only due to the numerous appearances of the TSP in various practical applications, but also due to its pivotal role in developing and testing new research methods. We refer the reader to the books by Applegate, Bixby, Chvátal & Cook [2], Gutin & Punnen [14], and Lawler, Lenstra, Rinnooy Kan & Shmoys [18] for a wealth of information on these issues. We also emphasize the role of the TSP in education and in the popularization of science. There is hardly any text book on operational research where the TSP would not be mentioned. The book [4] of Cook is an excellent example of how the TSP is used in the popularization of science.
An instance of the TSP consists of cities together with an symmetric distance matrix that specifies the distance between any pair and of cities. The objective in the TSP is to find a shortest closed route which visits each city exactly once; such a closed route is called a TSP tour. In the PathTSP the instance also specifies two cities and (with ), and the goal is to find a shortest route starting at city , ending at city , and visiting all the other cities exactly once. Both the TSP and the PathTSP are NPhard to solve exactly (see for instance Garey & Johnson [11]), and both problems are APXhard to approximate (Papadimitriou & Yannakakis [20]; Zenklusen [21]). These intractability results hold even in the metric case, where the distances between the cities are nonnegative and satisfy the triangle inequality. Given the intractability of TSP and PathTSP, the characterization of tractable special cases is of obvious interest and forms a wellestablished and vivid branch of research.
Polynomially solvable cases of the TSP.
The literature contains an impressive number of polynomially solvable cases for the classical TSP, as certified by the surveys of Burkard & al [3], Deineko, Klinz, Tiskin & Woeginger [5], Gilmore, Lawler & Shmoys [12], and Kabadi [15], and the references therein. We now briefly discuss three tractable cases of the TSP that are relevant for the current paper.
In the socalled ConvexEuclidean TSP, the cities are points in the Euclidean plane which are all located on the boundary of their convex hull. A folklore result says that the optimal tour in the ConvexEuclidean TSP is the cyclic walk along the convex hull, taken either in clockwise or in counterclockwise direction. If we number the cities as in clockwise order along the convex hull, then the cities satisfy the socalled quadrangle inequalities:
(1)  
(2) 
These quadrangle inequalities state the fact that in a convex quadrangle, the total length of two opposing sides is less or equal to the total length of the two diagonals. Kalmanson [16] observed that whenever a TSP instance satisfies these quadrangle inequalities (1)–(2), the tour is a shortest TSP tour. This extends the tractability of the ConvexEuclidean TSP to the tractability of the TSP on socalled Kalmanson matrices, where the distances satisfy (1)–(2). We stress that the class of Kalmanson distance matrices is large and goes far beyond the ConvexEuclidean case: Consider for instance a rooted ordered tree with nonnegative edge lengths, place a city in each of the leaves, and number the cities from left to right. Then the shortest path distances between cities and determine a Kalmanson matrix, as the inequalities (1) and (2) can easily be verified for any quadruple of leaves. Finally, we mention the TSP on Demidenko matrices, where the distances satisfy
(3) 
Note that condition (3) coincides with condition (1). Hence Demidenko matrices form an obvious generalization of Kalmanson matrices, and it is known that this generalization is proper. A famous result of Demidenko [8] shows that the TSP on Demidenko matrices is solvable in polynomial time. The gist of this paragraph is that the ConvexEuclidean TSP, the TSP on Kalmanson matrices, and the TSP on Demidenko matrices form three tractable TSP cases of strictly increasing generality.
Polynomially solvable cases of the PathTSP.
Whereas the literature on polynomially solvable cases of the classical TSP forms a rich and comprehensive body, we are only aware of a single result on polynomially solvable cases of the PathTSP: Garcia & Tejel [9] derive an algorithm for the PathTSP with cities on ConvexEuclidean distance matrices. The followup work [10] by Garcia, Jodra & Tejel uses sophisticated search techniques to improve the time complexity to linear time . Figure 1 provides an example for the ConvexEuclidean PathTSP, which is taken from Figure 3 in [9]; this example illustrates the diverse and manifold shapes of TSPpaths under ConvexEuclidean distances.
Now by looking deeper into the papers [9, 10] and by carefully analyzing the flow of arguments, one realizes that the approach does not exploit any geometric property of the ConvexEuclidean case that would go beyond the quadrangle inequalities (1)–(2). In other words, the arguments in [9, 10] do not only settle the PathTSP on ConvexEuclidean distance matrices, but they do also yield (without additional effort, and without changing a single letter) a polynomial time solution for the PathTSP on Kalmanson matrices. Note that this step from ConvexEuclidean matrices to Kalmanson matrices for the PathTSP runs perfectly in parallel with the step from ConvexEuclidean matrices to Kalmanson matrices for the classical TSP.
Contribution and organization of the paper.
In this paper we take the logically next step in this line of research and show that the PathTSP is polynomially solvable on Demidenko matrices. This substantially generalizes and extends the results in [9, 10] for the PathTSP on ConvexEuclidean matrices and Kalmanson matrices. We first analyze the combinatorial structure of an optimal TSPpath on Demidenko matrices, and prove that there always exists an optimal solution of a certain strongly restricted and nicely structured form. Then we show that we can optimize in polynomial time over the TSPpaths of that nicely structured form. By combining these results, we get our polynomial time result for Demidenko matrices.
The remainder of the paper is organized as follows. In Section 2 we summarize definitions and notations related to paths and tours as well as concrete matrix classes of relevance in this paper. In Section 3 we introduce the concept of forbidden pairs of arcs and show that for arbitrary cities and there always exists an optimal TSPpath which does not contain forbidden pairs of arcs. Then we show some implications of this result in terms of the solution of the PathTSP for and , and of structural properties of the optimal solution of the problem in the more general case with and arbitrary . Section 4 shows how to exploit the findings presented in Section 3 to efficiently solve the PathTSP for and for arbitrary by dynamic programming. Finally, Section 5 shows how to efficiently solve the PathTSP in the most general case, where there are no restrictions on and . Section 6 concludes the paper with some final remarks.
2 Definitions, notations and preliminaries
In this section we summarize various definitions and notations that will be used throughout the rest of the paper.
2.1 Paths and tours
We consider a set of cities with a symmetric distance matrix . We use the notation for the set of all integers between and , for any two integers , and with .
A tour visiting cities, , is a sequence with , and , for all , such that every city from except for is contained at most once in the sequence. We say that the tour visits the cities , , . A tour visiting all cities is called a TSP tour. A tour is called pyramidal if there exists an such that , and hold. A TSP tour which is pyramidal is called a pyramidal TSP tour.
An path visiting cities is a sequence of cities which starts at , ends at , and contains every city from exactly once, where , . An TSPpath is an path visiting all cities. An path is called pyramidal if there exists an index such that and . An path is called pyramidal if there exists an index such that and . (In the last two definitions one of the chains of inequalities would become obsolete if or .)
Given a tour or an path and two indices , , then is called the successor of in and is called the predecessor of in
. An ordered pair
, for , is called an arc in . If (), is called an increasing arc (decreasing arc). An path such that all its arcs are increasing (decreasing) arcs is called a monotone increasing path (monotone decreasing path). For a city in is called a peak in if and . A city is called a valley in if and . Thus a peak (a valley) in an path is a city which is reached along an increasing (a decreasing) arc and is left along a decreasing (an increasing) arc. The first city of an path () is called a peak if and a valley if . The last city of an path () is called a peak if ) and a valley if . Given a tour or an path and two indices , , the subsequence of starting at city and ending at city is called the subpath of .Next we introduce the four quantities , , , and for integers , which represent the lengths of certain pyramidal paths or pyramidal paths in the following way: For with denote by the length of a shortest pyramidal path visiting the cities . Notice that due to the symmetry of the distance matrix is also the length of a shortest pyramidal path visiting the above set of cities. Clearly in a pyramidal path as above city is either the successor of or the predecessor of . Analogously in a pyramidal TSPtour city is visited right before or right after city . Thus the optimal length of a pyramidal tour equals . If , then and the corresponding path consists just of the arc .
For , , let be the length of a shortest pyramidal path which visits the cities (and also the length of a shortest pyramidal path visiting the above set of cities). Clearly in a pyramidal path as above city is either the successor of or the predecessor of . If , then and the corresponding path consists just of the arc .
Next we introduce notations for the length of shortest pyramidal paths and shortest pyramidal paths which visit contiguous sets of cities, i.e. sets of cities which consist of all cities between and for some pair of cities , .
For , , let be the length of the shortest pyramidal path which visits the cities . Due to the symmetry of the distance matrix is also the length of a shortest pyramidal path which visits the set of cities as above. In the special case , is the length of the monotone increasing path through the cities .
For , , let be the length of a shortest pyramidal path visiting the cities (and also the length of a shortest pyramidal path visiting the above set of cities). In the special case , is the length of the monotone increasing path through the cities .
If or we omit the subscript or in , , , , and use simply , and , , respectively.
Observe that for every , the quantities with , , can be computed in time by the dynamic programming recursions (4)(5). Analogously for every , the quantities with , , can be computed in time by the recursions (6)(7).
(4)  
(5) 
(6)  
(7) 
In particular the entries and the entries , , , can be computed in time.
Summarizing we get the following result:
Observation 2.1
The quantities for , with , can be computed in time. Analogously the quantities for , with , can be computed in time. The quantities and with , can be computed in time.
Since, as mentioned above, the optimal length of a pyramidal tour equals Observation 2.1 implies the following result known already in the 1970’s.
Theorem 2.2
The quantities , with , , and , with , , can also be computed efficiently by dynamic programming as shown in the following simple observation. We set or , for or , respectively.
Observation 2.3
The quantities with , , and with , , can be computed in time. In particular, for and the quantities with , , and , with , , can be computed in time.
Proof. For the quantities the claim follows directly from Observation 2.1 and the following equalities which hold for any triple in the given range of indices:
Analogously, for the quantities the claim follows directly from Observation 2.1 and the following equalities which hold for any triple in the corresponding range of indices:
Clearly the quantities can be computed in a preprocessing step in time for all pairs with and .
In what follows we assume that all quantities , , , with indices in their corresponding ranges are computed in a preprocessing step. Moreover we use the straightforward relationships
Finally let us notice that we will use a schematic representation of paths to illustrate their combinatorial properties. An TSPpath , , visiting the cities for , is visualized on an grid by placing city in the grid node with coordinates . For example, Figure 2(a) shows the shortest TSPpath , , for the set of points in Figure 3. The schematic representation of is shown in Figure 2(b).
2.2 Classes of matrices
A symmetric matrix is a Kalmanson matrix if it satisfies the Kalmanson conditions in (1)–(2), and is a Demidenko matrix if it satisfies the Demidenko conditions in (3). Note that a principal submatrix of an Kalmanson (Demidenko) matrix obtained from by deleting the rows and columns with indices in a subset , , is again a Kalmanson (Demidenko) matrix. The reversed matrix results from matrix by simultaneously reversing the order of rows and columns in ; in other words, the matrix is specified by . A reversed Kalmanson (Demidenko) matrix is again a Kalmanson (Demidenko) matrix.
The example in Figure 3 shows that the Demidenko matrices form proper superset of the Kalmanson matrices. It can be checked that the distance matrix of the Euclidean distances of these points in the Euclidean plane is a Demidenko matrix but not a Kalmanson matrix. Indeed, some points lie far from the boundary of the convex hull of all points and the matrix of their Euclidean distances is not even a permuted Kalmanson matrix. We refer the reader to Deineko, Rudolf, Van der Veen & Woeginger [6] for an explicit characterization of Euclidean sets of points that satisfy the Kalmanson conditions or the Demidenko conditions.
Back in 1979, Demidenko [8] proved that an optimal TSP tour on a set of cities with a Demidenko distance matrix can be found among the pyramidal TSPtours. Together with Theorem 2.2 this implies the following result:
Theorem 2.4
(Demidenko [8])
For an city TSP instance with a Demidenko distance matrix, an optimal TSP tour can be found
among the pyramidal TSP tours; hence it can be determined in time.
Throughout this paper, we will assume that all considered distance matrices have nonnegative entries. This assumption can be made without loss of generality, as Demidenko matrices can be transformed into nonnegative Demidenko matrices by simply adding a sufficiently large constant to each entry. Clearly the PathTSP with a distance matrix and the PathTSP with a distance matrix for some are equivalent, in the sense that the sets of their optimal solutions coincide.
3 Forbidden pairs of arcs and structural properties of optimal TSPpaths starting at city
In this section we investigate the combinatorial structure of optimal TSPpaths in the case where the distance matrix of the cities is a Demidenko matrix. An essential concept used in our investigations is that of a forbidden pair of arcs. We show first that there always exists an optimal TSPpath which does not contain forbidden pairs of arcs. As implications of this fact we obtain the solution of the PathTSP and further structural properties of the optimal TSPpath for .
Definition 3.1
In an path a pair of arcs and is called a forbidden pair of arcs if either or holds.
Lemma 3.2
Consider a PathTSP instance with a Demidenko distance matrix . There exists an optimal TSPpath which does not contain forbidden pairs of arcs.
Proof. Let be an optimal (i.e. shortest) TSPpath with some forbidden pair of arcs and . Assume without loss of generality that and that city is reached earlier than city in . Apply a standard transformation technique (see for instance Burkard & al [3]) to construct an optimal TSPpath which does not contain the pair and of forbidden arcs: invert the subpath of into , and replace the forbidden pair of arcs by the new pair of arcs and . Clearly the resulting path is an TSPpath. Moreover the Demidenko conditions (3) imply that , and therefore the length of does not exceed the length of . So is an optimal TSPpath which does not contain the pair and of forbidden arcs. If this path still contains a forbidden pair of arcs we apply the above transformation again and repeat this process as long as the current optimal TSPpath contains a forbidden pair of arcs.
In order to see that this transformation process terminates after a final number of steps consider a potential function which maps any TSPpath to a nonnegative integer . It can easily be seen that the transformation described above reduces the value of the potential function, i.e. . Since the potential function takes only nonnegative integer values the process stops after a final number of steps.
Lemma 3.2 implies the following result on the TSPpaths.
Theorem 3.3
is a shortest TSPpath for the PathTSP with a Demidenko distance matrix.
Proof. We show that any TSPpath with a nontrivial peak, i.e. a peak different form , contains a forbidden pair of arcs. The proof of the lemma is then completed by observing that is the unique TSPpath without a nontrivial peak.
Let be the first peak in a TSPpath . Since is a peak, there is an arc in a subpath of such that . If , then and build a forbidden pair of arcs. If , then on the monotone increasing subpath of there exists an arc such that . By observing that we conclude that the pair and is a forbidden pair of arcs in this case.
The following corollary is a statement about the monotonicity of peaks and valleys in optimal TSPpaths.
Corollary 3.4
Consider a PathTSP on cities with a Demidenko distance matrix. For any , , there exists an optimal TSPpath with peaks decreasing and valleys increasing from the left to the right in the path, i.e. if peak (valley ) is reached earlier than peak (valley ) in the path, than () holds.
Proof. The proof is done by induction on the number of cities. The statement is trivially true for . So assume that .
The correctness of the statement for follows immediately from Theorem 3.3: the TSPpath contains just the (trivial) valley and the (trivial) peak . Thus we assume without loss of generality that and let be an optimal TSPpath. Let , with , , be the subpath of . Since a principal submatrix of a Demidenko matrix is a Demidenko matrix, as mentioned in Subsection 2.2, by applying Theorem 3.3 we can reorder the cities of increasingly and obtain a path of the same length which visits the same cities as . So we can assume without loss of generality that there is no peak in the subpath but , and hence is also the first peak in TSPPath . Now we distinguish two cases: (a) the last city is the smallest city in the subpath of and (b) there is a city with in the subpath of . In Case (a) we can assume without loss of generality that there are no other peaks but in the subpath of (by applying similar arguments to the one mentioned above for the subpath of ); this assumption is justified by Theorem 3.3 and by the fact that a reversed Demidenko matrix is a Demidenko matrix. So. we assume w.l.o.og. that the subpath of is monotone deareasing the statement of the corollary holds in this case. (Notice, that in this case we can find an optimal TSPpath which is pyramidal.)
In Case (b) the subpath from to contains at least one valley which is smaller than . Let be the smallest valley in the subpath of , for . Analogously as for the subpath and for Case (a) we can assume without loss of generality that the subpath of contains no peaks, but . Denote by the subpath of , . Since the distance matrix of the cities visited by is a Demidenko matrix (as a principal submatrix of a Demidenko matrix), the induction hypothesis applies and this completes the proof.
Lemma 3.5
Consider a PathTSP with a Demidenko distance matrix and an optimal TSPpath which contains no forbidden pairs of arcs and such that its peaks decrease and its valleys increase from the left to the right in the path. Let and , , be two consecutive peaks in . Let be the valley that precedes peak . let be the valley that follows and precedes , and let be the valley that follows . Then the following statements hold:

The subpath of contains no city for which holds.

The subpath of contains no city for which holds.
Proof. Figure 4 illustrates the structure of a path with the properties described in the lemma. We prove here only statement (i), statement (ii) can be proved by using similar arguments.
Consider the subpath of and assume that (i) does not hold. Let be the largest city on the subpath such that . If , then and hence , build a forbidden pair of arcs contradicting the assumption of the lemma. If , then on the subpath of there exists an arc such that . In this case and build a forbidden pair of arcs and this contradicts the assumption of the lemma.
In particular, the statements in the above lemma imply that the cities are placed on consecutive positions in path and form a pyramidal subpath of it.
4 Efficient solution of the PathTSP with a Demidenko distance matrix: the case
In this section we first derive recursive equations for the length of an optimal TSPpath through the cities . These equations yield an dynamic programming algorithm for the solution of the PathTSP with a Demidenko distance matrix where the starting city is and the destination city arbitrary.
The recursive equations for . Due to Lemma 3.2, Corollary 3.4 and Lemma 3.5, we consider without loss of generality an optimal TSPpaths which contains no forbidden pairs of arcs, has decreasing peaks and increasing valleys from the left to the right and fulfills the statements of Lemma 3.5. We distinguish two cases: (1) the optimal TSPpath contains no valleys but and , and (2) the optimal TSPpath contains at least one valley with . In the first case the optimal TSPpath is pyramidal and thus . In the second case let , , be the leftmost (and the smallest) nontrivial valley in .
Since is the first peak, valley is reached after in . According to Lemma 3.5 (see also Figure 4 where the role of is played by ), starts with a monotone increasing subpath visiting the cities , followed first by a pyramidal path with the peak , then by a pyramidal path with valley , and so on, until the final city is reached. For cities , , such that and denote by be the length of an optimal path starting at and then visiting the cities of the set with the first peak in this path being , and the valley that follows being . Here could also coincide with , in which case would be reached along a decreasing sequence of cities from to . Then the length of the optimal TSPpath is given as follows
(8) 
where is defined as in Subsection 2.1.
Next we give a recursive equation for the computation of the quantities above. To this end denote by the length of an optimal path visiting the cities of the set with first valley and first peak such that precedes , for cities , , such that and . Here could also coincide with in which case would be reached along an increasing sequence of cities from to .
According to Lemma 3.2, Corollary 3.4 and Lemma 3.5 and as illustrated in Figure 5 the values , for with , can be calculated by the following recursions:
(9) 
where .
Case . The path has only one peak (since ), starts at , ends at and goes through the cities . The optimal length of the pyramidal path on these cities equals (see the definition before Observation 2.1). This case corresponds to the first line in (9) and is illustrated in Figure 5(a).
Case . In this case there will be another peak (different from ) to the right of the valley . Let this peak be , with according to Corollary 3.4. We again distinguish two subcases: and . If , then according to Lemma 3.5 the path starts with the arc followed by subpath which starts at and goes through the cities , with the first valley in this path being and peak reached after valley . The optimal length of such a path is given by and in this case is calculated as shown in the second line of (9) and illustrated in Figure 5(b).
If , then the path starts with an arc connecting to the leftmost city of a pyramidal path with peak containing the cities and either starting or ending at city . Let the other endcity of this pyramidal path be . Then the length of the path is calculated as shown in the third line of (9) and illustrated in Figures 5(c) and 5(d). These pictures correspond to the cases where above mentioned pyramidal path starts or ends at , respectively.
The values , for with , can be computed recursively in a similar way:
(10) 
where .
Based on equations (8)(10) we obtain the following result about the computation of the optimal TSP path in the case of a Demidenko distance matrix.
Theorem 4.1
Consider a PathTSP on cities with a Demidenko distance matrix. An optimal TSPpath can be found in time.
Proof. Recall that all values , for with , and , for , with , can be calculated in time in a preprocessing step, see Observation 2.3. Further, according to equation (8) the computation of the length of the optimal TSPpath (for ) involves the quantities , for . The quantities , for with , are computed recursively together with the quantities , for with . Observe that the computation of , for some in the corresponding range, just involves quantities for which the difference between the specified peak and valley is strictly smaller than the difference between the specified peak and the specified valley in . Analogously, the computation of , for some in the corresponding range, involves quantities for which the difference between the specified peak and valley is strictly smaller than the difference between the specified peak and the specified valley in . So the recursion would start with the trivial values for with , and for with . The effort needed for the recursive computation of all other values of and is the computation of the minimum over
Comments
There are no comments yet.