format: text

text:
# The Geometric Maximum Traveling Salesman Problem Preliminary versions of parts of this paper appear in the Proceedings of IPCO’98 [7] and SODA’99 [12].

## 1 Introduction

In the Traveling Salesman Problem (TSP), the input consists of a set $`C`$ of cities together with the distances $`d(c,c^{})`$ between every pair of distinct cities $`c,c^{}C`$. 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 $`c_{\pi (1)},c_{\pi (2)},\mathrm{},c_{\pi (n)}`$ is

$$\underset{i=1}{\overset{n1}{}}d(c_{\pi (i)},c_{\pi (i+1)})+d(c_{\pi (n)},c_{\pi (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  show that the problem cannot be approximated arbitrarily well, combined with results by Papadimitriou and Yannakakis , 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  have given a 7/8 approximation algorithm.

Of particular interest are geometric instances of the TSP, in which cities correspond to points in $`^d`$ for some $`d1`$, 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 “$`L_p`$ norm” for $`p=1`$, $`2`$, and $`\mathrm{}`$. In general, the distance between two points $`𝒙=(x_1,x_2,\mathrm{},x_d)`$ and $`𝒚=(y_1,y_2,\mathrm{},y_d)`$ under the $`L_p`$ norm, $`p1`$, is

$$d(𝒙,𝒚)=\left(\underset{i=1}{\overset{d}{}}\left|x_iy_i\right|^p\right)^{1/p}$$

with the natural asymptotic interpretation that distance under the $`L_{\mathrm{}}`$ norm is

$$d(𝒙,𝒚)=\mathrm{max}{}_{i=1}{}^{d}|x_iy_i|.$$

This paper considers a second class of norms which also includes the Rectilinear and Sup norms, but can only approximate the Euclidean and other $`L_p`$ 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 $`d(𝒙,𝒚)`$ under such a norm, first translate the space so that one of the points, say $`𝒙`$, is at the origin. Then determine the unique factor $`\alpha `$ by which one must rescale $`𝑷`$ (expanding if $`\alpha >1`$, shrinking if $`\alpha <1`$) so that the other point ($`𝒚`$) is on the boundary of the polyhedron. We then have $`d(𝒙,𝒚)=\alpha `$.

Alternatively, and more usefully for our purposes, we can view a polyhedral norm as follows. If $`𝑷`$ is a polyhedron as described above and has $`f`$ facets, then $`f`$ is divisible by 2 and there is a set $`H_𝑷=\{𝒉_1,\mathrm{},𝒉_{f/2}\}`$ of points in $`^d`$ such that $`𝑷`$ is the intersection of a collection of half-spaces determined by $`H_𝑷`$:

$$𝑷=\left(\underset{i=1}{\overset{f/2}{}}\{𝒙:𝒙𝒉_i1\}\right)\left(\underset{i=1}{\overset{f/2}{}}\{𝒙:𝒙𝒉_i1\}\right).$$

Then we have

$$d(𝒙,𝒚)=\mathrm{max}\left\{\left|(𝒙𝒚)𝒉_i\right|:1if/2\right\}.$$

Note that for the Rectilinear norm in the plane we can take $`H_𝑷`$ = $`\{(1,1),(1,1)\}`$ and for the Sup norm in the plane we can take $`H_𝑷`$ = $`\{(1,0),(0,1)\}`$.

For the Minimum TSP on geometric instances, two key complexity questions have been answered. As follows from results of Itai, Papadimitriou, and Swarcfiter , the Minimum TSP is NP-hard for any fixed dimension $`d`$ and any $`L_p`$ or polyhedral norm; see also the earlier results by Garey, Graham, and Johnson , and Papadimitriou . On the other hand, results of Arora  and Mitchell  imply that in all these cases a polynomial-time approximation scheme (PTAS) exists, i.e., a sequence of polynomial-time algorithms $`A_k`$, $`1k<\mathrm{}`$, where $`A_k`$ is guaranteed to find a tour whose length is within a ratio of $`1+(1/k)`$ of optimal.

The situation for geometric versions of the Maximum TSP has been less clear than for its minimum counterpart. Serdyukov , and, independently, Barvinok , have shown that once again polynomial-time approximation schemes exist for all fixed dimensions $`d`$ and all $`L_p`$ or polyhedral norms (and in a sense for any fixed norm; see ). Until now, however, the complexity of the optimization problems themselves when $`d`$ is fixed has remained open: For no fixed dimension $`d`$ and $`L_p`$ 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 $`d`$ and any polyhedral norm:

###### Theorem 1

Let dimension $`d`$ be fixed, and let $``$ be a fixed polyhedral norm in $`^d`$ whose unit ball is a centrally symmetric polyhedron $`𝑷`$ determined by a set of $`f`$ facets. Then for any set of $`n`$ points in $`^d`$, one can construct a traveling salesman tour of maximum length with respect to $``$ in time $`O(n^{f2}\mathrm{log}n)`$ 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 $`H_P`$, but now we need a vector for each facet of the polyhedron and $`d(x,y)=\mathrm{max}\left\{(xy)h:hH_P\right\}`$. Serdyukov  previously showed that for the case of a quasi-norm in $`^2`$ 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 $`d`$ be fixed, and let $``$ be a fixed polyhedral quasi-norm in $`^d`$ whose unit ball is a polyhedron $`𝑷`$ determined by a set of $`f`$ facets. Then for any set of $`n`$ points in $`^d`$, one can construct a traveling salesman tour of maximum length with respect to $``$ in time $`O(n^{2f2}\mathrm{log}n)`$ 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 $`O(n^2\mathrm{log}n)`$.

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 $`H_𝑷`$ and the coordinates of the cities are all rationals. Let $`U`$ 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 $`n\mathrm{log}(U)`$. If the components/coordinates are all integers with maximum absolute value $`U`$, the running times need only be multiplied by $`\mathrm{log}(nU)`$. 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 $`n`$ cities, all connections have to be made via a set of $`k`$ hubs, where $`k`$ is a constant.

The complexity of $`O(n^2\mathrm{log}n)`$ 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 $`^2`$ under the $`L_1`$ norm can be solved in $`O(n)`$ time.

By appropriate coordinate transformation, this result can be generalized to all planar polyhedral norms with $`f=4`$ 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 $`\mathrm{\Omega }(n\mathrm{log}n)`$ 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, $`\mathrm{\Omega }\left((\frac{n}{4}!)^4\right)`$, 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 $`^2`$ 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 $`^d`$ is an NP-hard problem if $`d3`$.

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 , 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 $`n`$ 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 $`n`$.

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 $`k=f/2`$ tunnels (and with $`k=f`$ tunnels for polyhedral quasi-norms). Section 3.1 shows how the solutions for the Tunneling TSP with a fixed number $`k2`$ of tunnels can be characterized, setting up an algorithm with a running time of $`O(n^{2k2}\mathrm{log}n)`$ 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 $`^3`$, 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 $`T=\{t_1,t_2,\mathrm{},t_k\}`$ of $`k2`$ 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 $`c,t`$ of a city and a tunnel we are given real-valued access distances $`F(c,t)`$ and $`B(c,t)`$ from the city to the front and back ends of the tunnel respectively. Each potential tour edge $`\{c,c^{}\}`$ must pass through some tunnel $`t`$, either by entering the front end and leaving the back (for a distance of $`F(c,t)+B(c^{},t)`$), or by entering the back end and leaving the front (for a distance of $`B(c,t)+F(c^{},t)`$). Since we are looking for a tour of maximum length, we can thus define the distance between cities $`c`$ and $`c^{}`$ to be

$$d(c,c^{})=\mathrm{max}\{F(c,t_i)+B(c^{},t_i),B(c,t_i)+F(c^{},t_i):1ik\}$$

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 $`k=|T|`$ is fixed and not part of the input, we will show in the next section that Maximum TSP can be solved in $`O(n^{2k2}\mathrm{log}n)`$ time. We are interested in this special case because of the following lemma.

###### Lemma 5

If $``$ is a polyhedral norm determined by a set $`H_𝑷`$ of $`k=f/2`$ vectors in $`^d`$, then for any set $`C`$ of points in $`^d`$ one can in time $`O(dk|C|)`$ construct a tunnel system distance function with $`k`$ tunnels that yields $`d(𝒄,𝒄^{})=𝒄𝒄^{}`$ for all $`𝒄,𝒄^{}C`$.

Proof: The polyhedral distance between two cities $`𝒄,𝒄^{}^d`$ is

$`𝒄𝒄^{}`$ $`=`$ $`\mathrm{max}\left\{\left|(𝒄𝒄^{})𝒉_i\right|:1ik\right\}`$
$`=`$ $`\mathrm{max}\{(𝒄𝒄^{})𝒉_i,(𝒄^{}𝒄)𝒉_i:1ik\}`$
Thus we can view the distance function determined by $``$ as a tunnel system distance function with set of tunnels $`T=H_𝑷`$ and $`F(𝒄,𝒉)=𝒄𝒉`$, $`B(𝒄,𝒉)=𝒄𝒉`$ for all cities $`𝒄`$ and tunnels $`𝒉`$. $`\mathrm{}`$

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 $`f`$ facets. The only real change is in the complexity of the characterization of the tunnel system in Lemma 5. If we use the definition

$$\stackrel{~}{d}(c,c^{})=\mathrm{max}\left\{F(c,t_i)+B(c^{},t_i):1ik\right\}$$

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 $`H_𝑷`$ of $`f`$ vectors in $`^d`$, then for any set $`C`$ of points in $`^d`$ one can in time $`O(df|C|)`$ construct a tunnel system distance function with $`f`$ tunnels that yields $`\stackrel{~}{d}(𝒄,𝒄^{})=𝒄𝒄^{}`$ for all $`𝒄,𝒄^{}C`$.

## 3 An Algorithm for Bounded Tunnel Systems

In this section we describe an $`O(n^{2k2}\mathrm{log}n)`$ algorithm to solve the Tunneling TSP when the number of tunnels is fixed at $`k`$, 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 $`n`$ cities has to be traveled, and all connections have to be made via a set of a fixed number $`k`$ 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 $`O(n^{2k2})`$.

### 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 $`C=\{c_1,\mathrm{},c_n\}`$ and $`T=\{t_1,\mathrm{},t_k\}`$ of cities and tunnels, and access distances $`F(c,t)`$, $`B(c,t)`$ for all $`cC`$ and $`tT`$. We begin by transforming the problem to one about subset construction.

Let $`G=(CT,E)`$ be an edge-weighted, bipartite multigraph with four edges between each city $`c`$ and tunnel $`t`$, denoted by $`e_i[c,t,X]`$, $`i\{1,2\}`$ and $`X\{B,F\}`$. The weights of these edges are $`w(e_i[c,t,F])=F(c,t)`$ and $`w(e_i[c,t,B])=B(c,t)`$, $`i\{1,2\}`$. For notational convenience, let us partition the edges in $`E`$ into sets $`E[t,F]=\{e_i[c,t,F]:cC,i\{1,2\}\}`$ and $`E[t,B]=\{e_i[c,t,B]:cC,i\{1,2\}\}`$, $`tT`$. Each tour for the TSP instance then corresponds to a subset $`E^{}`$ of $`E`$ that has $`_{eE^{}}w(e)`$ equal to the tour length and satisfies

> * Every city is incident to exactly two edges in $`E^{}`$.
> * For each tunnel $`tT`$, $`|E^{}E[t,F]|=|E^{}E[t,B]|`$.
> * The set $`E^{}`$ is connected.

To construct the multiset $`E^{}`$, we simply represent each tour edge $`\{c,c^{}\}`$ by a pair of edges from $`E`$ that connect in the appropriate way to the tunnel that determines $`d(c,c^{})`$. For example, if $`d(c,c^{})=F(c,t)+B(c^{},t)`$, and $`c`$ appears immediately before $`c^{}`$ when the tour is traversed starting from $`c_{\pi (1)}`$, then the edge $`(c,c^{})`$ can be represented by the two edges $`e_2[c,t,F]`$ and $`e_1[c^{},t,B]`$. 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 $`d(c,c^{})`$ can be realized in more than one way, the multiset $`E^{}`$ will not be unique. However, any multiset $`E^{}`$ constructed in this fashion will still have $`_{eE^{}}w(e)`$ equal to the tour length.

On the other hand, any set $`E^{}`$ satisfying (T1) – (T3) corresponds to one (or more) tours having length at least $`_{eE^{}}w(e)`$: Let $`T^{}T`$ be the set of tunnels $`t`$ with $`|E^{}E[t,F]|>0`$. Then $`G^{}=(CT^{},E^{})`$ is a connected graph all of whose vertex degrees are even by (T1) – (T3). By an easy result from graph theory, this means that $`G^{}`$ contains an Euler tour that by (T1) passes through each city exactly once, thus inducing a TSP tour for $`C`$. Moreover, by (T2) one can construct such an Euler tour with the additional property that if $`e_i[c,t,x]`$ and $`e_j[c^{},t,y]`$ are consecutive edges in this tour, then $`xy`$, i.e, either $`x=F,y=B`$ or $`x=B,y=F`$. Thus we will have $`w(e_i[c,t,x])+w(e_j[c^{},t,y])d(c,c^{})`$, and hence the length of the TSP tour will be at least $`_{eE^{}}w(e)`$, as claimed.

In summary, our problem is reduced to finding a maximum weight set of edges $`E^{}E`$ 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 $`E^{}E`$ satisfying (T1) – (T3). Given that $`k`$ is fixed, we will first show how to decompose the problem into $`O(n^{2k3})`$ instances, and then demonstrate how to solve each one of them in $`O(n\mathrm{log}n)`$ time.

Let $`E^{}`$ be a subset of edges satisfying (T1) – (T3). We associate five identifiers with $`E^{}`$.

The first is $`T^{}T`$, the subset of $`p`$, $`pk`$, tunnels that are spanned by $`E^{}`$. (Without loss of generality suppose that $`T^{}=\{t_1,\mathrm{},t_p\}`$.) Globally, the total number of identifiers of the first type is $`O(2^k)`$.

Due to conditions (T1), (T3) we know that there is a subset of $`2(p1)`$ edges $`E^{\prime \prime }E^{}`$ such that the subgraph $`G(E^{\prime \prime })`$, induced by $`E^{\prime \prime }`$, is connected and it spans $`T^{}`$ and exactly $`p1`$ cities. Moreover, each of these cities is incident to exactly two edges in $`E^{\prime \prime }`$, which connects two adjacent tunnels in $`T^{}`$. We use the second, the third and the fourth identifiers to characterize $`G(E^{\prime \prime })`$.

The second identifier is the spanning tree topology connecting the tunnels of $`T^{}`$ that is induced by the set of edges $`E^{\prime \prime }`$. There are $`p^{p2}`$ identifiers of this type: the number of labeled spanning trees of $`K_p`$, the complete graph on $`p`$ nodes .

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 $`t`$ and $`t^{}`$ is one that is connected by one edge of $`E^{\prime \prime }`$ to $`t`$ and by another edge of $`E^{\prime \prime }`$ to $`t^{}`$. The total number of identifiers of the third type is $`O(n^{p1})`$.

The fourth identifier is the subset of $`2(p1)`$ edges linking these cities with corresponding tunnel entrances. In the underlying graph $`G`$ 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 $`O(16^{p1})`$.

The fifth and last identifier is the degree sequence of the nodes in $`T^{}`$ induced by $`E^{}`$. Let $`d=(2d_1,\mathrm{},2d_p)`$ denote this sequence of even positive degrees. Note that $`d_1+\mathrm{}+d_p=n`$. Therefore, there are clearly $`O(n^{p1})`$ identifiers of this third type. However, we will modify the identifier and use one of the degree entries, say $`d_p`$, as an unspecified parameter. Thus, there are only $`O(n^{p2})`$ choices for, say, $`d_1,d_2,\mathrm{},d_{p2}`$. ($`d_{p1}`$ will then depend linearly on the parameter $`d_p`$.) Altogether, we now have $`O(n^{2k3})`$ choices for values of identifiers.

In summary, to prove our claim that the Tunneling TSP can be solved in $`O(n^{2k2}\mathrm{log}n)`$ time when $`k`$ is fixed, it will suffice to show that the following problem can be solved in $`O(n\mathrm{log}n)`$ time.

Given a set of tunnels $`T^{}=\{t_1,\mathrm{},t_p\}`$, a set of $`p1`$ cities, a set $`E^{\prime \prime }`$ of $`2(p1)`$ edges connecting the cities to the tunnels as above, and a set of positive integers $`d_1,\mathrm{},d_{p2}`$, find a maximum weight set of edges $`E^{}`$, containing $`E^{\prime \prime }`$, satisfying (T1)-(T2), and such that the degree of $`t_i`$ is $`2d_i`$, $`1ip2`$.

#### 3.2.2 Solving the Subproblems

Without loss of generality assume that the $`p1`$ cities connecting the tunnels in $`T^{}`$ are $`\{c_1,\mathrm{},c_{p1}\}`$. Let $`C^{}=\{c_1,\mathrm{},c_{p1}\}`$, and $`C^{\prime \prime }=CC^{}`$. For each $`i=1,\mathrm{},p`$, we split the tunnel $`t_i`$ into two nodes, $`t_i^B`$ and $`t_i^F`$. They are called, respectively, $`B`$ and $`F`$ tunnel entrances. Define $`T_B^{}=\{t_1^B,\mathrm{},t_p^B\}`$ and $`T_F^{}=\{t_1^F,\mathrm{},t_p^F\}`$.

Let $`G^{}=(C^{\prime \prime }(T_B^{}T_F^{}),E^{})`$ be an edge-weighted, bipartite multigraph with two edges, each of weight $`B(c_j,t_i)`$, connecting $`c_j`$ and $`t_i^B`$, $`j=p,p+1,\mathrm{},n`$, $`i=1,\mathrm{},p`$, and two edges, each of weight $`F(c_j,t_i)`$, connecting $`c_j`$ and $`t_i^F`$, $`j=p,p+1,\mathrm{},n`$, $`i=1,\mathrm{},p`$.

Next, using the notation from the previous subsection, for each $`i=1,\mathrm{},p`$, let $`f_i^B=|E^{\prime \prime }E[t_i,B]|`$ and $`f_i^F=|E^{\prime \prime }E[t_i,F]|`$. (Note that $`f_i^B`$ ($`f_i^F`$) is the number of “back” (“front”) type edges in $`E^{\prime \prime }`$ that are incident to tunnel $`t_i`$.)

Following is a formal description of the maximization problem:

$$g(d_p)=\mathrm{max}(\underset{i=1}{\overset{p}{}}\underset{j=p}{\overset{n}{}}B(c_j,t_i)x_{i,j}^B+\underset{i=1}{\overset{p}{}}\underset{j=p}{\overset{n}{}}F(c_j,t_i)x_{i,j}^F)$$

subject to

$$\underset{j=p}{\overset{n}{}}x_{i,j}^B=d_if_i^B,i=1,\mathrm{},p2,p$$

$$\underset{j=p}{\overset{n}{}}x_{i,j}^F=d_if_i^F,i=1,\mathrm{},p2,p$$

$$\underset{j=p}{\overset{n}{}}x_{p1,j}^B=nd_pf_{p1}^B\underset{i=1}{\overset{p2}{}}d_i,$$

$$\underset{j=p}{\overset{n}{}}x_{p1,j}^F=nd_pf_{p1}^F\underset{i=1}{\overset{p2}{}}d_i,$$

$$\underset{i=1}{\overset{p}{}}(x_{i,j}^B+x_{i,j}^F)=2,j=p,\mathrm{},n,$$

$$x_{i,j}^B0,i=1,\mathrm{},p,j=p,\mathrm{},n,$$

$$x_{i,j}^F0,i=1,\mathrm{},p,j=p,\mathrm{},n.$$

It is easy to see that for each integer value $`d_p\{1,2,\mathrm{},n\}`$, the above problem is an instance of the classical transportation problem with $`np+1`$ sources (cities) and $`2p`$ destinations ( $`p`$ B tunnels and $`p`$ F tunnels). Therefore there is an optimal solution to the linear program for each integer value of $`d_p`$ in which all variables are integer. Moreover, since the number of destinations is fixed ($`pk`$), when $`d_p`$ is specified the dual of this transportation problem can be solved in $`O(n)`$ time by the algorithm in Zemel . (See also Megiddo and Tamir .) In particular, $`g(d_p)`$ can be computed by solving the dual in $`O(n)`$ time. Viewing $`d_p`$ as a (real) parameter, we note that $`g(d_p)`$, the optimal objective value of the above transportation problem, is a concave function of $`d_p`$. To see this, observe that if $`d<d^{}`$ are legal values for $`d_p`$, and $`\overline{x}_d`$ and $`\overline{x}_d^{}`$ are the optimal solutions for these two values viewed as vectors of variable values, then $`(\overline{x}_d+\overline{x}_d^{})/2`$ is a feasible solution for $`(d+d^{})/2`$ and so $`g((d+d^{})/2)(g(d)+g(d^{}))/2`$. Thus, we can apply a Fibonacci search over the integers $`\{1,2,\mathrm{},n\}`$, or alternatively perform a binary search, at each step checking the values at $`d1`$, $`d`$, and $`d+1`$. (Actually, $`d_p`$ is restricted by $`1d_p<n_{i=1}^{p2}d_i`$.) Specifically, by computing the function $`g(d_p)`$ at $`O(\mathrm{log}n)`$ values of $`d_p`$ we obtain the (integer) value of $`d_p`$ maximizing $`g(d_p)`$. Thus, in $`O(n\mathrm{log}n)`$ time we find the best value of $`d_p`$.

Therefore, in time $`O(n^{2k3}n\mathrm{log}n)=O(n^{2k2}\mathrm{log}n)`$ 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 $`O(n)`$ using an algorithm described in an unpublished paper by Matsui . 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  (see also Ahuja, Orlin, Stein and Tarjan ). Alternatively, one can use the published algorithm of Tokuyama and Nakano  that requires time $`O(n\mathrm{log}^2n)`$ 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: $`O(n^{2k2}\mathrm{log}n)`$.

### 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 $`O(n\mathrm{log}n)`$ to $`O(n)`$. 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 $`d_p`$ as an additional (real) variable. The resulting linear program, which we call the primal, is not a transportation problem. Nevertheless, the algorithms in Zemel  and Megiddo and Tamir  can still solve the dual of this linear program in $`O(n)`$ 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 $`d_p`$, say $`d_p^{}`$. If $`d_p^{}`$ is known, we can use the concavity property of the function $`g(d_p)`$ to conclude that the optimal integer value of $`d_p`$ is attained by rounding $`d_p^{}`$ 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 $`n4`$, 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 $`V`$ is a minimum Steiner tree with precisely one Steiner point (the center) that contains all vertices in $`V`$ as leafs. The total length of the edges in a star is an upper bound on any matching in $`V`$, since any edge $`(v_i,v_j)`$ in the matching can be mapped to a pair of edges $`(v_i,c)`$ and $`(c,v_j)`$ in the star, and by triangle inequality, $`d(v_i,v_j)d((v_i,c)+d(c,v_j)`$. The worst case ratio between the total length of a minimum star $`\mathrm{min}S(P)`$ and a maximum matching $`\mathrm{max}M(P)`$ plays a crucial role in several different types of optimization problems. See the paper by Fingerhut, Suri, and Turner  for applications in the context of broadband communication networks. Also, Tamir and Mitchell  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  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 $`\mathrm{min}S(P)`$ 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 $`n`$ points $`P=\{p_1,\mathrm{},p_n\}`$ with $`p_i=(x_i,y_i)`$, $`1in`$. Then under $`L_1`$ distances there is an optimal star center $`c=(x_c,y_c)`$, where $`x_c`$ is a median of $`\{x_ii=1,\mathrm{},n\}`$, and $`y_c`$ is a median of $`\{y_ii=1,\mathrm{},n\}`$.

This is problem 9-2e in . Recall that if $`n=2m`$ is even, then both the $`m`$’th and $`(m+1)`$’st largest items are medians.) The proof is immediate; for an $`O(n)`$ running time, use the result by Blum, Floyd, Pratt, Rivest, and Tarjan  for computing a median of $`n`$ numbers.

It should be noted that for Euclidean distances, the problem of determining $`\mathrm{min}S(P)`$ is considerably harder: It was shown by Bajaj  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 $`\mathrm{min}S(P)`$ must use stronger tools than constructions by straight edge and compass.

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

###### Theorem 8

For $`|P|`$ even, we have $`\mathrm{max}M(P)=\mathrm{min}S(P)`$ 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

$$L_1(v_i,v_j)=L_1(v_i,c)+L_1(c,v_j)$$
(1)
holds for any edge $`(v_i,v_j)`$ in the matching, and the theorem follows easily. $`\mathrm{}`$

Since the results of this paper include the case in which $`|P|`$ is odd, we formalize and generalize this observation.

Let $`x_c`$ and $`y_c`$ be as in Lemma 7 and define $`P_x^{}:=\{p_iPx_i<x_c\}`$, $`P_x^0:=\{x_ix_i=x_c\}`$, $`P_x^+:=\{p_iPx_i>x_c\}`$, $`P_y^{}:=\{p_iPy_i<y_c\}`$, $`P_y^0:=\{y_iy_i=y_c\}`$, and $`P_y^+:=\{p_iPy_i>y_c\}`$, From the above conditions, it follows that

$`n_x^{}:`$ $`=`$ $`|P_x^{}|{\displaystyle \frac{n}{2}}`$ (2)
$`n_x^+:`$ $`=`$ $`|P_x^+|{\displaystyle \frac{n}{2}}`$ (3)
$`n_y^{}:`$ $`=`$ $`|P_y^{}|{\displaystyle \frac{n}{2}}`$ (4)
$`n_y^+:`$ $`=`$ $`|P_y^+|{\displaystyle \frac{n}{2}}.`$ (5)
Let $`n_x^0:=|P_x^0|`$, and $`n_y^0:=|P_y^0|`$. By picking any subset of $`P_x^0`$ of size $`\frac{n}{2}n_x^{}`$ and joining it with $`P_x^{}`$, we get a set $`P_x^{/0}`$ of size $`\frac{n}{2}`$; the remaining $`\frac{n}{2}`$ points form the set $`P_x^{0/+}`$. Similarly, we get the partition into $`P_y^{/0}`$ of size $`\frac{n}{2}`$, and $`P_y^{0/+}`$ of size $`\frac{n}{2}`$. Define the following quadrant sets: $`P^{}:=P_x^{/0}P_y^{/0}`$, $`P^+:=P_x^{/0}P_y^{0/+}`$, $`P^+:=P_x^{0/+}P_y^{/0}`$, and $`P^{++}:=P_x^{0/+}P_y^{0/+}`$. The sets $`P^{}`$ and $`P^{++}`$ are opposite quadrant sets, as are $`P^+`$ and $`P^+`$. Two quadrant sets that are not opposite are called adjacent. Finally, let $`n^{}:=|P^{}|`$, etc. We get the following conditions:

###### Lemma 9

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

$`n^{}`$ $`=`$ $`n^{++}`$ (6)
$`n^+`$ $`=`$ $`n^+.`$ (7)
If $`n`$ 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 $`n`$ that

$`n^{}+n^+=n^++n^{++}`$ (10)
$`n^{}+n^+=n^++n^{++}.`$ (11)
From this the claims (6) and (7) follow easily, as was noted in  and .

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). $`\mathrm{}`$

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 $`2\mathrm{min}S(P)`$, 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 $`P^,`$ and $`P^{+,+}`$. For the other two sets, any edge $`(v_i,v_j)`$ 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 $`n`$ is odd and $`p_{}=(x_c,y_c)P^{}`$, then $`p_{}`$ can be inserted into any of these edges, while (1) will still apply to all edges. If $`n`$ is odd and $`p_{}=(x_c,y_c)P^{}`$, then $`P^{}`$ must contain two points, one with $`x_c`$ as its $`x`$-coordinate and one with $`y_c`$ as its $`y`$-coordinate. The tour connects these two together and then jumps back and forth between quadrants. All edge lengths again satisfy (1). $`\mathrm{}`$

###### Lemma 11

Suppose no quadrant set is empty, $`n`$ is odd and $`|P_x^0P_y^0|>1`$. Then there is a feasible tour of length $`2\mathrm{min}S(P)`$, which is optimal.

By conditions 2 and 4 and because $`x_c`$ and $`y_c`$ are both coordinates of points, we know that $`P_x^0P_x^{/0}`$ and $`P_y^0P_y^{/0}`$ each must contain a point. As $`|P_x^0P_y^0|>1`$, we can consider two points $`p_aP_x^0`$, $`p_bP_y^0`$ with $`ab`$. Let us assume without loss of generality that when we constructed $`P_x^{/0}`$ and $`P_y^{/0}`$ we assigned $`p_a`$ to the former and $`p_b`$ to the latter.

We distinguish the following cases – see Figure 2:

$`\mathbf{(}𝒂\mathbf{)}𝒑_𝒂\mathbf{,}𝒑_𝒃\mathbf{}𝑷^{\mathbf{}\mathbf{}}`$:

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

$`\mathbf{(}𝒃\mathrm{𝟏}\mathbf{)}𝒑_𝒂\mathbf{}𝑷^{\mathbf{}\mathbf{}}\mathbf{,}𝒑_𝒃\mathbf{}𝑷^{\mathbf{}\mathbf{}}`$:

In this case, $`p_aP^+`$. By changing the membership of $`p_b`$ from $`P^{}`$ to $`P^+`$, we get $`|P^{}|=|P^{++}|`$ and $`|P^+|=|P^+|+1`$. Then a tour for the modified $`P^+`$ and $`P^+`$ can be obtained as in case (a).

$`\mathbf{(}𝒃\mathrm{𝟐}\mathbf{)}𝒑_𝒂\mathbf{}𝑷^{\mathbf{}\mathbf{}}\mathbf{,}𝒑_𝒃\mathbf{}𝑷^{\mathbf{}\mathbf{}}`$:

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

$`\mathbf{(}𝒄\mathbf{)}𝒑_𝒂\mathbf{,}𝒑_𝒃\mathbf{}𝑷^{\mathbf{}\mathbf{}}`$:

In this case, $`p_aP^+`$ and $`p_bP^+`$. By changing the membership of $`p_a`$ from $`P^+`$ to $`P^{++}`$ and the membership of $`p_b`$ from $`P^+`$ to $`P^{++}`$, we get $`|P^{++}|=|P^{}|+1`$ and $`|P^+|=|P^+|`$, so we can get tours as in case (a). $`\mathrm{}`$

In the remaining cases we may no longer be able to get a tour that meets the $`2\mathrm{min}S(P)`$ 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 $`n`$ is even or $`n`$ is odd and $`|P_x^0P_y^0|=1`$. Then there is a tour $`T_{/++}`$ of the points in $`P^{}P^{++}`$, and a tour $`T_{+/+}`$ of the points in $`P^+P^+`$, such that $`\mathrm{}(T_{/++})+\mathrm{}(T_{+/+})=2\mathrm{min}S(P)`$.

Proof: If $`n`$ 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 $`n`$ is odd and there is only one point $`p_{}`$ in $`P_x^0P_y^0`$, the case reduces to $`n`$ even, since $`p_{}=(c_x,c_y)P^{}`$, and $`p_{}`$ can be inserted into any tour of $`P^{}\{p_{}\}`$ and $`P^{++}`$ while still guaranteeing (1) for any tour edge. $`\mathrm{}`$

### 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 $`2\mathrm{min}S(P)`$ 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 $`n`$ odd and the median being part of the point set, before dealing with the more complicated case of even $`n`$.

#### 4.3.1 Odd $`n`$

Let $`n`$ be odd and $`|P_x^0P_y^0|=1`$, which means that $`p_{}=(x_c,y_c)`$ is in $`P`$.

###### Lemma 13

Let $`n`$ be odd, $`|P_x^0P_y^0|=1`$, and all quadrant sets be nonempty. Then any tour of $`P`$ contains an edge that connects two adjacent quadrant sets and is not incident on $`p_{}`$.

Proof: Any tour $`T`$ of $`P`$ induces a tour $`T^{}`$ on the set $`P\{p_{}\}`$; $`T^{}`$ must contain at least two different edges $`e_1`$ and $`e_2`$ that connect adjacent quadrant sets, i. e., that connect $`S_1=(P^{}\{p_{}\}P^{++})`$ to $`S_2=(P^+P^+)=PS_1`$. One of these two edges must also be part of $`T`$, and the claim follows. $`\mathrm{}`$

###### Lemma 14

Let $`e_1=(p_1,p_2)`$ be an edge connecting two horizontally (or vertically) adjacent quadrant sets. Let $`p_i=(x_i,y_i)`$, and define $`z:=\mathrm{min}\{|y_cy_1|,|y_cy_2|\}`$ (or $`z:=\mathrm{min}\{|x_cx_1|,|x_cx_2|\}`$). Then any tour containing $`e_1`$ has length at most $`2\mathrm{min}S(P)2z`$.

Proof: In either case, we have $`L_1(p_1,p_2)=L_1(p_1,c)+L_1(c,p_2)2z`$, and the claim follows. $`\mathrm{}`$

By considering all possible edges $`(p_1,p_2)`$ 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 $`Z_1=\mathrm{min}\{|y_cy_i|p_iP\{p_{}\}\}`$, and $`Z_2=\mathrm{min}\{|x_cx_i|p_iP\{p_{}\}\}`$, and let $`Z_{}=\mathrm{min}\{Z_1,Z_2\}`$.

###### Lemma 15

Let $`n`$ be odd, $`|P_x^0P_y^0|=1`$, and all quadrant sets be nonempty. Then an optimal tour of $`P`$ has length $`\mathrm{min}S(P)2Z_{}`$, and such a tour can be found in linear time.

Proof: By Lemma 13 and Lemma 14, $`\mathrm{min}S(P)2Z_{}`$ is a valid upper bound on the tour length. It follows from the discussion of $`S(P)`$ and the definition of $`Z_{}`$ that the bound can be computed in linear time. Finally suppose for example that $`Z_{}=Z_1`$ and that $`p_1P^{}`$ is a point for which the value of $`Z_1`$ is met. Connect $`p_1`$ to a vertex in $`P^+`$, and $`p_{}`$ to vertics in $`P^{++}`$ and $`P^+`$. 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. $`\mathrm{}`$

#### 4.3.2 Even $`n`$

The proof proceeds similarly to the case for odd $`n`$ but requires a more involved combinatorial analysis. Let us say that a pair of edges $`e_1=(v_1,v_2)`$ and $`e_2=(v_3,v_4)`$ is a quadrant matching of the first type if $`v_1P^{}`$, $`v_2P^+`$, $`v_3P^+`$, $`v_4P^{++}`$ or if $`v_1P^{}`$, $`v_2P^+`$, $`v_3P^+`$, $`v_4P^{++}`$. See Figure 4. We will call $`e_1`$ and $`e_2`$ a quadrant matching of the second type if one edge joins adjacent quadrants and the other lies within a third quadrant.

###### Lemma 16

Let $`n`$ be even and all quadrant sets be nonempty. Then any tour of $`P`$ contains a quadrant matching of either the first or the second type.

Proof: As in the proof of Lemma 13, any tour of $`P`$ must contain at least two different edges $`e_1=(v_1,v_2)`$ and $`e_2=(v_3,v_4)`$ that connect adjacent quadrant sets, i. e., that connect $`S_1=(P^{}P^{++})`$ to $`S_2=(P^+P^+)=PS_1`$.

We consider the following cases; in all cases, we name particular choices of quadrants for clearer notation and better reference to Figure 4. All other choices are completely analogous. Moreover, all arguments remain valid if two of the named vertices coincide.

$`\mathbf{(}𝒂\mathbf{)}\mathbf{(}𝒗_\mathrm{𝟏}\mathbf{,}𝒗_\mathrm{𝟐}\mathbf{)}\mathbf{,}\mathbf{(}𝒗_\mathrm{𝟑}\mathbf{,}𝒗_\mathrm{𝟒}\mathbf{)}`$ form a quadrant matching of either type:

In this case, there is nothing to prove.

$`\mathbf{(}𝒃\mathbf{)}\mathbf{(}𝒗_\mathrm{𝟏}\mathbf{,}𝒗_\mathrm{𝟐}\mathbf{)}\mathbf{,}\mathbf{(}𝒗_\mathrm{𝟑}\mathbf{,}𝒗_\mathrm{𝟒}\mathbf{)}`$ connect one quadrant with both adjacent quadrants:

Suppose without loss of generality $`v_1,v_3P^{}`$, $`v_2P^+,v_4P^+`$, as shown in the figure. Since two edges adjacent to vertices in $`P^{}`$ are already given, there can be at most $`2n^{}2=2n^{++}2`$ edges between $`P^{}`$ and $`P^{++}`$, so there must be an edge connecting two vertices in $`P^{++}`$, or two edges connecting $`P^{++}`$ to adjacent quadrant sets. In the first case we have a quadrant matching of the second type and in the second case we have a quadrant matching of the first type, so the claim follows.

$`\mathbf{(}𝒄\mathbf{)}\mathbf{(}𝒗_\mathrm{𝟏}\mathbf{,}𝒗_\mathrm{𝟐}\mathbf{)}\mathbf{,}\mathbf{(}𝒗_\mathrm{𝟑}\mathbf{,}𝒗_\mathrm{𝟒}\mathbf{)}`$ connect the same pair of adjacent quadrants:

Suppose without loss of generality $`v_1,v_3P^{}`$, $`v_2,v_4P^+`$. Since two edges adjacent to vertices in $`P^+`$ are already given, there can be at most $`2n^+2=2n^+2`$ edges between $`P^+`$ and $`P^+`$, so there must be an edge connecting two vertices in $`P^+`$ (and we are done), or there must be two edges between $`P^+`$ and adjacent quadrant sets, either yielding a quadrant matching of the first type (and we are done), or reducing this case to case (b). $`\mathrm{}`$

Now we can give an upper bound on the length of an optimal tour with a given pair of edges.

###### Lemma 17

Let $`e_1=(p_1,p_2)`$ be an edge connecting two adjacent quadrant sets, say, $`P^{}`$ and $`P^+`$. Let $`e_2=(p_3,p_4)`$ be an edge forming a quadrant matching with $`e_1`$. Let $`p_i=(x_i,y_i)`$, and define $`z_1:=\mathrm{min}\{(y_cy_1),(y_cy_2)\}`$, $`z_2:=\mathrm{min}\{(y_3y_c),(y_4y_c)\}`$.

Then any tour containing $`e_1`$ and $`e_2`$ has length at most $`2\mathrm{min}S(P)2z_12z_2`$.

Proof: Since $`L_1(p_1,p_2)=L_1(p_1,c)+L_1(c,p_2)2z_1`$, and $`L_1(p_3,p_4)L_1(p_3,c)+L_1(c,p_4)2z_2`$, the claim follows. $`\mathrm{}`$

By considering all pairs of edges, we get an adjusted upper bound on the tour length. For this purpose, let $`Z_1=\mathrm{min}\{|y_cy_i|p_iP^{}P^+\}`$, and let $`Z_2=\mathrm{min}\{|y_iy_c|p_iP^+P^{++}\}`$. Similarly, let $`Z_3=\mathrm{min}\{|x_cx_i|p_iP^{}P^+\}`$, and let $`Z_4=\mathrm{min}\{|x_ix_c|p_iP^+P^{++}\}`$. Finally, let $`Z_{}=\mathrm{min}\{Z_1+Z_2,Z_3+Z_4\}`$.

###### Lemma 18

Let $`n`$ be even, and all quadrant sets be nonempty. Then an optimal tour of $`P`$ has length $`\mathrm{min}S(P)2Z_{}`$, and such a tour can be found in linear time.

Proof: It follows immediately from Lemmas 1617 and the definition of $`Z_{}`$ that $`\mathrm{min}S(P)2Z_{}`$ is a valid upper bound that can be computed in linear time. To see that there is a tour of this length, consider a pair of vertices where the value $`Z_{}`$ is met. Without loss of generality, let this be for $`p_1P^{}`$ and $`p_2P^{++}`$. Connect $`p_1`$ to any vertex in $`P^+`$, and $`p_2`$ to any vertex in $`P^+`$. Now it is easy to see that using only edges connecting opposite quadrant sets, we can get a tour. See Figure 5. $`\mathrm{}`$

This concludes the proof of Theorem 3.

### 4.4 An extension

Using a rotation by $`\pi /4`$, it is easy to transform $`L_{\mathrm{}}`$ distances to $`L_1`$ distances, so the theorem remains valid for this case. Moreover, any 4-facet polyhedral metric can be transformed into the $`L_1`$ metric with an appropriate coordinate transformation, turning the unit ball into a square. See Figure 6 for an illustration. All arguments described in the preceding section can still be applied for these transformed coordinates, so the following generalization holds:

###### Theorem 19

For any 4-facet polyhedral metric in the plane, a tour of maximum possible length can be constructed in linear time.

We conclude this section by noting that Theorem 8 does not appear to extend to two-dimensional metrics with more than four facets, the two-dimensional Euclidean metric, or the rectilinear metric in higher dimensions.

To see that there is no easy generalization even for $`L_1`$ distances in higher dimensions, note that the partition into orthants by an optimal star center may not induce a “balanced” partition of the point set, such that we have subsets of equal size in opposite orthants.

###### Example 20

Consider $`P`$ with $`\frac{n1}{4}`$ points in each of the orthants $`\{q=(x,y,z)x>0,y>0,z>0\}`$, $`\{q=(x,y,z)x<0,y<0,z>0\}`$, $`\{q=(x,y,z)x<0,y>0,z<0\}`$, $`\{q=(x,y,z)x>0,y<0,z<0\}`$, plus the point $`(0,0,0)`$. Then $`(0,0,0)`$ is the unique optimal star center. No connection of points in different orthants keeps the triangle inequality tight.

That there is a fundamental difference between the Euclidean and rectilinear metrics for the plane is clear from the following.

###### Corollary 21

For any set of $`n`$ points in the plane, there are $`\mathrm{\Omega }\left((\frac{n}{4}!)^4\right)`$ many tours which are optimal for the Maximum TSP under rectilinear distances. If the distances are Euclidean, there may only be one optimal tour.

Proof: Any tour that can be constructed as in Lemma 10, Lemma 15, or Lemma 18 is optimal, so we can choose an arbitrary permutation for each quadrant set. This yields the above lower bound on the number of optimal tours. Conversely, we see that any optimal tour must have the structure described in the Lemmas.

To see that there may only be one optimal tour for Euclidean distances, consider a set of $`n=2k+1`$ points that are evenly distributed around a unit circle. $`\mathrm{}`$

## 5 NP-Hardness Results

Now we proceed to show that changing from polyhedral to Euclidean distances, or to distances in spaces of unbounded dimension, changes the problem complexity from polynomial (or even linear) to NP-hard. This dramatic effect illustrates that failing to model geometric instances of optimization problems beyond their combinatorial graph structure can miss out on important differences in problem complexity.

### 5.1 Euclidean Distances in 3D

In this section, we establish the NP-hardness of the Maximum TSP under Euclidean distances in $`^d`$. The proof gives a reduction of the well-known problem Hamilton Cycle in Grid Graphs, which was shown to be NP-complete by Itai, Papadimitriou, and Swarcfiter . A grid graph $`G`$ is given by a finite set of vertices $`V=\{v_1v_2,\mathrm{},v_n\}`$, with each vertex $`v_i`$ represented by a grid point $`(x_i,y_i)Z^2`$; for easier notation, we write $`v_i=(x_i,y_i)`$. Two vertices $`v_i`$ and $`v_j`$ in $`G`$ are adjacent if and only if they are at distance 1, i. e., if $`(x_ix_j)^2+(y_iy_j)^2=1`$. Without loss of generality, we may assume that $`G`$ is connected, and that $`n`$ is sufficiently large. Note that any grid graph is bipartite: vertices $`v_i`$ with $`x_i+y_i`$ even can only be adjacent to vertices $`v_j`$ with $`x_j+y_j`$ odd, and vice versa. In the following, we will denote this partition by $`V=V_e\dot{}V_o`$, where $`V_e`$ is the set of vertices with even coordinate sum, while $`V_o`$ is the set of vertices with odd coordinate sum.

The basic idea of the proof is to embed any grid graph $`G`$ into the surface of a sphere in $`^3`$, such that edges in the grid graph correspond to longest distances within the point set. This can be achieved by representing the vertices in $`V_e`$ by points that are relatively close to each other around a position $`(a,b,c)`$ on the sphere, and the vertices in $`V_o`$ by points close to each other at a position on the sphere that is roughly opposite (i. e., antipodal) to $`(a,b,c)`$; for simplicity of description by spherical coordinates, we will use positions that are close to the equator. Locally, the mapping of the two point sets onto the sphere is an approximation of the relative position of vertices in the grid graph. Since adjacent vertices in a grid graph have different parity, unit edges in the grid graph representation correspond to edges connecting points that are almost at opposite positions on the sphere, and vice versa.

In the following, the technical details are described. For simplicity, we use spherical coordinates and multiples of $`\pi `$. However, it will become clear from our discussion that we only require computations of bounded accuracy. It is straightforward to use only Cartesian coordinates that can be obtained by polynomial time approximation within the desired overall error bound of $`O\left(n^8\right)`$ for the length of an edge.

Represent each vertex $`v_i`$ by a point $`S(v_i)`$ on the unit sphere, described by spherical coordinates $`(r,\varphi ,\theta )`$, which translate into Cartesian coordinates by $`x=r\mathrm{cos}\varphi \mathrm{cos}\theta `$, $`y=r\mathrm{sin}\varphi \mathrm{cos}\theta `$, $`z=r\mathrm{sin}\theta `$. Note that, as in standard geographic coordinates, the “equator” of the sphere is given by $`\theta =0`$; the angle $`\theta `$ describes the “latitude” of a point, while $`\varphi `$ describes the “longitude”. Since we will only consider points with $`r=1`$, we will simply write $`(\varphi ,\theta )`$ in spherical coordinates, but $`(x,y,z)`$ in Cartesian coordinates. Let $`\psi =\frac{2\pi }{n^3}`$. Now any vertex $`v_iV_e`$ is represented by a point $`S(v_i)=(x_i\psi ,y_i\psi )`$. Any vertex $`v_iV_o`$ is represented by a point $`S(v_i)=(\pi +x_i\psi ,y_i\psi )`$.

###### Lemma 22

There is a small constant $`\epsilon _n=O\left(n^8\right)`$, which can be computed in polynomial time, such that for the three-dimensional Euclidean distance $`L_2`$ between two points $`S(v_i)`$ and $`S(v_j)`$, the relation $`L_2(S(v_i),S(v_j))2\frac{\psi ^2}{4}\epsilon _n`$ holds if and only if $`v_i`$ and $`v_j`$ are adjacent in $`G`$. In that case, $`L_2(S(v_i),S(v_j))2\frac{\psi ^2}{4}+\epsilon _n`$. If $`v_i`$ and $`v_j`$ are not adjacent in $`G`$, then $`L_2(S(v_i),S(v_j))2\sqrt{5}\frac{\psi ^2}{4}+\epsilon _n`$.

Proof: Since the diameter of the grid graph cannot exceed $`n`$, it is easy to see that we have $`L_2(S(v_i),S(v_j))n\psi =O\left(n^2\right)`$ whenever $`v_i`$ and $`v_j`$ have the same parity. Therefore consider $`v_iV_e`$ and $`v_jV_o`$. Then

$`\left[L_2(S(v_i),S(v_j))\right]^2`$
$`=`$ $`[L_2((\mathrm{cos}(x_i\psi )\mathrm{cos}(y_i\psi ),\mathrm{sin}(x_i\psi )\mathrm{cos}(y_i\psi ),\mathrm{sin}(y_i\psi )),`$
$`(\mathrm{cos}(\pi +x_j\psi )\mathrm{cos}(y_j\psi ),\mathrm{sin}(\pi +x_j\psi )\mathrm{cos}(y_j\psi ),\mathrm{sin}(y_j\psi )))]^2`$
$`=`$ $`\left[\mathrm{cos}(x_i\psi )\mathrm{cos}(y_i\psi )+\mathrm{cos}(x_j\psi )\mathrm{cos}(y_j\psi )\right]^2+\left[\mathrm{sin}(x_i\psi )\mathrm{cos}(y_i\psi )+\mathrm{sin}(x_j\psi )\mathrm{cos}(y_j\psi )\right]^2`$
$`+\left[\mathrm{sin}(y_i\psi )+\mathrm{sin}(y_j\psi )\right]^2`$
$`=`$ $`[(1{\displaystyle \frac{(x_i\psi )^2}{2}}+O\left((x_i\psi )^4\right))(1{\displaystyle \frac{(y_i\psi )^2}{2}}+O\left((y_i\psi )^4\right))`$
$`+(1{\displaystyle \frac{(x_j\psi )^2}{2}}+O\left((x_j\psi )^4\right))(1{\displaystyle \frac{(y_j\psi )^2}{2}}+O\left((y_j\psi )^4\right))]^2`$
$`+`$ $`[(x_i\psi O\left((x_i\psi )^3\right))(1{\displaystyle \frac{(y_i\psi )^2}{2}}+O\left((y_i\psi )^4\right))`$
$`+(x_j\psi O\left((x_j\psi )^3\right))(1{\displaystyle \frac{(y_j\psi )^2}{2}}+O\left((y_j\psi )^4\right))]^2`$
$`+`$ $`\left[y_i\psi O\left((y_i\psi )^3\right)+y_j\psi O\left((y_j\psi )^3\right)\right]^2`$
$`=`$ $`\left[2{\displaystyle \frac{(x_i\psi )^2}{2}}{\displaystyle \frac{(y_i\psi )^2}{2}}{\displaystyle \frac{(x_j\psi )^2}{2}}{\displaystyle \frac{(y_j\psi )^2}{2}}+O\left(n^8\right)\right]^2`$
$`+\left[x_i\psi +x_j\psi +O\left(n^6\right)\right]^2+`$
$`+\left[y_i\psi +y_j\psi +O\left(n^6\right)\right]^2+`$
$`=`$ $`\left[42(x_i\psi )^22(y_i\psi )^22(x_j\psi )^22(y_j\psi )^2+O\left(n^8\right)\right]`$
$`+\left[(x_i\psi )^2+(x_j\psi )^2+2x_ix_j\psi ^2+O\left(n^8\right)\right]+\left[(y_i\psi )^2+(y_j\psi )^2+2y_iy_j\psi ^2+O\left(n^8\right)\right]`$
$`=`$ $`4(x_ix_j)^2\psi ^2(y_iy_j)^2\psi ^2+O\left(n^8\right).`$
Since $`v_i`$ and $`v_j`$ have different parity, we have $`(x_ix_j)^2\psi ^2+(y_iy_j)^2\psi ^2=\psi ^2`$ if $`v_i`$ and $`v_j`$ are adjacent in $`G`$, and $`(x_ix_j)^2\psi ^2+(y_iy_j)^2\psi ^25\psi ^2`$ if $`v_i`$ and $`v_j`$ are not adjacent in $`G`$, so the claim follows. $`\mathrm{}`$

From Lemma 22, it is straightforward to conclude that there is a tour of length at least $`2nn\frac{\psi ^2}{4}n\epsilon _n`$, if and only if the grid graph $`G`$ is Hamiltonian.

By setting additional coordinates equal to zero, we conclude the proof of Theorem 4 for arbitrary dimensions $`d3`$.

### 5.2 Higher-Dimensional Implications

There are various implications of Theorem 4 to higher dimensions. It is not hard to generalize the construction and the proof of Lemma 22 to the case of $`L_p`$ norms, as long as $`p\{1,\mathrm{}\}`$: Instead of using a unit sphere for the embedding, use an $`L_p`$ ball of dimension 3, which has a smooth surface whenever $`p1,\mathrm{}`$. The error bounds can be worked out in an analogous way.

Combined with Theorem 1, we note:

###### Corollary 23

Provided that P$``$NP, the Maximum TSP under an $`L_p`$ norm in $`^d`$ with $`d3`$ fixed is solvable in polynomial time, if and only if $`p\{1,\mathrm{}\}`$.

There is a close connection between the Euclidean norm and polyhedral norms when the number of facets $`k`$ is not fixed, as was pointed out by Joe Mitchell : Since we only need to consider $`O\left(n^2\right)`$ directions for connections between points, we can replace the Euclidean distances $`L_2`$ by a polyhedral norm with $`O\left(n^2\right)`$ facets.

###### Corollary 24

The Maximum TSP under a polyhedral norm having a unit ball with $`k`$ facets in $`^d`$ is an NP-hard problem, if $`d3`$ and $`k`$ is part of the input.

Another easy consequence concerns the Maximum Scatter TSP, which was first considered by Arkin, Chiang, Mitchell, Skiena, and Yang . In this problem, the objective is to find a tour that maximizes the length of the shortest edge. Arkin et al. gave an NP-hardness proof for the general case and a 2-approximation that uses only triangle inequality. The complexity for geometric instances was left as an open problem. Using the above construction and Lemma 22, we get:

###### Corollary 25

The Maximum Scatter TSP under Euclidean distances in $`^d`$ is an NP-hard problem if $`d3`$.

Finally, it is straightforward with the above construction to show the following:

###### Corollary 26

The Maximum TSP and the Maximum Scatter TSP under shortest distances on the $`(d1)`$-dimensional surface of the $`d`$-dimensional unit sphere $`S^{d1}`$ are NP-hard for $`d3`$.

It was also noted by Joe Mitchell that another corollary can be derived by using an approximation with $`O\left(n^2\right)`$ facets:

###### Corollary 27

The Maximum TSP and the Maximum Scatter TSP on the $`(d1)`$-dimensional surface of a $`d`$-dimensional convex polytope with an unbounded number of facets under geodesic distances are NP-hard for $`d3`$.

Another set of questions concerns the complexity of the Maximum TSP when $`d`$ is not fixed. It is relatively easy to show that the problem is NP-hard for $`L_p`$ norms:

###### Theorem 28

The Maximum TSP and the Maximum Scatter TSP are NP-hard for points in $`d`$-dimensional space under $`L_p`$ norms, $`1<p\mathrm{}`$, when $`d`$ is part of the input.

Proof: We use a transformation from the Hamiltonian Circuit problem for simple cubic graphs $`G=(V,E)`$, which was shown to be NP-complete by Garey, Johnson, and Tarjan . We use a separate dimension for each edge $`eE`$, and a point $`p_i`$ for each vertex $`v_iV`$: For edge $`e=(v_i,v_j)`$, choose the $`x_e`$-coordinate of one of the points (say, $`p_i`$) to be $`1`$, and the $`x_e`$-coordinate of the other point (say, $`p_j`$) to be $`1`$. All other $`x_e`$-coordinates are chosen to be $`0`$. This means that the $`L_p`$-distance between points representing adjacent vertices in $`G`$ is the “long” value $`L_{\mathrm{max}}:=\sqrt[p]{2^p+4}`$ (2 for $`L_{\mathrm{}}`$), while nonadjacent vertices get the “short” distance $`L_{\mathrm{min}}:=\sqrt[p]{6}`$ (1 for $`L_{\mathrm{}}`$). For fixed $`p>1`$, it is straightforward to compute a critical value $`L<L_{max}`$ in polynomial time such that there is a tour of length $`nL`$ or greater if and only if there is a Hamiltonian cycle in $`G`$. $`\mathrm{}`$

This leaves open the case of the $`L_1`$ metric when $`d`$ is not fixed, although we conjecture that the $`L_1`$ case is NP-complete as well. Also open is the question of whether there might be a PTAS for any such norm when $`d`$ is not fixed. Trevisan  has shown that the Minimum TSP is Max-SNP-hard for any such norm, and so cannot have such PTAS’s unless P = NP. We can obtain a similar result for the Maximum TSP under $`L_{\mathrm{}}`$ by modifying our NP-hardness transformation to prove Max-SNP-hardness and hence by  the existence of an $`ϵ`$ such that no polynomial time approximation algorithm can guarantee a solution within a factor of $`1+ϵ`$ of optimal unless P = NP.

###### Theorem 29

The Maximum TSP and the Maximum Scatter TSP are Max-SNP-hard for points in $`d`$-dimensional space under $`L_{\mathrm{}}`$-norms when $`d`$ is part of the input.

Proof: The source problem is the Minimum TSP with all edge lengths in $`\{1,2\}`$, a special case that was proved Max-SNP-hard by Papadimitriou and Yannakakis . We use the construction of our previous proof, with edges of length 1 as “edges,” edges of length 2 as “non-edges,” and each “edge” having its own coordinate in $`|E|`$-dimensional space. For this coordinate, one endpoint gets value $`+1`$, the other gets $`1`$, and all other points get value $`0`$. Thus, adjacent vertices in $`G`$ get mapped to points at the “long” $`L_{\mathrm{}}`$-distance 2, while each pair of vertices at distance 2 in $`G`$ gets mapped to a pair of points at “short” $`L_{\mathrm{}}`$-distance 1. Therefore, long tours in the constructed point set correspond to short tours in the original graph. Now the Max-SNP-hardness is immediate, as a Maximum TSP tour of length at least $`(2\epsilon )n`$, i.e., with at most $`\epsilon n`$ short edges, corresponds to a Minimum TSP tour of length at most $`(1+\epsilon )n`$, i.e., with at most $`\epsilon n`$ edges of length 2. $`\mathrm{}`$

The question remains open for $`L_p`$, $`1p<\mathrm{}`$, although we conjecture that these cases are Max-SNP-hard as well.

## 6 Conclusion

We have derived polynomial time algorithms for the Maximum TSP when the cities are points in $`^d`$ for some fixed $`d`$ and when the distances are measured according to some polyhedral norm or quasi-norm, with running time $`O(n^{k2}\mathrm{log}n)`$ for norms based on $`k`$-facet polyhedra and $`O(n^{2k2}\mathrm{log}n)`$ for quasi-norms based on $`k`$-facet polyhedra. Our approach is based on a solution method for the Tunneling TSP; we believe that the related Minimum TSP variant with city connections via a fixed set of hubs is of independent interest. We also gave an optimal $`O(n)`$ algorithm for the special case of 4-facet polyhedra in the plane, such as the rectilinear norm. We suspect it may be possible to improve on our complexity for $`L_1`$ distances in $`^3`$ by using some of our geometric ideas. (Since the unit ball for $`L_1`$ distances in $`^3`$ is an octahedron, the running time for our general algorithm is $`O(n^6\mathrm{log}n)`$.)

We have also shown that the Maximum TSP under Euclidean norm in $`^d`$ is NP-hard for any fixed $`d3`$. This shows that the complexity of an optimization problem is not just a consequence of its combinatorial structure or its geometry, but may be ruled by the structure of the particular distance function that is used. The result has similar implications for closely related problems.

The Euclidean case $`d=2`$ remains open; in the light of our results, it seems more likely that this problem is NP-hard, even though its counterpart with rectilinear distances turned out to be extremely simple. However, it is much harder to use strictly local arguments for geometric maximization problems, so a proof of NP-hardness may have to use a more involved construction.

###### Conjecture 30

The Maximum TSP for Euclidean distances in the plane is an NP-hard problem.

Acknowledgment. Thanks to Henk Meijer, Estie Arkin, Volker Kaibel, Joe Mitchell, Bill Pulleyblank, Mauricio Resende, Peter Shor, and Peter Winkler for helpful discussions, and to an anonymous referee for useful comments.