DeepAI

# The Geometric Maximum Traveling Salesman Problem

We consider the traveling salesman problem when the cities are points in R^d for some fixed d and distances are computed according to geometric distances, determined by some norm. We show that for any polyhedral norm, the problem of finding a tour of maximum length can be solved in polynomial time. If arithmetic operations are assumed to take unit time, our algorithms run in time O(n^f-2 log n), where f is the number of facets of the polyhedron determining the polyhedral norm. Thus for example we have O(n^2 log n) algorithms for the cases of points in the plane under the Rectilinear and Sup norms. This is in contrast to the fact that finding a minimum length tour in each case is NP-hard. Our approach can be extended to the more general case of quasi-norms with not necessarily symmetric unit ball, where we get a complexity of O(n^2f-2 log n). For the special case of two-dimensional metrics with f=4 (which includes the Rectilinear and Sup norms), we present a simple algorithm with O(n) running time. The algorithm does not use any indirect addressing, so its running time remains valid even in comparison based models in which sorting requires Omega(n n) time. The basic mechanism of the algorithm provides some intuition on why polyhedral norms allow fast algorithms. Complementing the results on simplicity for polyhedral norms, we prove that for the case of Euclidean distances in R^d for d>2, the Maximum TSP is NP-hard. This sheds new light on the well-studied difficulties of Euclidean distances.

• 13 publications
• 31 publications
• 3 publications
• 1 publication
• 6 publications
• 2 publications
07/17/2018

### On Computing Centroids According to the p-Norms of Hamming Distance Vectors

In this paper we consider the p-Norm Hamming Centroid problem which asks...
12/19/2021

### Parameterized Approximation Algorithms for k-Center Clustering and Variants

k-center is one of the most popular clustering models. While it admits a...
08/22/2019

### Covering convex bodies and the Closest Vector Problem

We present algorithms for the (1+ϵ)-approximate version of the closest v...
05/30/2022

### Fast Distance Oracles for Any Symmetric Norm

In the Distance Oracle problem, the goal is to preprocess n vectors x_1,...
02/18/2020

### Faster Algorithms for Orienteering and k-TSP

We consider the rooted orienteering problem in Euclidean space: Given n ...
09/30/2020

### Approximation of the Double Travelling Salesman Problem with Multiple Stacks

The Double Travelling Salesman Problem with Multiple Stacks, DTSPMS, dea...
10/09/2020

### Lattice (List) Decoding Near Minkowski's Inequality

Minkowski proved that any n-dimensional lattice of unit determinant has ...

## 1 Introduction

In the Traveling Salesman Problem (TSP), the input consists of a set of cities together with the distances between every pair of distinct cities . The goal is to find an ordering or tour of the cities that minimizes (Minimum TSP) or maximizes (Maximum TSP) the total tour length. Here the length of a tour is

 n−1∑i=1d(cπ(i),cπ(i+1))+d(cπ(n),cπ(1)).

Like the Minimum TSP, the Maximum TSP is NP-complete on graphs, even if the triangle inequality holds. After 25 years, the best known performance guarantee for the metric Minimum TSP is still Christofides’s 3/2 approximation algorithm; the results of Arora, Lund, Motwani, Sudan, and Szegedy [4] show that the problem cannot be approximated arbitrarily well, combined with results by Papadimitriou and Yannakakis [26], it follows that this holds even for the special class of instances where all distances are 1 or 2. There has been more development on approximation algorithms for the metric Maximum TSP: Recently, Hassin and Rubinstein [18] have given a 7/8 approximation algorithm.

Of particular interest are geometric instances of the TSP, in which cities correspond to points in for some , and distances are computed according to some geometric norm. Perhaps the most popular norms are the Rectilinear, Euclidean, and Sup norms. These are examples of what is known as an “ norm” for , , and . In general, the distance between two points and under the norm, , is

 d(\bitx,\bity)=(d∑i=1|xi−yi|p)1/p

with the natural asymptotic interpretation that distance under the norm is

 d(\bitx,\bity)=maxdi=1|xi−yi|.

This paper considers a second class of norms which also includes the Rectilinear and Sup norms, but can only approximate the Euclidean and other norms. This is the class of polyhedral norms. Each polyhedral norm is determined by a unit ball which is a centrally-symmetric polyhedron with the origin at its center. To determine under such a norm, first translate the space so that one of the points, say , is at the origin. Then determine the unique factor by which one must rescale (expanding if , shrinking if ) so that the other point () is on the boundary of the polyhedron. We then have .

