Electronic Notes in Discrete Mathematics 17 (2004) 111–115 www.elsevier.com/locate/endm
New exponential neighbourhood for polynomially solvable TSPs V.Deineko1 Warwick Business School, Coventry, CV4 7AL, UK
Abstract Many of the well known solvable cases of the symmetric travelling salesman problem (STSP) have been characterized by describing special conditions for the underlying distance matrices. For all these special cases an optimal tour can either be given in advance and without regarding the precise numerical values of the data, or can efficiently be found in the set of so-called pyramidal tours. We introduce a new polynomially solvable case of the STSP where an optimal tour can be found in an exponential neighbourhood which is different from the set of pyramidal tours. Our new case is the first example of ”multi-peak” optimization for polynomially solvable STSPs. Keywords: Traveling salesman problem, specially structured matrices, exponential neighbourhood, recognition algorithm
1
Introduction
The travelling salesman problem (TSP) is a well known problem of combinatorial optimization. In the symmetric TSP (STSP), given a symmetric n × n τ of the set distance matrix C = (cij ), one looks for a cyclic permutation n c . Items in the {1, 2, . . . , n} that minimizes the function c(τ ) = i=1 iτ (i) permutation is usually referred as points or cities. A pair [i, j] with j = τ (i) is referred as an arc of the tour τ . Although the STSP is NP-hard, there are quite a few special cases when the problem can be solved in polynomial time [4,2,6]. Many of the well known solvable cases of the STSP have been characterized by describing special conditions for the underlying distance matrix. For all such special cases an optimal 1
Email:
[email protected]
1571-0653/$ – see front matter © 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.endm.2004.03.015
112
V. Deineko / Electronic Notes in Discrete Mathematics 17 (2004) 111–115
tour can either be identified in advance, or can be found in the set of so-called pyramidal tours. We introduce a new polynomially solvable case of the STSP where an optimal tour can be found in an exponential neighbourhood which is different from the set of pyramidal tours. Our new case is the first example of ”multi-peak” optimization for polynomially solvable STSPs.
2
TSP on Relaxed Kalmanson Matrices
New exponential neighbourhood. A symmetric n × n matrix C = (cij ) will be called a relaxed Kalmanson [7] matrix (RK-matrix), if it satisfies the condition cik + cjl ≥ cil + cjk for all indices i < j < k < l. It can be shown that these conditions can be checked in O(n2 ) time. Cyclic permutation π will be called N -permutation if it does not contain pairs of arcs [i, π(i)], [j, π(j)] such that i < π(i) and j > π(i) > π(j) > i, or i < π(i) and π(i) > j > i > π(j). Properties of N -permutations are characterized in the next lemmas. Lemma 2.1 An optimal tour for the STSP with an RK-matrix can be found among N -permutations. Lemma 2.2 Every N -permutation contains arc [1, n]. Lemma 2.3 A structure of the path from 1 to n in an N -permutation, to which we will refer as the N -structure, can recursively be defined as follows: If there is no valley on the path from 1 to n, then this is the path 1, 2, . . . , n − 1, n. Otherwise let j be the minimal valley in the path from 1 to n. In this case the path has the structure 1, 2, . . . , j − 1, k, {j + 1, j + 2, . . . , k − 1}, j, {k + 1, k + 2, . . . , n − 2, n − 1}, n where k is a peak and the two paths – from j to k through the set {j + 1, j + 2, . . . , k−2, k−1}, and from j to n through the set {k+1, k+2, . . . , n−2, n−1} have the N -structure. In the Lemma above the sets are meant to be empty if the first index in the set is bigger than the last one. Figure 1(a) illustrates the definition of the N -structure. Figure 1(b) shows a permutation that satisfies the definition: path 1, . . . , 15 has 2 as the minimal valley, so j = 2 and k = 14; for the path 2, . . . , 14 the corresponding pair (j, k) is (3, 9), and so on. It can be seen from the definition of the N -structure, that N -permutations belong to the set of so-called twisted permutations ([1]). It means that the optimal TSP tour can be found in O(n7 ) time using the algorithm for finding an optimal twisted permutation ([3]). The special structure of N -permutations allows us to find an optimal solution much faster, as shown in the theorem below.
V. Deineko / Electronic Notes in Discrete Mathematics 17 (2004) 111–115 n k
113 15
14 13
n−1
12
k+1 k−1
11
9
10
8
j+1 6
j
j−1
7
5
3
4
2
3
1
1
2
1
(a)
1
(b)
Fig. 1. Illustration to N -permutations: (a) – definition of N -structure; (b) – example of an N -permutation.
Theorem 2.4 The STSP with an RK-matrix as a distance matrix can be solved in O(n4 ) time. Proof. Let L[p, q] be the length of the shortest path with the N -structure from index p to index q through the set of indices {p + 1, p + 2, ..., q − 2, q − 1}, p < q, and V [j, p, q] be the length of the shortest path with N -structure from index j to index q through the set of indices {p, p + 1, ..., q − 2, q − 1}, j < p < q. It follows from the definition of the N -structure that the values L and V satisfy the following recursions: ⎧ q−1 ⎪ ⎪ ⎪ ct,t+1 ⎪ ⎨ t=p L[p, q] = min j−2 ⎪ ⎪ ⎪ ⎪ min c + c + L[j, k] + V [j, k + 1, q] j
⎧ ⎪ cjp , ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎧ V [j, p, q] = ⎪ ⎪ ⎪ ⎨ cjp + L[p, q] ⎪ ⎪ k−1 ⎪ min ⎪ ⎪ ⎪ ⎪ c + c + V [p, k + 1, q] min ⎪ ⎪ k jk t,t+1 ⎩ ⎩
if p > q,
otherwise.
t=p
If in the formulae above the upper limit in a sum is smaller than the lower limit, then the sum is zero. The length of the optimal tour can be calculated as L[1, n] + cn1 . Each of the values L can be calculated in O(n2 ) time, each of the values V can be calculated in liner time. It gives O(n4 ) overall complexity. The lemma is proved. Recognizing permuted RK-matrices. Unfortunately the problem of
114
V. Deineko / Electronic Notes in Discrete Mathematics 17 (2004) 111–115
1
2
3
4
5
6
7
8
9
10
(a) (96,81) (67,37)(67,34)(79,17)(89,4) (3,51) (12,54)(12,79)(7,100) (3,121) (b) (28,114)(21,13) (1,18) (2,41) (0,51)(21,83)(25,83)(70,88)(94,95)(107,99)
r10 r1
r9 r1
r8 r6 r7
10 r9 r
r5 r4
rr2 3 r4
r3
r5
(a)
r8
6r r7
r2
(b)
Fig. 2. Euclidean RK-sequences of points with coordinates: 1, 5, 4, 3, 2, 7, 6, 8, 9, 10, 1; (b) optimal tour is 1, 7, 6, 5, 4, 3, 2, 8, 9, 10, 1.
(a) optimal tour is
recognizing permuted RK-matrices remains open. For the STSP with the Euclidean distance matrices, however, the problem can be solved in polynomial time. Theorem 2.5 It can be decided in O(n4 log n) time whether an n × n matrix C = (cij ) is a permuted Euclidean RK-matrix. If it is, a permutation σ such that (cσ(i),σ(j) ) is an RK-matrix is explicitly determined within this time bounds. Examples of Euclidean sets of points, for which the corresponding distance matrices are RK-matrices, are shown on Figure 2.
References [1] F. Aurenhammer, On-line sorting of twisted sequences in linear time. BIT, 28, 1988, 194–204. [2] R.E. Burkard, V.G. Deineko, R. van Dal, J.A.A. van der Veen, G.J. Woeginger. Well-solvable special cases of the TSP: A survey. SIAM Review 40, 3, 1998, 496–546. [3] V.G. Deineko, G.J. Woeginger. A study of exponential neigborhoods for the travelling salesman problem and for the quadratic assignment problem. Mathematical Programming, 87, 2000, 519–542.
V. Deineko / Electronic Notes in Discrete Mathematics 17 (2004) 111–115
115
[4] P.C. Gilmore, E.L. Lawler and D.B. Shmoys. Well-solved special cases. Chapter 4 in [8], 87–143. [5] G. Gutin and A.P. Punnen, The travelling salesman problem and its variations. Kluwer Academic Publishers, 2002. [6] S.N. Kabadi, Polynomially solvable cases of the TSP, Chapter 11 in [5], 489–583. [7] K. Kalmanson, Edgeconvex circuits and the traveling salesman problem, Canadian Journal of Mathematics 27, 1975, 1000–1010. [8] E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys. The Traveling Salesman Problem. Wiley, Chichester, 1985.