Keywords

1 Introduction

The motivation of this paper is threefold. Firstly, we are motivated by the famous NP-hardness result [12] obtained by Christos Papadimitriou for the Traveling Salesman Problem (TSP) on the Euclidean plane. Another motivation of this paper stems from recent parametric results both for classic TSP and its well-known modification Generalized Traveling Salesman Problem (GTSP), which are based on Balas precedence constraints [1, 2, 4] and generalized pyramidal tours [9, 11] and lead to efficient parameterized exact algorithms for these problems. Last (but not the least) motivation comes from recent achievements in computational geometry. In particular, the results concerning a special geometric type of the Euclidean GTSP, where the clusters are induced by cells of a regular planar grid introduced in the recent paper [3].

Theoretical significance of the Papadimitriou’s result can hardly be overestimated. Papadimitriou showed that the classic TSP is intractable even in such a specific setting as considered in [12]. Meanwhile, the one-dimensional Euclidean TSP is efficiently solvable. Therefore, the borderline between polynomially solvable instances of the Euclidean TSP and the NP-hard ones lies somewhere near to univariate and two-dimensional settings of this problem, since the known Papadimitriou intractability proof is based on polynomial time reduction of the Exact Cover by 3-Sets (X3C) Problem to the specific, substantially non-flat instances of the Euclidean TSP in the plane. Indeed, for any instance of the X3C, this reduction assigns an appropriate instance of the Euclidean TSP having the following properties:

  1. (i)

    for any nodes p and q, the distance between them is at least 1;

  2. (ii)

    the size of the nodeset grows proportionally to \(M\times N\), where N is the number of covering sets and M is the size of the groundset of the X3C instance to be reduced;

  3. (iii)

    the smallest axis-aligned rectangular box enclosing the nodeset (on the plane), whose width and height are proportional to the numbers N and M, respectively, i.e. both the height and the width of this box grow together with the nodeset size and can not be fixed.

Consider a subclass of the Euclidean TSP on the plane consisting of the instances, whose nodeset V satisfies the following additional constraints  

separability::