Alternatively, and more usefully for our purposes, we can view a polyhedral norm as follows. If is a polyhedron as described above and has facets, then is divisible by 2 and there is a set of points in such that is the intersection of a collection of half-spaces determined by :

 \bitP=⎛⎝f/2⋂i=1{\bitx: \bitx⋅\bithi≤1}⎞⎠∩⎛⎝f/2⋂i=1{\bitx: \bitx⋅\bithi≥−1}⎞⎠.

Then we have

 d(\bitx,\bity)=max{∣∣(\bitx−\bity)⋅\bithi∣∣: 1≤i≤f/2}.

Note that for the Rectilinear norm in the plane we can take = and for the Sup norm in the plane we can take = .

For the Minimum TSP on geometric instances, two key complexity questions have been answered. As follows from results of Itai, Papadimitriou, and Swarcfiter [19], the Minimum TSP is NP-hard for any fixed dimension and any or polyhedral norm; see also the earlier results by Garey, Graham, and Johnson [15], and Papadimitriou [25]. On the other hand, results of Arora [3] and Mitchell [23] imply that in all these cases a polynomial-time approximation scheme (PTAS) exists, i.e., a sequence of polynomial-time algorithms , , where is guaranteed to find a tour whose length is within a ratio of of optimal.

The situation for geometric versions of the Maximum TSP has been less clear than for its minimum counterpart. Serdyukov [28], and, independently, Barvinok [6], have shown that once again polynomial-time approximation schemes exist for all fixed dimensions and all or polyhedral norms (and in a sense for any fixed norm; see [6]). Until now, however, the complexity of the optimization problems themselves when is fixed has remained open: For no fixed dimension and or polyhedral norm was the problem of determining the maximum tour length known either to be NP-hard or to be polynomial-time solvable. In this paper, we resolve the question for all polyhedral norms, showing that, in contrast to the case for the Minimum TSP, the Maximum TSP is solvable in polynomial time for any fixed dimension and any polyhedral norm:

###### Theorem 1

Let dimension be fixed, and let be a fixed polyhedral norm in whose unit ball is a centrally symmetric polyhedron determined by a set of facets. Then for any set of points in , one can construct a traveling salesman tour of maximum length with respect to in time in the real number RAM model, where arithmetic operations take unit time and only addition, subtraction, multiplication, and division are allowed.

A similar result also holds for polyhedral quasi-norms

, i.e., asymmetric distance functions that can be defined in terms of “unit balls” that are non-symmetric polyhedra containing the origin. These can again be characterized by a set of vectors

, but now we need a vector for each facet of the polyhedron and . Serdyukov [28, 29] previously showed that for the case of a quasi-norm in with a triangle as the unit ball, the Maximum TSP can be solved in polynomial time. With our techniques we can show the following analog of Theorem 1.

###### Theorem 2

Let dimension be fixed, and let be a fixed polyhedral quasi-norm in whose unit ball is a polyhedron determined by a set of facets. Then for any set of points in , one can construct a traveling salesman tour of maximum length with respect to in time in the real number RAM model.

As an immediate consequence of Theorem 1, we get relatively efficient algorithms for the Maximum TSP in the plane under Rectilinear and Sup norms, with a complexity of .

The restriction to the real number RAM model in Theorem 1 is made primarily to simplify the statements of the conclusions. Suppose on the other hand that one assumes, as one typically must for complexity theory results, that the components of the vectors in and the coordinates of the cities are all rationals. Let denote the maximum absolute value of any of the corresponding numerators and denominators. Then the conclusions of the Theorem hold for the standard logarithmic cost RAM model with running times multiplied by . If the components/coordinates are all integers with maximum absolute value , the running times need only be multiplied by . For simplicity in the remainder of this paper, we shall stick to the model in which numbers can be arbitrary reals and arithmetic operations take unit time. The reader should have no trouble deriving the above variants.

The above results make use of a polynomial solution method for the following TSP variant, which may be of independent interest: When visiting a given set of cities, all connections have to be made via a set of hubs, where is a constant.

The complexity of for the scenario of planar rectilinear distances can be improved by using special geometric properties of this case. We can show the following optimal running time:

###### Theorem 3

The Maximum TSP for points in under the norm can be solved in time.

