A GENERALIZATION OF THE CONVEX-HULL-AND-LINE TRAVELING SALESMAN PROBLEM

Two instances of the traveling salesman problem, on the same node set { 1 , 2 , … , n } 
but with different cost matrices C and C ′ 
, are equivalent iff there exist { a i , b i : i = 1 , … , n } such 
that for any 1 ≤ i , j ≤ n , i ≠ j , C ′ ( i , j ) = C ( i , j ) + a i + b j [7]. One of the well-solved special cases 
of the traveling salesman problem (TSP) is the convex-hull-and-line TSP. We extend the solution 
scheme for this class of TSP given in [9] to a more general class which is closed with respect to 
the above equivalence relation. The cost matrix in our general class is a certain composition of 
Kalmanson matrices. This gives a new, non-trivial solvable case of TSP.


Introduction
Let G be a complete, directed graph on node set N {1, 2, ..., n} and let C v) } be an n x n cost matrix, such that the cost of traversing arc (u, v) is c(u, v) Vu, v e N, u v. Then, the Traveling Salesman Problem (TSP) is to find a minimumcost tour of G that visits each node exactly once. If graph G is undirected (and hence, the cost matrix C is symmetric), then we have the Symmetric TSP (STSP).
If each node in the node set N can be associated with a point in the 2-dimensional Euclidean plane, such that the coefficients of C are precisely the Euclidean distances between the respective pairs of points, then we have the Euclidean TSP (ETSP).
The general TSP, and even its special cases STSP and ETSP, are NP-hard [10].
Hence, researchers have identified many combinatorial structures which guarantee that TSP limited to the structure is solvable in polynomial time. TSP limited to such a structure is a polynomially solvable case of TSP. To exploit any such cases, it is necessary to be able to recognize that a given instance of TSP belongs to such T The Research was partially supported by NSERC (Canada) research Grant A8085 awarded to S.N. Kabadi. a case. Special cases of TSP which are recognizable in polynomial time are known as polynomially testable cases of TSP. The importance, in practice, of identifying a large number of polynomially solvable and polynomially testable cases is that it may allow us to approximate a given instance of TSP by one of the polynomially solvable cases, thereby obtaining a good approximate solution to the given problem. For an extensive list of references on polynomially solvable cases, we refer the reader to [3], [6] and [11]. Two instances of the TSP, on the same node set N {1, 2, ..., n} but with different cost matrices C and C , are said to be equivalent if for any two tours, and -', on N C(') -C(r') C'(r) -C'(r'). It has been shown by Chandrasekaran [7] (see also [11]) that two instances of the TSP, on the same node set N but with different cost matrices C and C', are equivalent iff there exists {a, bi i 1, 2, ..., n} such that for any 1 <_ i, j < n, i j, C'(i, j) C(i, j) +hi +bj. It is our conjecture that the class of polynomially solvable and polynomially testable instances of the TSP is closed under the above equivalence relationship.
One of the well-known solvable cases of TSP is the pyramidal TSP. An instance of TSP, with a given ordering of nodes in the set N, is said to be pyramidal if there exists an optimal tour which is pyramidal (i.e., of the form (1, ul, u2, uk, n, vl, v2, ..., v-k_2, 1) where, u < u2 < < u < n > Vl > V2 > > Vn--k--2. The significance of this case lies in the fact that, while the total number of pyramidal tours is exponential in n, an optimal pyramidal tour can be determined in O(n2) time (see [11]). During the last four decades, researchers have identified several sets of polynomially testable sufficiency conditions for a given instance of TSP to be pyramidal (see [3], [4], and [6] for details). One of these conditions, which is of interest to us in this paper, is the Kalmanson condition [12]. Kalmanson TSP (see definition in section 2) is a generalization of the convex-hull TSP which is an Euclidean TSP in which n points lie on the boundary of a convex polygon. The class of Kalmanson TSP is much larger (see [12] and [6]) than the convex-hull TSP. Another solvable case, that is of interest to us in this paper, is the Euclidean convex-hull-and-line TSP [9] in which, for some m < n, m points lie on the boundary of a convex polygon and the remaining (nm) points lie on a straight line inside this convex polygon. Deineko et.al. [9] have given an O(m(n-m)) dynamic programming scheme for this special case and they point out that their scheme extends to the case where the distances between the points are measuxed using any metric, provided that for the points in the interior of the convex polygon the following linearity property holds: there exists an ordering of these points such that for any i < j < k, C(i, j) +CO, k) C(i, k).
One way of looking at the convex-hull-and-line TSP is as follows: if we extend the line, in the interior of the convex polygon, it divides the boundary of the convex polygon into two parts:the part above the line and the part below the line. The set of n points can thus be partitioned into: the set N1 of points on the boundary above the line, the set N2 of points on the boundary below the line, and the set N3 of points on the line. If we delete any one of these three sets of points, all the remaining points lie on the boundary of some convex polygon. Thus convexhull-and-line TSP can be looked upon as a certain composition of three convex-hull TSP's. In this paper, we consider a proper generalization of this case to a similar composition of Kalmanson matrices and show that a similar dynamic programming scheme yields a solution to the general case. Since it is known that the class of Kalmanson TSP is much larger than the class of convex-hull TSP, we have a much larger solvable class. Our general class of TSP is closed with respect to the equivalence relationship. Furthermore, we show that our more general class can be tested in O(n4) time.
In section 2 we discuss notation, definitions and some basic results. Section 3 contains our main results. Here, we give a polynomial scheme for the generalization of the Euclidean convex-hull-and-line TSP. Finally, in section 4, we introduce a new generalization of Kalmanson matrix, that gives us another new polynomially solvable class of TSP.
The results in this paper were initially reported in [5].