for some constants K and \(\delta >0\) and each \(V'\subset V\)defining the instance, any time when \(|V'|\ge K\), the diameter of \(V'\) exceeds \(\delta \);f

boundedness::

V can be enclosed to a bounding-box, one of the sizes of which, e.g. height, is fixed.

 

In this paper, we give a positive answer to the question: ‘Is the aforementioned subclass of the Euclidean TSP tractable?’ for a special type of the separability constraint defined by unit regular grid on the plane. Furthermore, we prove polynomial time solvability for a generalization of such a subclass known as Euclidean Generalized Traveling Salesman Problem in Grid Clusters defined by a grid of a fixed height h (EGTSP-GC\((h)\)).

The rest of the paper is structured as follows. In Sect. 2, we present the setting of the EGTSP-GC and remind some known related results. In Section 3 we introduce pseudo-pyramidal tours for the GTSP and show that for any fixed l, an l-pseudo-pyramidal tour of minimal cost can be found efficiently. In Sect. 4, we show that, for any instance of the EGTSP-GC\((h)\), each optimal tour is l(h)-pseudo-pyramidal, for some value l(h) independent on the instance and n and come to the final conclusion on tractability both of the EGTSP-GC\((h)\) and the corresponding subclass of the Euclidean TSP in the plane.

2 Euclidean Generalized Traveling Salesman Problem in Grid Clusters

The Generalized Traveling Salesman Problem (GTSP) is a widely known extension of the famous Traveling Salesman Problem (TSP). An instance of the GTSP is defined by a complete edge-weighted graph \(G=(V,E,c)\), cost function \(c:V^2\rightarrow \mathbb {R}_+\), and partition \(V_1\cup \ldots \cup V_k=V\) of the nodeset V onto k non-empty disjoint clusters. A cyclic tour \(\tau =v_{i_1},\ldots ,v_{i_k}\) is feasible, if it visits each cluster \(V_{i_j}\) exactly once. The goal is to find a feasible tour of the minimum cost

$$C(\tau )=\sum _{j=1}^{k-1} c(v_{i_j},v_{i_{j+1}})+c(v_{i_k},v_{i_1}).$$

We consider a geometric setting of the GTSP known as the Euclidean Generalized Traveling Salesman Problem in Grid Clusters (EGTSP-GC) introduced recently in [3] by Bhattacharya et al. For any instance of the EGTSP-GC, the graph G, cost function c, and clustering \(V_1\ldots ,V_k\) have a geometric nature:

  1. (i)

    the nodeset V of the graph G is a finite subset of the plane

  2. (ii)

    for any \(u,v\in V\), the cost \(c(u,v)=\Vert u-v\Vert _2\) is defined by the Euclidean distance between these points

  3. (iii)

    clusters are determined implicitly by non-empty cells of the unit gridFootnote 1 of some height h and width w.

As for the general setting of the GTSP, the goal is to find any feasible tour of the minimum cost (length).

Like the general case of the GTSP, the EGTSP-GC NP-hard, if the number of clusters k belongs to the instance. In [3], for this case of the EGTSP-GC and for any \(\varepsilon >0\), a \((1.5+8\sqrt{2}+\varepsilon )\)-approximation algorithm was proposed. Augmented by some additional constraints, the problem may become approximable much better. For instance, the results of [5] imply that for any instance defined by a grid with a fixed height h, such that the set of non-empty cells is connected, a 2-approximate solution can be found in a polynomial time.

In [7, 8], three polynomial time approximation schemes for slow and fast growing dependence of the number of clusters k on the size n of the nodeset were proposed. Actually, first two of them have time complexity bounds of \(O(k^2O(1/\varepsilon )^{2k})+O(n)\) and \(2^{O(k)}k^4(\log k)^{O(1/\varepsilon )}+O(n)\), respectively, and remain PTAS for \(k=O(\log n)\). The last one, for any \(\varepsilon >0\), provides a \((1+\varepsilon )\)-approximate solution in time of \((n/k)^k(\log k)^{O(1/\varepsilon )}\) depending on n polynomially for \(k=np-O(\log n)\).

In the sequel, we consider the subclass of the EGTSP-GC defined by grids of height at most h, which is called EGTSP-GC\((h)\). The special case of the EGTSP-GC\((h)\)consisting of the instances, whose clusters has a single node, satisfies the aforementioned separability and boundedness conditions. Indeed, boundedness is valid, obviously. Separability can be represented in terms of the following assertion proven in [3].

Assertion 1

For any subset \(V'\subset V\) of size \(|V'|\ge 5\), any tree T spanning the subset \(V'\) has weight at least 1.

In [10], we showed that any instance of the EGTSP-GC(2) can be solved to optimality in time of \(O(n^3)\). In this paper, we extend this result to the case of any fixed \(h\ge 1\).

3 Pseudo-Pyramidal Tours

We proceed with some technical background concerning the general case of the Generalized Traveling Salesman Problem (GTSP).

Any ordering of clusters \(V_1,\ldots ,V_k\) induces the corresponding partial order on the nodeset V as follows: for any \(u\in V_{i}\) and \(v\in V_{j}\), \(u \prec v\) iff \(i<j\).

In the sequel, it is convenient to assume that, for any feasible tour \(\tau =v_{i_1},v_{i_2},\ldots , v_{i_k}\), its vertices are indexed by numbers of the clusters that contain them, i.e. \(v_{i_j}\in V_{i_j}\).

We consider a special type of feasible tours that are consistent with the defined order. We call these tours pseudo-pyramidal [9].

Definition 1

A tour \(\tau =v_{1},v_{i_1},\ldots ,v_{i_r}, v_k, v_{j_{k-r-2}},\ldots ,v_{j_1}\) is called an l-pseudo-pyramidal tour, if \(i_p-i_{p+1}\le l\) and \(j_{q}-j_{q+1}\le l\) for any \(1\le p\le r-1\) and \(1\le q\le k-r-3\).

Actually, any l-pseudo-pyramidal tour consists of two chains \(v_1, v_{i_1},\ldots , v_k\) and \(v_k,\ldots ,v_{j_1},v_1\) that are ‘almost monotonous’ with respect to the aforementioned order. We denote them \(\tau ^+\) and \(\tau ^-\), respectively. Similarly to the classic pyramidal tours (see, e.g. [6]), pseudo-pyramidal tours of minimum (or maximum) cost can be found efficiently.

Theorem 1

For any instance of the GTSP with an arbitrary non-negative cost function, a minimum cost l-pseudo-pyramidal tour can be found in time \(O(k\cdot l \cdot n^{O(l)})\).

Proof

Generally, our proof follows to the proof of Theorem 3.7 from [11] for the classic TSP. We start with some necessary notation. For any nodes \(u,v\in V\), we introduce ordered pairs \((u,v)^+\) and \((u,v)^-\). Each pair induces a number of subtours connecting in the graph G the nodes u and v. Any such a subtour P is called feasible for the pair \((u,v)^+\) (pair \((u,v)^-\)) if P belongs to the chain \(\tau ^+\) (chain \(\tau ^-\)) of some l-pseudo-pyramidal tour in the graph G.

In the sequel, we consider sets \(S=\{p_1,p_2,\ldots , p_m\}\) of node-pairs \(p_j\) introduced above such that

  1. (i)

    \(p_1=(u_1, v_1)^+\), \(p_2=(u_2,u_1)^-\) for some node \(u_1\in V_1\) and nodes \(v_1, u_2\) from other clusters \(V_{i_1}\) and \(V_{i_2}\);

  2. (ii)

    all the pairs are mutually disjunctive except the pairs \(p_1\) and \(p_2\).

To any set \(S=\{p_1,p_2,\ldots , p_m\}\), we assign a subset \(Q=Q(S)\subset V\) comprising all the endpoints of the pairs \(p_j\in S\).

Given by an integer \(1\le i\le k-1\) and a set S, we consider collections of feasible subtours \(P_1,P_2,\ldots , P_m\) induced by the pairs \(p_1,\ldots ,p_m\), respectively, visiting all the clusters \(V_1,\ldots , V_i\) once (except the cluster \(V_1\), which is visited twice by \(P_1\) and \(P_2\)). By \(f_l(i,S)\) we denote the total cost of the cheapest collection among them. Evidently,

$$\begin{aligned} OPT=\min _{u_1\in V_1, u_k\in V_k}\ \min _{\{s,t\}\subset V_2\cup \ldots \cup V_{k-1}} \{f_l(k-1,\{(u_1,s)^+,(t,u_1)^-\})\\+w(s,u_k)+w(u_k,t)\} \end{aligned}$$
(1)

To compute values of \(f_l\) we use dynamic programming procedure as follows.

Case 1. Suppose S contains a pair \(p=(u,u)^+\) (or \(p=(u,u)^-\)) for some \(u\in V_i\). In this case, \(f_l(i,S)=f_l(i-1,S\setminus \{p\})\).

Case 2. Suppose there exist a pair \(p=(u,v)^+\in S\) such that \(u\in V_i\) and \(v\in V_j\). Then, in the subtour P induced by the pair p, there is a node t succeeding the node u. Since the resulting tour should be l-pseudo-pyramidal

$$ f_l(i,S)=\min _{t\in \cup V_\alpha , \alpha \in [i-l,i)\setminus Q}\{f_l(i-1, S\cup \{(t,v)^+\}\setminus \{p\}) +w(u,t)\}. $$

Case 3. Suppose \(p=(u,v)^-\in S\), where \(u\in V_i\) and \(v\in V_j\). Then,

$$ f_l(i,S)=\min _{t\in \cup V_\alpha , \alpha \in [1,i)\setminus Q}\{f_l(i-1, S\cup \{(t,v)^-\}\setminus \{p\}) +w(u,t)\}. $$

Cases 4 and 5, where \((v,u)^+\in S\) and \((v,u)^-\in S\) are similar to Case 3 and Case 4, respectively.

Case 6. For any \(p=(u_a,v_a)\in S\), both nodes \(u_a\) and va do not belong to \(V_i\). in this case, to compute \(f_l(i,S)\), we suppose that some node \(u\in V_i\) is an inner vertex of some \(P_a\) (defined by elements of S). Denote the predecessor and the successor of u by s and t, respectively. Then,

figure a

for \(Q'=Q\setminus \{i_a,j_a\}\), where \(u_a\in V_{i_a}\) and \(v_a\in V_{j_a}\).

To estimate time complexity of the procedure proposed, we obtain upper bounds for the number of possible states (iS) and running time for each case, respectively.

The former bound comes from the following observation. By construction, for \(i=1\), there is a unique feasible state \(\left( 1,\{(1,1)^+, (1,1)^-\}\right) \). For any \(i>1\), each possible S consists of

  1. (i)

    two pairs \((u_1,v_1)^+\) and \((u_2,u_1)^-\) exactly for some \(u_1\in V_1\), \(v_1\in V_{i_1}\), and \(u_2\in V_{i_2}\), where \(1\ne i_1\ne i_2\);

  2. (ii)

    at most one pair, whose one or both ends belong to \(V_i\);

  3. (iii)

    at most \(l-1\) pairs featuring the representatives of clusters \(V_2,\ldots ,V_{i-1}\). Any pair of this kind has a form \((u,v)^+\) or \((v,u)^-\) for some \(u\in V_j\), where \(j\in [i-1-l,i)\).

Therefore, for any \(1\le i< k\), the number of possible states (iS) is

$$ O\left( n^3\cdot n^2\cdot \sum _{z=0}^{l-1} (2n)^z\left( {\begin{array}{c}n\\ z\end{array}}\right) \right) . $$

Since, for any z, the value \(f_l(i,S)\) can be obtained in time \(O(z\cdot n^2)\) and the final computations by formula (2) can be performed in time \(O(n^3)\) the overall complexity bound is

$$ k\cdot O(n^7)\sum _{z=0}^{l-1}O\left( z\cdot (2n)^z\left( {\begin{array}{c}n\\ z\end{array}}\right) \right) =O(kln^{2l+7})=O(kln^{O(l)}). $$

Theorem is proved.

4 Optimal Tours of EGTSP-GC\((h)\) are l(h)-Pseudo-Pyramidal

In this section, for any fixed h, we show that there exist a number \(l=l(h)\), such that all optimal tours of any EGTSP-GC\((h)\) instance are l(h)-pseudo-pyramidal. The clusters are numbered left to right and down to up (Fig. 1).

Fig. 1.
figure 1

Cluster numbering.

We proceed with some necessary notation. Without loss of generality, we assume that the grid is axis-aligned. For any point p in the plane, by x(p) and y(p) we denote coordinates of the point p. Then, anywhere, we do not distinguish the tour \(\tau \) and the piece-wise linear curve in the plane induced by this tour. Further, suppose this curve contains some points p and q, by \(\tau (p,q)\) we denote a subtour of the \(\tau \) connecting this points (and starting at the point p).

Theorem 2

For any instance of the EGTSP-GC\((h)\), an arbitrary minimum cost tour is \((15h^3+2h)\)-pseudo-pyramidal.

For the sake of brevity, we provide a short sketch of the proof, its full version will be published in a forthcoming paper.

The main idea of the proof is as follows. Suppose, we are given by an instance of EGTSP-GC\((h)\) defined by a grid of height h and width w. Consider an arbitrary feasible tour \(\tau \), which is obviously l-pseudo-pyramidal for some value l. We show that, if \(l>15h^3+2h\), the tour \(\tau \) can be transformed locally to some shorter \(l'\)-pseudo-pyramidal tour \(\tau '\), for \(l'\le l\).

Without loss a generality we assume that the edge \(\{u,v\}\), for which

$$\begin{aligned} u\in V_{i_1}, v\in V_{i_2}\ \text{ and } i_1-i_2=l, \end{aligned}$$
(2)

belongs to the chain \(\tau ^+\) of the tour \(\tau \) and the smallest \(t\times h\) subgrid T. Furthermore, we assume that in T, the chain \(\tau ^+\) has the form as presented in Fig. 2.

Fig. 2.
figure 2

The subtour \(\tau (1,4)\) and the subgrid T containing the edge \(\{u,v\}\).

Namely, for the first time, the chain \(\tau ^+\) enters T at point 1 and finally leaves it at point 4. We denote this subtour by \(\tau (1,4)\). Of course, the tour \(\tau \) can leave T before it visits u or after visiting v, once or several times. Nevertheless, we assume that the segments \(\tau (1,2)\) and \(\tau (3,4)\) connecting points 1 and 2 and points 3 and 4, respectively, belong to the subgrid T completely. By virtue of our notation, Eq. (2) and the numbering of clusters \(V_1,\ldots ,V_k\), we have \(t\ge l/h\).

Consider a horizontal projection of the line segment [uv] connecting the nodes u and v. By construction, its length s satisfies the equation \(t-2\le s\le t\). Partition this projection onto 5 equal parts and consider the second and the fourth vertical stripes obtained (of width s / 5). We call these stripes \(S_2\) and \(S_4\), respectively (see Fig. 3). For any edge \(\{p,q\}\) of the subtour \(\tau (1,4)\) (and the corresponding line segment [pq]), denote the length of \([p,q]\cap S_j\) by \(C(p,q,S_j)\). Following to Assertion 1 we claim that

  1. (i)

    in the subtour \(\tau (1,2)\), there exists an edge \(\{p_1,q_1\}\), such that \(x(p_1)\le x(q_1)\) and \(C(p_1,q_1,S_2)\ge 1/4\);

  2. (ii)

    in the subtour \(\tau (3,4)\), there exists an edge \(\{p_2,q_2\}\), such that \(x(p_2)\le x(q_2)\) and \(C(p_2,q_2,S_4)\ge 1/4\);

Further, let \([p_1,q_1]\cap S_2=[\bar{p}_1,\bar{q}_1]\) and \([p_2,q_2]\cap S_4=[\bar{p}_2, \bar{q}_2]\). Excluding from the tour \(\tau \) the edge \(\{u,v\}\) and the segments \([\bar{p}_1,\bar{q}_1]\) and \([\bar{p}_2,\bar{q}_2]\) and connecting the points \(\bar{p}_1\) with v, \(\bar{p}_2\) with \(\bar{q}_1\), and u with \(\bar{q}_2\) directly we obtain a new tour \(\tau '\), after shortcutting by the triangle inequality.

Fig. 3.
figure 3

Shortening the tour \(\tau \)

Comparing the lengths \(C(\tau )\) and \(C(\tau ')\) of the tours \(\tau \) and \(\tau '\), we obtain

$$\begin{aligned} \varDelta C=C(\tau ')-C(\tau )\le \sum _{i=1}^3\sqrt{(\alpha _is)^2+h^2}-s-1/2. \end{aligned}$$
(3)

In Eq. (3), we use notation \(\alpha _1s,\ldots ,\alpha _3s\) for the lengths of horizontal projections of the line segments \([\bar{p}_1,v]\), \([\bar{p}_2,\bar{q}_1]\), and \([u, \bar{q}_2]\), respectively. Since, by construction, \(\sum _{i=1}^3\alpha _i\le 1\) and any \(\alpha _i\ge 1/5\),

$$\begin{aligned} \varDelta C\le \sum _{i=1}^3(\sqrt{(\alpha _is)^2+h^2}-\alpha _is)-1/2=\sum _{i=1}^3\frac{h^2}{\sqrt{(\alpha _is)^2+h^2}+\alpha _is}-1/2\\ \le h^2\sum _{i=1}^3(2\alpha _is)^{-1}-1/2\le (15h^2/s-1)/2. \end{aligned}$$

To obtain \(\varDelta C<0\), it is sufficient to ensure

$$\begin{aligned} s>15 h^2. \end{aligned}$$
(4)

Since \(s\ge t-2\), Eq. (4) is valid any time, when \( t>15h^2+2, \) which follows from the equation

$$\begin{aligned} l>15h^3+2h. \end{aligned}$$
(5)

Thus, we showed that for any l satisfying Eq. (5), l-pseudo-pyramidal tour \(\tau \) can be shortened. Therefore, for any instance of the EGTSP-GC\((h)\), each optimal tour is \((15h^3+2h)\)-pseudo-pyramidal. Theorem 2 is proved.

Our main result is a simple consequence of Theorems 1 and 2.

Corollary 1

For any fixed h, any instance of the EGTSP-GC\((h)\) can be solved to optimality in time \(O(k\cdot l(h)\cdot n^{O(l(h))})\), where \(l(h)=15h^3+2h\).

Employing the results of [11] together with Theorem 2, we obtain the similar result for the Euclidean TSP on Grid of height h ETSP-GC\((h)\), which appears to be a special case of the EGTSP-GC\((h)\) with \(k=n\).

Corollary 2

Any instance of the ETSP-GC\((h)\) can be solved to optimality in time \(O(2^{l(h)}n^{l(h)+3})\), where \(l(h)=15h^3+2h\).

5 Conclusion

In this paper, we showed that the Euclidean Generalized Traveling Salesman Problem in Grid Clusters (EGTSP-GC\((h)\)) defined by a grid of the bounded height is polynomially solvable. The same result is valid for the special type of the Euclidean TSP on the plane.

The bound l(h) obtained in Theorem 2 seems to be untight and possibly can be improved. In particular, the numerical evaluation carried out on random instances of height 3 and \(n\in [100, 750]\) shows that the maximum observed value of l(3) is equal to 4 and does not depend on n.