By appropriate coordinate transformation, this result can be generalized to all planar polyhedral norms with facets, which includes the Sup norm. It holds even in a restricted model of computation, where no indirect addressing may be used, and hence sorting requires time. The main idea behind the algorithm is to exploit the fact that rectilinear distances in the plane have a high degree of degeneracy. As a consequence, we can show that the number of optimal tours is very large, , and the set of optimal tours can be described very easily. This contrasts sharply to the case of Euclidean distances, where there may be a single optimal tour.

Indeed the complexity of the Maximum TSP in under the Euclidean metric remains an open question, although we have resolved the question for higher dimensions with the following result.

###### Theorem 4

Maximum TSP under Euclidean distances in is an NP-hard problem if .

One of the consequences is NP-hardness of the Maximum TSP for polyhedral norms with an unbounded number of facets on the corresponding unit ball. Another consequence concerns the so-called Maximum Scatter TSP, where the objective is to find a tour that maximizes the shortest edge. The Maximum Scatter TSP was first considered by Arkin, Chiang, Mitchell, Skiena, and Yang [2], and the complexity for geometric instances was stated as an open problem. Our result implies NP-hardness for Euclidean instances in 3-dimensional space.

An issue that is still unresolved for the Maximum TSP as well as the Minimum TSP is the question of whether the TSP under Euclidean distances is a member of the class NP, allowing polynomial time verification of a good solution. Even if all city coordinates are rationals, we do not know how to compare a tour length to a given rational target in less than exponential time. Such a comparison would appear to require us to evaluate a sum of square roots to some precision, and currently the best upper bound known on the number of bits of precision needed to insure a correct answer remains exponential in .

The rest of this paper is organized as follows. Section 2 introduces a new special case of the TSP, the Tunneling TSP. We show how the Maximum TSP under a polyhedral norm can be reduced to the Tunneling TSP with the same number of cities and tunnels (and with tunnels for polyhedral quasi-norms). Section 3.1 shows how the solutions for the Tunneling TSP with a fixed number of tunnels can be characterized, setting up an algorithm with a running time of described in detail in Section 3.2. Section 4 describes the linear-time algorithm for rectilinear distances in the plane. Section 5 gives the NP-hardness proof of the Maximum Traveling Salesman Problem for Euclidean distances in , and a number of higher-dimensional extensions. Section 6 concludes with a brief discussion and open problems.

## 2 The Tunneling TSP

The Tunneling TSP is a special case of the Maximum TSP in which distances are determined by what we shall call a tunnel system distance function. In such a distance function we are given a set of auxiliary objects that we shall call tunnels. Each tunnel is viewed as a bidirectional passage having a front and a back end. For each pair of a city and a tunnel we are given real-valued access distances and from the city to the front and back ends of the tunnel respectively. Each potential tour edge must pass through some tunnel , either by entering the front end and leaving the back (for a distance of ), or by entering the back end and leaving the front (for a distance of ). Since we are looking for a tour of maximum length, we can thus define the distance between cities and to be

 d(c,c′)=max{F(c,ti)+B(c′,ti),B(c,ti)+F(c′,ti):1≤i≤k}

Note that this distance function, like our geometric norms, is symmetric. (As we will see below, we can make adjustments for asymmetric distance functions.)

It is easy to see that Maximum TSP remains NP-hard when distances are determined by arbitrary tunnel system distance functions. However, for the case where is fixed and not part of the input, we will show in the next section that Maximum TSP can be solved in time. We are interested in this special case because of the following lemma.

###### Lemma 5

If is a polyhedral norm determined by a set of vectors in , then for any set of points in one can in time construct a tunnel system distance function with tunnels that yields for all .

Proof: The polyhedral distance between two cities is

 ∥\bitc−\bitc′∥ = max{∣∣(\bitc−\bitc′)⋅\bithi∣∣: 1≤i≤k} = max{(\bitc−\bitc′)⋅\bithi,(\bitc′−\bitc)⋅\bithi: 1≤i≤k}

Thus we can view the distance function determined by as a tunnel system distance function with set of tunnels and , for all cities and tunnels .

It is straightforward to extend this characterization to the case of any polyhedral quasi-norm that is characterized by a unit ball with a total of facets. The only real change is in the complexity of the characterization of the tunnel system in Lemma 5. If we use the definition

 ~d(c,c′)=max{F(c,ti)+B(c′,ti):1≤i≤k}