Notations, definitions, and some basic results
For any two distinct nodes u, v N, (u, v) denotes an edge connecting u and v or an arc from u to v (depending on the context). Two edges (u, v) and (w, x) are said to be adjacent if they share at least one node (i.e., I{u, v} r {w, x}l > 1. A path, #, from a node u to a node v (or between node u and node v) is a sequence of arcs (or edges) of the type (i0, i) -(i, i2) -(i,, i(m+)) where, i0 u and i(,+) v. We shall refer to such a path by (i0, i, i, i,, i(,+)) and we shall say that the path p covers the node set {io, i, i2, ..., i,, i(,+1)} or that the path # is on the node set {i0, i, i2, ..., ira, i(,+)}. The node set {i, i2, ..., ira} is the set of interior nodes of/. The path/ is simple ff all the nodes i0, i, i2, ..., ira, i(,+) are distinct except possibly the end nodes. The path is closed if u v. A Hamiltonian path is a simple path covering the entire node set N. A tour (Hamiltonian cycle) is a closed Hamiltonian path. Two paths P and P2 are edge (or arc) disjoint if P and P2 have no edges (or arcs) in common. Similarly, P and P are node disjoint if P and P2 have no nodes in common. Throughout the rest of the paper, node i represents node i (Modulo n). Thus, node (n + 1) is the same as node 1 etc.
We shall only deal with symmetric TSP and therefore, the cost matrix C, will throughout be assumed to be symmetric. A matrix C' is a cyclic permutation of annxnmatrixCifthereexistsal _< k _< nsuchthat C(i,j) C(n +i +1 -k,n +j +1 -k) for all 1 _< i, j _< n. (It should be noted that by node (n + + 1 k), we mean node ((n +i +1 -k) modulo n)). Thus, row k and column k of C correspond respectively to row 1 and column 1 of C , row (k +1) and column (k -t-l) of C correspond respectively to row 2 and column 2 of C , and so on. Cost of a path #, denoted by C(#), is the sum of the costs of all edges (or arcs) in/.
Definition. Two edges (u, v) and (w, x) intersect if they are non-adjacent and (C(u, v) +C(w, x)) > Max{(C(u, w) q-C(v, x)), (C(u, x) +C(v, w))}. Two paths intersect if an edge in one path intersects an edge in the other path. A path is serf-intersecting if a pair of edges in the path intersect.
The following Fact can be easily verified: Fact 1 Every optimal tour in a symmetric TSP is non self-intersecting. LEMMA 1 Let (Nr, N,, Nb) be disjoint subsets of the node set N and let P be a path on node set N. If for every u N and v Nb every path P9. between u and v, that is on some subset of N -N, intersects P then P cannot be a subpath of an optimal tour on N.
Proof: If a tour on N contains a path P1 as a subpath, then the tour will also contain a subpath P2 on a subset of N-Np and connecting some node u in N to some node v in Nb. Hence, the Lemma follows from Fact 1.
Definition. For n >_ 4, a symmetric n x n matrix, C, is a Kalmanson matrix if (C(u, w) + C(v, x)) >_ Max{(C(u, v) +C(w, x)), (C(u, x) +C(w, v))} for all 1 <_ u < v < w < x < n. The Kalmanson matrix is non-degenerate if strict inequality holds. A Kalmanson TSP is an instance of TSP in which the cost matrix is a Kalmanson matrix.
It is easy to verify that the class of Kalmanson matrices is closed with respect to the equivalence relation defined in the introduction. Kalmanson [12] proved that for a Kalmanson TSP, the tour (1, 2, ..., n, 1) is always optimal. All the principal submatrices and cyclic permutations of a Kalmanson matrix are Kalmanson matrices; and the matrix C', obtained by reversing the order of rows and columns of a Kalmanson matrix, C (i.e., C'(i, j) C(n +1 -i,n +1 -j) for all 1 < i, j _< n) is also a Kalmanson matrix. Kalmanson [12] has shown that for any symmetric TSP on 4 nodes we can label the nodes in such a way that the Kalmanson conditions are satisfied. Burkard et.al. [6] have shown by example that Kalmanson TSP extends beyond convex-huH TSP.
In fact, Kalmanson TSP extends beyond the Euclidean TSP and the statement holds for any number of nodes. To see this, consider any (n n) Kalmanson matrix C which is the cost matrix of an Euclidean TSP. For any i, choose a > C(i, i -1) +C(i -1, i -2) -C(i -2, i). Since, C is the cost matrix of an Euclidean TSP, x}, without loss of generality, we may assume that i = u. If i -1 x then (C(i, w) +C(v, x)) In all that follows, we shall consider, for convenience of exposition, only nondegenerate Kalmanson matrices. All the major results in the paper can be appropriately extended to degenerate Kalmanson matrices by using the standard perturbation technique (see [8]). Thus, throughout the rest of the paper, we shall mean by Kalmanson matrix a matrix such that for all u < v < w < x, edges (u, w) and (v, x) intersect, where the term intersection is as defined before.
Definition. Let C be a symmetric, n x n cost matrix, and for some k < n, let CH be a k x k principal submatrix of C such that CH is a Kalmanson matrix. Without loss of generality, let us assume that rows (and columns) of CH correspond to rows (and columns) 1, 2, ..., k of C. Node set {k +1, k +2, ..., n} will be said to be interior to CH if for all 1 _< u < v < w < x _< k, any two node disjoint paths (u, w) and (v, x/, on any subsets of N intersect. The following Theorem extends a well known result of [13] on Euclidean TSP to Kalmanson matrices. THEOREM 1 Let C be an n x n cost matrix and, for a k < n, let CH be the principal subrnatrix on rows (and columns) 1, 2, ..., k o] C. I] CH is a Kalmanson matrix and the node set (k + 1, k + 2, ..., n} is interior to CH, then the nodes 1, 2, ..., k appear in every optimal tour either in ascending order or in descending order. Proof: Suppose the Theorem is false. Then, there exists an optimal tour % such that for some 1 < u +1 < w < k, r has a subpath P1 of the type (u, ..., w) which does not contain any node in Na {u + 1, u + 2, ..., w -1} and Nb {w + 1, w +2, ..., k, 1, 2, ..., u-1}. Let N be the set of nodes in P1. Then, these sets Na, Nb, and Nr satisfy the condition of Lemma 1 and, therefore, P1 can not be a subpath of an optimal tour. This contradicts the optimality of tour -. 3. Generalization of convex-huH-and-llne TSP We shall consider the following generalization of the convex-hull-and-line TSP: Let N {1, 2, n} be the node set and let C be an n n cost matrix satisfying the following condition: For some 0 no < nl < n2 < n3 n, let us define N {n-I +1, n_l + 2, hi} for 1 _< i _< 3. Let C1,2, C2'3, and C 1,3 be the principal submatrices of C on rows (and columns) N t,2 {1, 2, ..., n2}, N 2'3 = {nt +1, nt +2, ..., n3} and N x,a {1, 2, ..., nx, ha, n -1, ..., n2 +1} respectively with rows and columns arranged in the stated order. Then, each of Ct,9., C2,a, and C 1, is a Kalmanson matrix and node set N3 is interior to C1'. The main result of this section is stated in Theorem 3 which generalizes Theorem 6 of [9]. In Figure 1 we show how various Facts, Lemma, Theorems and Corollaries lead to Theorem 3: Lemma 3, 4 and 5 generalize respectively Lemma 2, 4 and 5 of [9]. Our proof of Lemma 5 is significantly different from the proof of Lemma 5 of [9]. Furthermore, we address the issue of checking whether a given matrix satisfies the conditions of the generalized convex-hull-and-line TSP and we show in the next Theorem that the issue can be resolved in O(n4) time.
It can be easily verified that our general case is closed with respect to the equivalence relation defined before. On the other hand, Deineko et.al. [9] explicitly require that the given problem be a convex-hull-and-line TSP and not just equivalent to one. Given a problem equivalent to the convex-hull-and-line TSP, they require that the equivalent convex-hull-and-line TSP be obtained before using their results. THEOREM 2 It can be checked in O(n4) time if a given cost matrix satisfies the conditions of the generalized convex-hull-and-line TSP. Proof: For a given choice of 0 < nt < n2 < n, testing if C1'2, C2,3, and C ,3 are Kalmanson matrices can be done in O(n) time [6]. If C i,j is a Kalmanson matrix for all 1 < i < j < 3, then for any 1 < i < j < 3, and any distinct nodes u, v, w, x in N ,j appearing in this order in the node-arrangement in the definition of Ni'j, any two node-disjoint paths (u, wl and (v, ..., x), each containing at least one node in N Ni,j, intersect. Else, if for some choice of 1 < i < j < 3, and some distinct nodes u, v, w, z in NiJ, appearing in this order in the node-arrangement in the definition of Ni,j, two node-disjoint paths (u, ..., w) and (v, x), each containing at least one node in N-N,j, do not intersect then it is easy to see that there exists a pair of edges, one edge from each of the two paths, which violate the Kalmanson condition for one of the matrices C ,, C2,, and C , 3 < v < w < z _< n2, edge (u, w) intersects every path of the type {v, x} and edge (v, x) intersects every path of the type (u, w}.
We shall first find the largest number K < n, such that for any 1 _< u < v w < x _< K, edge (u, w) intersects every path of the type (v, ..., x) and edge (v, x) intersects every path of the type (u, ..., w}. If no such K exists, then the cost matrix is not of the generalized convex-hull-and-line type. Else, if the cost matrix is of the required type, then 1 < nl < n2 < K. Hence, we merely have to search for 1 < < n2 < K, such that the corresponding principal submatrices C1'2, C2'a, and C are Kalmanson matrices. We describe our scheme in details below: First check if n2 < 4. This can be done in O(n) time. If the answer is negative, then do the following. Initially, K n, u 1 and v 3.
Step 1  Else, go to step 2.
If the updatod value of K is greater than v + 1, then Increment v by 1 and repeat step 1.
Step 2 For each 1 _< nl < no. _< K, check if C i,j is a Kalmanson matrix for each 1 _< i < j _< 3. (Note that checking if a given matrix is a Kalmanson matrix is O(n2).) If the answer is "yes" for some choice of nl and n., then the given cost matrix is of the required type. Else, it is not of the required type.
It can be readily seen that the overall complexity of the scheme is O(n4). This proves the Theorem. m The problem of checking if there exists an ordering of the nodes in set N uch that the resultant matrix satisfies our condition is more difficult and, as in the case of various other solvable cases such as Demidenko case [6], it remains an open problem. We shall show that an algorithm similar to the one given in [9] can be used to solve the above instance of STSP. As stated before, we assume, for convenience, that all the Kalmanson matrices are non-degenerate and the major themes in this paper can be easily extended to the degenerate case by the standard perturbation technique.
The result below follows from Theorem 1. COROLLARY 1 Nodes in set N , appear in every optimal tour either in the same order in which they appear in the definition o] N '2 or in its opposite order. LEMMA 2 For two non-consecutive nodes u and w in N3, edge (u, w) cannot be in an optimal tour. Proof: Consider any pair of non-consecutive nodes u, w E N3. Let w > u. Let us consider partition (N, N, Nb) of the node set N where, Np {u, w}, N = {u +1, u +2, w -1}, and Nb N -(Np U N). Since, C 1,3 and C '3 are Kalmanson matrices the partition (N, N, Nb) satisfies the condition stated in Lemma 1. Hence, edge (u, w) cannot be in an optimal tour. m Definition. For n2 < u < w _< n, segment [u, w] is the path (u + 1, u + 2, ..., w).
We shall denote by c[u, w] the cost of the segment.
The Lemma below follows easily from Lemma 2.
LEMMA 3 If in an optimal tour, -r*, P is a subpath between (u + 1) and w where nz < u < w < n, and if P contains only the nodes in Na then P is the segment We note here that Deineko, et.al. [9] seem to imply that linearity is required for the last Lemma (Lemma 2 of their article). This is incorrect as should be clear from the 7 x 7 example given above. Even in the case of Euclidean TSP it is possible to generate an example by slightly modifying their example so that the conditions of our problem are satisfied and, yet, linearity is not. We shall now provide one such example.  Example 2: Table 1 shows coordinates of some points on the Euclidean plane. The points are plotted in Figure 2. The distance matrix given by the points satisfy the conditions of a generalized convex-hull-and-line matrix with nl 9 and n2 =14. Yet, the cost matrix given by the points satisfy the conditions of our problem.
The following Lemma gives the rules for inserting a segment between two adjacent nodes in H.
LEMMA 4 Let (a, ) be an edge in H. Then, for n2 <_ u < w <_ n, following are the rules for inserting the segment [u, w] between a and in an optimal tour (a) if 1 <_ a <_ n and a +1, the path from a to is (a, u + 1, ..., w,/3) (b) if nx < a < r2 and a +1, the path from a to is (a, w, ..., u +1,/) (c) if a n2 and l, then u = n2 and (d) if a nl and / nl +l, then w n. Proof.-In case (a) edges (a, w) and (u +1, fl) intersect because C 1,3 is a Kalmanson matrix. Therefore, the rule follows from Fact 1. Similarly, (b) holds because C 2'3 is a Kalmanson matrix. We shall now prove (c). Let us suppose that (c) is false. Then, there exists an optimal tour in which, for some u > n2, segment [u, w] is inserted between the nodes u2 and 1. Then, for P1 (n2, u +1, u +2, w, 1) and P2 {n2, w, w -1, ..., u +1, 1) one of the paths P and P2 is a subpath of the optimal tour. Now, consider the partition (Np, N, Nb) of N where, N {n2, u +1, u +2, ..., w, 1}, N {n2 +1, n2 +2, ..., u} and Nb N -N UN. Since, both C 1' and C 2,3 are Kalmanson matrices, it follows that for any v E Na and x E N, the edge (v, x) intersects both the paths P and P2. By Lemma 1, we have a contradiction to the optimality of the tour. Thus (c) follows. The proof for (d) is similar.
For any r2 < u < v < rt and any edge (a, ) in H, if (u, v, a, ) satisfy the condition of Lemma 4 then we shall say that the edge (a,/) of H is admissible for the segment [u, v]. For two adjacent nodes a and fl in H with a < , the cost of optimally inserting a segment [u, v] for n2 < u < v < n, between a and/ is thus Consider an acyclic digraph D with vertex set {n, n2 + 1, n2 + 2, n} and arcs (i, j) with costs di,j for all n2 <_ i < j <_ n.
LEMMA 5 The problem of finding the best traveling salesman tour reduces to that finding a shortest route from n2 to n in D.
Proof: It follows easily from corollary 1 and Lemma 3 that to every optimal tour, % there corresponds a path,/, from n2 to n in D such that C() _> C(H) + Let #* ((n =)i0, i, i, i(= n)) be a shortest path from n to n in D. Then, C(H) + C(#*) is a lower bound on the cost of the optimal tour. To prove the Lemma, we shall show that the path p* corresponds to a tour r* such that C(H) + C(t*) r* is an optimal tour.
Hence, the Lemma follows.
We have, thus, the following Theorem: THEOREM 3 The generalized convex-hull-and-line TSP can be solved in O(r2(nrl,2)) time.