for possibly asymmetric tunnel distances, then by similar reasoning we get the following:

###### Lemma 6

If is a polyhedral quasi-norm determined by a set of vectors in , then for any set of points in one can in time construct a tunnel system distance function with tunnels that yields for all .

## 3 An Algorithm for Bounded Tunnel Systems

In this section we describe an algorithm to solve the Tunneling TSP when the number of tunnels is fixed at , assuming the real number RAM model. By Lemmas 5 and 6 this implies our results for polyhedral norms and quasi-norms (Theorems 1 and 2.) The approach described below also yields a polynomial algorithm for a Minimum TSP variant, where a given set of cities has to be traveled, and all connections have to be made via a set of a fixed number of hubs.

We start by characterizing solutions for bounded tunnel systems in Section 3.1. This characterization is the basis for our algorithm, which is described in Section 3.2. In Section 3.3 we present an additional idea that may possibly improve the above complexity to .

### 3.1 Characterizing Solutions for Bounded Tunnel Systems

We start by discussing the solutions for bounded tunnel systems.

Suppose we are given an instance of the Tunneling TSP with sets and of cities and tunnels, and access distances , for all and . We begin by transforming the problem to one about subset construction.

Let be an edge-weighted, bipartite multigraph with four edges between each city and tunnel , denoted by , and . The weights of these edges are and , . For notational convenience, let us partition the edges in into sets and , . Each tour for the TSP instance then corresponds to a subset of that has equal to the tour length and satisfies

• Every city is incident to exactly two edges in .

• For each tunnel , .

• The set is connected.

To construct the multiset , we simply represent each tour edge by a pair of edges from that connect in the appropriate way to the tunnel that determines . For example, if , and appears immediately before when the tour is traversed starting from , then the edge can be represented by the two edges and . Note that there are enough (city,tunnel) edges of each type so that all tour edges can be represented, even if a given city uses the same tunnel endpoint for both its tour edges. Also note that if can be realized in more than one way, the multiset will not be unique. However, any multiset constructed in this fashion will still have equal to the tour length.

On the other hand, any set satisfying (T1) – (T3) corresponds to one (or more) tours having length at least : Let be the set of tunnels with . Then is a connected graph all of whose vertex degrees are even by (T1) – (T3). By an easy result from graph theory, this means that contains an Euler tour that by (T1) passes through each city exactly once, thus inducing a TSP tour for . Moreover, by (T2) one can construct such an Euler tour with the additional property that if and are consecutive edges in this tour, then , i.e, either or . Thus we will have , and hence the length of the TSP tour will be at least , as claimed.

In summary, our problem is reduced to finding a maximum weight set of edges satisfying (T1) – (T3).

### 3.2 An Efficient Algorithm

#### 3.2.1 Identifiers for Subproblems

From the previous section we know that our problem is reduced to finding a maximum weight set of edges satisfying (T1) – (T3). Given that is fixed, we will first show how to decompose the problem into instances, and then demonstrate how to solve each one of them in time.

Let be a subset of edges satisfying (T1) – (T3). We associate five identifiers with .

The first is , the subset of , , tunnels that are spanned by . (Without loss of generality suppose that .) Globally, the total number of identifiers of the first type is .

Due to conditions (T1), (T3) we know that there is a subset of edges such that the subgraph , induced by , is connected and it spans and exactly cities. Moreover, each of these cities is incident to exactly two edges in , which connects two adjacent tunnels in . We use the second, the third and the fourth identifiers to characterize .

The second identifier is the spanning tree topology connecting the tunnels of that is induced by the set of edges . There are identifiers of this type: the number of labeled spanning trees of , the complete graph on nodes [9].

The third identifier is an assignment of distinct cities to the spanning tree edges of the previous identifier. The city assigned to the tree edge joining tunnels and is one that is connected by one edge of to and by another edge of to . The total number of identifiers of the third type is .

The fourth identifier is the subset of edges linking these cities with corresponding tunnel entrances. In the underlying graph there are four edges (two pairs of identical edges) connecting a city with a tunnel. Therefore, the total number of identifiers of the fourth type is .

The fifth and last identifier is the degree sequence of the nodes in induced by . Let denote this sequence of even positive degrees. Note that . Therefore, there are clearly identifiers of this third type. However, we will modify the identifier and use one of the degree entries, say , as an unspecified parameter. Thus, there are only choices for, say, . ( will then depend linearly on the parameter .) Altogether, we now have choices for values of identifiers.

In summary, to prove our claim that the Tunneling TSP can be solved in time when is fixed, it will suffice to show that the following problem can be solved in time.

Given a set of tunnels , a set of cities, a set of edges connecting the cities to the tunnels as above, and a set of positive integers , find a maximum weight set of edges , containing , satisfying (T1)-(T2), and such that the degree of is , .

#### 3.2.2 Solving the Subproblems

Without loss of generality assume that the cities connecting the tunnels in are . Let , and . For each , we split the tunnel into two nodes, and . They are called, respectively, and tunnel entrances. Define and .

Let be an edge-weighted, bipartite multigraph with two edges, each of weight , connecting and , , , and two edges, each of weight , connecting and , , .

Next, using the notation from the previous subsection, for each , let and . (Note that () is the number of “back” (“front”) type edges in that are incident to tunnel .)

Following is a formal description of the maximization problem:

 g(dp)=max(p∑i=1n∑j=pB(cj,ti)xBi,j+p∑i=1n∑j=pF(cj,ti)xFi,j)

subject to

 n∑j=pxBi,j=di−fBi, i=1,...,p−2,p
 n∑j=pxFi,j=di−fFi, i=1,...,p−2,p
 n∑j=pxBp−1,j=n−dp−fBp−1−p−2∑i=1di,
 n∑j=pxFp−1,j=n−dp−fFp−1−p−2∑i=1di,
 p∑i=1(xBi,j+xFi,j)=2, j=p,...,n,
 xBi,j≥0, i=1,...,p, j=p,...,n,
 xFi,j≥0, i=1,...,p, j=p,...,n.

It is easy to see that for each integer value , the above problem is an instance of the classical transportation problem with sources (cities) and destinations ( B tunnels and

F tunnels). Therefore there is an optimal solution to the linear program for each integer value of

in which all variables are integer. Moreover, since the number of destinations is fixed (), when is specified the dual of this transportation problem can be solved in time by the algorithm in Zemel [33]. (See also Megiddo and Tamir [22].) In particular, can be computed by solving the dual in time. Viewing as a (real) parameter, we note that , the optimal objective value of the above transportation problem, is a concave function of . To see this, observe that if are legal values for , and and are the optimal solutions for these two values viewed as vectors of variable values, then is a feasible solution for and so . Thus, we can apply a Fibonacci search over the integers , or alternatively perform a binary search, at each step checking the values at , , and . (Actually, is restricted by .) Specifically, by computing the function at values of we obtain the (integer) value of maximizing . Thus, in time we find the best value of .

Therefore, in time we can determine the set of identifiers for the transportation problem that yields the maximum solution value (including the full degree sequence for the tunnels). This solution value will be the length of the maximum length tour, but because we were solving the dual rather than primal LP’s, we won’t yet have the optimal tour itself. For this, we need only solve the optimal transportation problem directly in its primal form. Since the number of tunnels is bounded, we can do this in deterministic time using an algorithm described in an unpublished paper by Matsui [21]. The basic idea is to apply complementary slackness properties to the already computed dual solution variables to reduce the problem to a network flow problem for a bounded number of sinks. This can then be solved in linear time using an algorithm of of Gusfield, Martel and Fernandez-Baca [17] (see also Ahuja, Orlin, Stein and Tarjan [1]). Alternatively, one can use the published algorithm of Tokuyama and Nakano [31] that requires time time. In either case, the time to find this one primal solution is dominated by the time already spent to solve all the duals, so the overall running time bound is that for the latter: .

### 3.3 Further Improvement

One way to improve upon the above bound is to reduce the running time to solve an instance of the parametric transportation problem from to . At this point we do not know how to achieve the linear bound, but we feel that the following approach might be fruitful.

Consider the above parametric transportation problem, and view the parameter as an additional (real) variable. The resulting linear program, which we call the primal, is not a transportation problem. Nevertheless, the algorithms in Zemel [33] and Megiddo and Tamir [22] can still solve the dual of this linear program in time. The missing ingredient at this point is how to use the dual solution to obtain (in linear time), an optimal solution to the primal program. Specifically, we only need to know the optimal (real) value of the primal variable , say . If is known, we can use the concavity property of the function to conclude that the optimal integer value of is attained by rounding up or down. We can then proceed as above.

## 4 An O(n) Algorithm