A generalization of Kalmanson matrix
In the following we introduce a new class of polynomially testable cost matrices which properly includes the class of Kalmanson matrices and for which, the corresponding TSP can be solved in polynomial time. To the best of our knowledge, this class of TSP does not belong to any of the known solvable classes.
We remind the reader that for any integer i, node refers to node i (modulo n).
All the cyclic permutations of a generalized Kalmanson matrix are generalized Kalmanson matrices.
Observe that for n 4 and n 5 condition (i) puts no restriction because every set of four nodes is consecutive in the modulo n sense. For n 4, condition (ii) is equivalent to Kalmanson conditions. Henceforth, we shall assume that n > 4. For n > 4, the class of Kalmanson matrices is a proper subclass of the class of generalized Kalmanson matrices. This will now be shown by an example. Let C be the matrix shown in example 4. The principal submatrix, C on the first six rows and columns and the principal submatrix, C" on the first five rows and columns are also generalized Kalmanson matrices. Since, C(1, 4) +C(2, 3) 34 > 32 C(1, 3) +C(2, 4) none of C, C and C" is a Kalmanson matrix. Hence, for n 5 matrix C", for n 6 matrix C', and for n 7 matrix C is an example of a generalized Kalmanson matrix which is not a Kalmanson matrix. Condition (ii) of the definition of the generalized Kalmanson matrix is instrumental to our result. Although it is stated for 4 _< n _< 6, it holds for all n >_ 4. In the next Lemma we shall show that for n _> 7, condition (ii) follows from condition (i).
Let us define the following two sets of edges: E1 {(u, u +1) 1 _< u _< n}; and E2" {(u, u +2)" 1 <_ u _< LEMMA 8 Every optimal tour contains only the edges in E1 UJE2. Proof: For 4 _< n _< 5, every edge is in E1 kJ E2. Let n _> 6. Suppose that a tour contains an edge (u, v) E1 UE2. Without loss of generality, we may assume that u < v. Then, for Np {u, v}, Na {i'u < < v} and Nb N -Np t2Na condition of Lemma 1 is satisfied. Therefore, the result follows. LEMMA 9 All the edges o] an optimal tour cannot be in E2.
Hence, only (iii) can be a subpath of the optimal tour and, therefore, P ((u +4), (u +2), u, (u +1), (u +3)) is a subpath of -. It is easy to see that there is a unique tour with P as a subpath and containing only edges in E1 E2.

Conclusion
Since the TSP is NP-hard, it is interesting to identify polynomially solvable and polynomially testable cases of it. One of the well known solvable cases is the Kalmanson TSP which generalizes Euclidean convex-hull TSP.
Deineko et.al. [9] have shown that the Euclidean convex-hull-and-line TSP can be solved by an O(m(n -m)) time dynamic programming scheme where m is the number of points on the boundary of the convex-hull and n is the total number of points. They remark that their algorithm extends to the case where the distances between the points are measured using any metric, provided that for the points in the interior of the convex-hull a linearity property holds. The Euclidean convexhull-and-line TSP can be looked upon as a certain composition of three convexhull TSP's. We generalize the Euclidean convex-hull-and-line case to a similar composition of Kalmanson matrices and show that a dynamic programming scheme similar to what Deineko et.al. [9] present yields a solution to the general case which extends beyond the Euclidean TSP and for which the interior points may not necessarily satisfy the linearity property. Our general case is closed with respect to the equivalence relation defined in the introduction. On the other hand, Deineko et.al. [9] explicitly require that the given problem be a convex-hull-and-line TSP and not just equivalent to one. We have shown that our general case can be identified in O(n4) time.
We introduce another new polynomially solvable and polynomially testable case of TSP which generalizes the class of Kalmanson matrices. We develop an O(n) time algorithm for the generalized Kalmanson TSP.