In this section, we describe a linear-time algorithm for determining the length of an optimal tour for the Maximum TSP under rectilinear distances in the plane. This amounts to a proof of Theorem 3, structured into a series of Lemmas and stretching over Subsections 4.1 to  4.3. At the end of the section we sketch how this result can be extended to any 4-facet polyhedral metric. Throughout this section we assume without loss of generality that , as otherwise the problem is trivial.

### 4.1 Stars and Matchings

Our construction uses properties of so-called stars; a star for a given set of vertices is a minimum Steiner tree with precisely one Steiner point (the center) that contains all vertices in as leafs. The total length of the edges in a star is an upper bound on any matching in , since any edge in the matching can be mapped to a pair of edges and in the star, and by triangle inequality, . The worst case ratio between the total length of a minimum star and a maximum matching plays a crucial role in several different types of optimization problems. See the paper by Fingerhut, Suri, and Turner [14] for applications in the context of broadband communication networks. Also, Tamir and Mitchell [30] have used the duality between minimum stars and maximum matchings for showing that certain matching games have a nonempty core. The value of the worst case ratio under the Euclidean metric has been determined by Fekete and Meijer; see [13] for this result and several extensions.

In the rest of this section, all distances are planar rectilinear distances, unless noted otherwise at the end of the section. For rectilinear distances, determining the length of a minimum length star (also known as the rectilinear planar unweighted 1-median or rectilinear Fermat–Weber problem) can be done in linear time.

###### Lemma 7

Suppose we are given a given set of points with , . Then under distances there is an optimal star center , where is a median of , and is a median of .

This is problem 9-2e in [10]. Recall that if is even, then both the ’th and ’st largest items are medians.) The proof is immediate; for an running time, use the result by Blum, Floyd, Pratt, Rivest, and Tarjan [11] for computing a median of numbers.

It should be noted that for Euclidean distances, the problem of determining is considerably harder: It was shown by Bajaj [5] that the problem of finding an optimal star center for five points in the plane is in general not solvable by radicals over the field of rationals. This implies that an algorithm for computing must use stronger tools than constructions by straight edge and compass.

The following Theorem 8 appears in the paper by Tamir and Mitchell [30] as Theorem 8; independently, it was noted by Fekete and Meijer[13].

###### Theorem 8

For even, we have for rectilinear distances in the plane.

The basic idea is that the coordinates of an optimal star center subdivide the plane into four quadrants. If ties are broken in the right way, the number of points in opposite quadrants is the same. See Figure 1. Then

 L1(vi,vj)=L1(vi,c)+L1(c,vj) (1)

holds for any edge in the matching, and the theorem follows easily.

Since the results of this paper include the case in which

is odd, we formalize and generalize this observation.

Let and be as in Lemma 7 and define , , , , , and , From the above conditions, it follows that

 n−x: = |P−x|≤n2 (2) n+x: = |P+x|≤n2 (3) n−y: = |P−y|≤n2 (4) n+y: = |P+y|≤n2. (5)

Let , and . By picking any subset of of size and joining it with , we get a set of size ; the remaining points form the set . Similarly, we get the partition into of size , and of size . Define the following quadrant sets: , , , and . The sets and are opposite quadrant sets, as are and . Two quadrant sets that are not opposite are called adjacent. Finally, let , etc. We get the following conditions:

###### Lemma 9

If is even, then opposite quadrant sets contain the same number of points, i. e.,

 n−− = n++ (6) n−+ = n+−. (7)

If is odd, the numbers of points must satisfy

 n−− = n+++1 (8) n−+ = n+−. (9)

Proof: From the definition of the quadrant sets, it follows for even that

 n−−+n−+=n+−+n++ (10) n−−+n+−=n−++n++. (11)

From this the claims (6) and (7) follow easily, as was noted in  [30] and [13].

For the odd case, the definition of the quadrant sets yields the conditions

 n−−+n−+ = n+−+n+++1 (12) n−−+n+− = n−++n+++1. (13)

This implies (8) and (9).

In the following, we will use Lemma 9 to derive first an optimal 2-factor, consisting of at most two subtours, and then argue how these subtours can be merged optimally.

### 4.2 2-Factors and Trivial Tours

A 2-factor for a set of vertices is a multi-set of edges that covers each vertex exactly twice. Since any tour is a 2-factor, a maximal length 2-factor is an upper bound for the length of a tour. Using the triangle inequality, it is straightforward to see that twice the length of a star is an upper bound for the length of any 2-factor, even when the star is centered at one of the given vertices. Achieving tightness for this bound is the main stepping stone for our algorithm. Based on the results of the preceding section, we prove the following three lemmas. We start with the easiest case:

###### Lemma 10

If two of the quadrant sets are empty, then there is a feasible tour of length , which is optimal.

Proof: Note that the conclusion will follow if we can construct a tour in which all edges satisfy property (1) above. If two of the quadrant sets are empty, it follows from Lemma 9 that these must be opposite. Without loss of generality, let us assume that they are and . For the other two sets, any edge between opposite quadrant sets satisfies property (1). If the number of points in the two opposite quadrant sets is the same, we can get a tour by jumping back and forth while there are unvisited points in these quadrant sets. If is odd and , then can be inserted into any of these edges, while (1) will still apply to all edges. If is odd and , then must contain two points, one with as its -coordinate and one with as its -coordinate. The tour connects these two together and then jumps back and forth between quadrants. All edge lengths again satisfy (1).

###### Lemma 11

Suppose no quadrant set is empty, is odd and . Then there is a feasible tour of length , which is optimal.

By conditions 2 and 4 and because and are both coordinates of points, we know that and each must contain a point. As , we can consider two points , with . Let us assume without loss of generality that when we constructed and we assigned to the former and to the latter.

We distinguish the following cases – see Figure 2:

:

By connecting with a point in , and with a point in , and otherwise jumping back and forth between opposite quadrant sets, we get a tour that satisfies (1) for any edge.

:

In this case, . By changing the membership of from to , we get and . Then a tour for the modified and can be obtained as in case (a).

:

This is treated in the same way as case (b1).

:

In this case, and . By changing the membership of from to and the membership of from to , we get and , so we can get tours as in case (a).

In the remaining cases we may no longer be able to get a tour that meets the upper bound, but the next Lemma says that we can construct two disjoint tours whose total length meets this bound. We will subsequently show how these tours can be combined with only a small decrease in total length to obtain a single optimal tour.

###### Lemma 12

Suppose no quadrant is empty and either is even or is odd and . Then there is a tour of the points in , and a tour of the points in , such that .

Proof: If is even, we can argue like in the proof of Lemma 10: We get two subtours, one covering each pair of opposite quadrant sets.

If is odd and there is only one point in , the case reduces to even, since , and can be inserted into any tour of and while still guaranteeing (1) for any tour edge.

### 4.3 How to Merge 2-Factors

Suppose that no quadrant set is empty and that we have a pair of subtours, whose total length matches the upper bound on optimal tour length, as in Lemma 12. Now we shall show how the upper bound has to be adjusted if we are to restrict ourselves to connected tours, and how the adjusted bound can be met.

We start with the easier case of odd and the median being part of the point set, before dealing with the more complicated case of even .

#### 4.3.1 Odd n

Let be odd and , which means that is in .

###### Lemma 13

Let be odd, , and all quadrant sets be nonempty. Then any tour of contains an edge that connects two adjacent quadrant sets and is not incident on .

Proof: Any tour of induces a tour on the set ; must contain at least two different edges and that connect adjacent quadrant sets, i. e., that connect to . One of these two edges must also be part of , and the claim follows.

###### Lemma 14

Let be an edge connecting two horizontally (or vertically) adjacent quadrant sets. Let , and define (or ). Then any tour containing has length at most .

Proof: In either case, we have , and the claim follows.

By considering all possible edges connecting adjacent quadrant sets, we get an adjusted upper bound on the tour length. Note that only the smaller distance from a median line matters for this bound. More formally, let , and , and let .

###### Lemma 15

Let be odd, , and all quadrant sets be nonempty. Then an optimal tour of has length , and such a tour can be found in linear time.

Proof: By Lemma 13 and Lemma 14, is a valid upper bound on the tour length. It follows from the discussion of and the definition of that the bound can be computed in linear time. Finally suppose for example that and that is a point for which the value of is met. Connect to a vertex in , and to vertics in and . As shown in Figure 3, it is straightforward to add only edges between opposite quadrants in order to get a tour of the required length. Other cases are handled analogously.

#### 4.3.2 Even n

The proof proceeds similarly to the case for odd but requires a more involved combinatorial analysis. Let us say that a pair of edges and is a quadrant matching of the first type if , ,