# GPS: A New TSP Formulation for Its Generalizations Type QUBO

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Motivation

## 3. Related Work

## 4. QUBO Model in Quantum Computing

## 5. TSP Formulation

#### 5.1. Native Formulation

- Constraint 1. The salesman must leave each city once.$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{each}\phantom{\rule{4.pt}{0ex}}u\in \{0,\dots ,N\}:\phantom{\rule{4.pt}{0ex}}\sum _{v=1}^{N+1}\sum _{t=0}^{N}{x}_{u,v,t}=1.$$
- Constraint 2. Each city must be reached once.$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{each}\phantom{\rule{4.pt}{0ex}}v\in \{1,\dots ,N+1\}:\phantom{\rule{4.pt}{0ex}}\sum _{u=0}^{N}\sum _{t=0}^{N}{x}_{u,v,t}=1.$$
- Constraint 3. If the salesman leaves a city, he cannot return to it later. This constraint ensures that no unconnected cycles are formed as a solution. There are two ways of posing this constraint.
- -
- Imposing that once he leaves a city he cannot return to it.For each $u\in \{1,\dots ,N+1\}$:$$\sum _{v=0}^{N+1}\sum _{t=0}^{N}\sum _{w=0}^{N+1}\sum _{j=t+1}^{N}{x}_{u,v,t}{x}_{w,u,j}=0.$$
- -
- Imposing that once he arrives in a city, he must leave it.For each $t\in \{0,\dots ,N-1\}$, $u,v\in \{0,\dots ,N\}$:$${x}_{u,v,t}(1-\sum _{w=1}^{N+1}{x}_{v,w,t+1})=0.$$

#### 5.2. MTZ Formulation

## 6. GPS Formulation

- ${x}_{i,j,0}=1$ means that the edge $(i,j)$ does not appear in the path and the node i is reached earlier than the j.
- ${x}_{i,j,1}=1$ means that the edge $(i,j)$ appears in the path, so the node i is reached earlier than the j.
- ${x}_{i,j,2}=1$ means that the edge $(i,j)$ does not appear in the path, and the node j is reached earlier than the i.

- ${x}_{5,1,1}=1$: in this case it will take the value 1 since edge (5, 1) appears in the solution and node 5 is visited first.
- ${x}_{4,1,2}=1$: because in the solution we don’t have the connection (4, 1), we have the connection (1, 4) and the node 4 is visited later node 1.
- ${x}_{5,3,2}=1$: since the edge $(3,5)$ does not appear and node 3 is visited first.

- Constraint 1: For each $i,j$ one and only one of the 3 cases of r must be given, so$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{4.pt}{0ex}}i,j:\phantom{\rule{4.pt}{0ex}}\sum _{r=0}^{2}{x}_{i,j,r}=1.$$
- Constraint 2: Each node must be exited once.$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{each}\phantom{\rule{4.pt}{0ex}}i\in \{0,\dots ,N\}:\phantom{\rule{4.pt}{0ex}}\sum _{j=0}^{N+1}{x}_{i,j,1}=1.$$
- Constraint 3: Each node must be reached once.$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{each}\phantom{\rule{4.pt}{0ex}}j\in \{1,\dots ,N+1\}:\phantom{\rule{4.pt}{0ex}}\sum _{i=0}^{N}{x}_{i,j,1}=1.$$
- Constraint 4: If node i is reached before j, then node j is reached after i, so, $\mathrm{for}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{1.em}{0ex}}i,j\in \{0,\dots ,N+1\}\phantom{\rule{1.em}{0ex}}\mathrm{such}\phantom{\rule{4.pt}{0ex}}\mathrm{that}\phantom{\rule{1.em}{0ex}}i\ne j:$$${x}_{i,j,2}=1-{x}_{j,i,2}.$$It would also have to be specified for $r=0$ and $r=1$, however this restriction is sufficient since by (9) it is implicit.
- Constraint 5: If node i is reached before node j and node j is reached before node k, then node i must be reached before k. This condition will prevent the route from returning to a node from which it had already exited, thus preventing cycles from forming. We then arrive at the penalty function Equation (13).$$\sum _{i=1}^{N}\sum _{j=1}^{N}\sum _{k=1}^{N}({x}_{j,i,2}{x}_{k,j,2}-{x}_{j,i,2}{x}_{k,i,2}-{x}_{k,j,2}{x}_{k,i,2}+{x}_{k,i,2}).$$

## 7. New VRP Formulation

#### Original Formulation $5{N}^{2}Q$

- ${x}_{i,j,0,q}=1$ means that the vehicle q travels to the cities i and j, does not travel across the edge $(i,j)$ and arrives at the city i before the j.
- ${x}_{i,j,1,q}=1$ means that the vehicle q travels to the cities i and j travels across the edge $(i,j)$ (that is, once it passes through the city i the next city it reaches is the j) and therefore the city i is reached earlier than the city j.
- ${x}_{i,j,2,q}=1$ means that the vehicle q travels through the cities i and j and arrives at the city j earlier than at the city i.
- ${x}_{i,j,3,q}=1$ means that the vehicle q does not go through the cities i and j, and the city i is reached earlier than the city j. Note that ${x}_{i,j,3,q}$ can take the value 1 whether the vehicle q passes through one of both cities or neither of them.
- ${x}_{i,j,4,q}=1$ means that the vehicle q does not travel to the cities i and j, and the city j is reached earlier than the city i.

- Constraint 1: For each $i,j,q$, one and only one of the possibilities must be met for r, so:$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{4.pt}{0ex}}i,j,q:\phantom{\rule{4.pt}{0ex}}\sum _{r=0}^{4}{x}_{i,j,r,q}=1,$$
- Constraint 2: Each vehicle has to fulfill that it leaves the starting position. For this situation, we are going to impose that:$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{4.pt}{0ex}}q:\phantom{\rule{4.pt}{0ex}}\sum _{j=1}^{N+1}{x}_{0,j,1,q}=1,$$No vehicle can return to the starting position from a city, so:$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{4.pt}{0ex}}q:\phantom{\rule{4.pt}{0ex}}\sum _{i=0}^{N+1}{x}_{i,0,1,q}=0,$$
- Constraint 3: Every vehicle must finish in the final position. For this, it must be fulfilled that:$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{4.pt}{0ex}}q:\phantom{\rule{4.pt}{0ex}}\sum _{i=0}^{N}{x}_{i,N+1,1,q}=1,$$No vehicle can leave the final position. We then have that:$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{4.pt}{0ex}}q:\phantom{\rule{4.pt}{0ex}}\sum _{j=0}^{N+1}{x}_{N+1,j,1,q}=0.$$Vehicles that do not travel on any road will meet all constraints when taking the following condition:$${x}_{0,N+1,1,q}=1.$$
- Constraint 4: The vehicle must leave once and only once from each city, then:$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{each}\phantom{\rule{4.pt}{0ex}}i\in \{1,\dots ,N\}:\phantom{\rule{4.pt}{0ex}}\sum _{q=1}^{Q}\sum _{j=1}^{N+1}{x}_{i,j,1,q}=1.$$
- Constraint 5: The vehicle must arrive once and only once to each city, then:$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{each}\phantom{\rule{4.pt}{0ex}}j\in \{1,\dots ,N\}:\phantom{\rule{4.pt}{0ex}}\sum _{q=1}^{Q}\sum _{i=0}^{N}{x}_{i,j,1,q}=1.$$
- Constraint 6: The city i is reached before the city j does not depend on each vehicle. Therefore, for all the vehicles that either arrive at city i earlier than j, or arrive at city j earlier than i. Introducing the auxiliary variables ${a}_{i,j}$, we have the following constraint. $\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{1.em}{0ex}}i,j\in \{1,\dots ,N\}:$$$\sum _{q=1}^{Q}{x}_{i,j,0,q}+{x}_{i,j,1,q}+{x}_{i,j,3,q}={a}_{i,j}Q.$$It will then be true that for each $i,j$ or ${a}_{i,j}=1$, which means that the city i is reached earlier than the city j and therefore for each q we will have ${x}_{i,j,r,q}=1$ for any value of the r in which i is reached before j, or ${a}_{i,j}=0$, and we will have ${x}_{i,j,r,q}=0$ for all the vehicles and for values r where i is reached before j.
- Constraint 7: If the vehicle q arrives in the city j, then the vehicle q must leave the city j. For this we impose the constraint that for $i\in \{0,\dots ,N\}$, $j\in \{1,\dots ,N\}$ and $q\in \{1,\dots ,Q\}$:$${x}_{i,j,1,q}(1-\sum _{k=1}^{N+1}{x}_{j,k,1,q})=0.$$

- Constraint 8: It must be fulfilled that either the vehicle pass through the city i before the j or arrive before to the city j rather than the city i. Therefore, it must be verified that, $\mathrm{for}\phantom{\rule{1.em}{0ex}}i\in \{0,\dots ,N\},\phantom{\rule{1.em}{0ex}}j\in \{1,\dots ,N\}\phantom{\rule{1.em}{0ex}}\mathrm{and}\phantom{\rule{1.em}{0ex}}q\in \{1,\dots ,Q\}$:$${x}_{i,j,0,q}+{x}_{i,j,1,q}+{x}_{i,j,3,q}=1-({x}_{j,i,0,q}+{x}_{j,i,1,q}+{x}_{j,i,3,q}).$$
- Constraint 9: If city i is reached before j and city j is reached before city k, then city i must be reached before city k. This condition will prevent the vehicle from returning to a city it has already passed through and therefore prevents a cycle from forming. To introduce this constraint, we will directly calculate a penalty function worth 0 in the correct cases and 1 in those that are not. To facilitate the understanding of the penalty function, we are going to take, for $i,j,k,q$, the following variables:$$\begin{array}{cc}\hfill \phantom{\rule{1.em}{0ex}}& {a}_{i,j}={x}_{i,j,0,1}+{x}_{i,j,1,1}+{x}_{i,j,3,1}\hfill \\ & {a}_{j,k}={x}_{j,k,0,1}+{x}_{j,k,1,1}+{x}_{j,k,3,1}\hfill \\ & {a}_{i,k}={x}_{i,k,0,1}+{x}_{i,k,1,1}+{x}_{i,k,3,1}.\hfill \end{array}$$Remember that it is not necessary to introduce these conditions because the constraint (22) establishes the correct values of the variables ${a}_{i,j}$. Therefore, ${a}_{i,j}=1$ means that the city i is reached before the city j and the same with j and k. Also, it is very important to remember that due to the same constraint (22), we can take any of the vehicles as a reference. In this case, we have taken the first vehicle as a reference.In this way, fixed $i,j,k$, we have the 3 variables ${a}_{i,j},{a}_{j,k},{a}_{i,k}$. Remember that ${a}_{i,j},{a}_{j,k},{a}_{i,k}$ only take the values 0 or 1. Also, let us note that the cases that lead to values of the variables for which cycles can be formed and that we must discard are $({a}_{i,j},{a}_{j,k},{a}_{i,k})=(0,0,1)$ and $({a}_{i,j},{a}_{j,k},{a}_{i,k})=(1,1,0)$.In the case $(0,0,1)$ we would have that the city j is reached after the i, the k after the j, and yet the city k is reached rather than i, which is absurd. The case $(1,1,0)$ cannot be given either, since it reaches i before j and j before k, so it cannot be that we also reach k before i. We therefore must construct a penalty function so that for $f({a}_{i,j},{a}_{j,k},{a}_{i,k})$ it holds that $f(0,0,1)>0$, $f(1,1,0)>0$ y $f({a}_{i,j},{a}_{j,k},{a}_{i,k})=0$ for all other cases. A function that satisfies these conditions is from the Equation (26).$$f({a}_{i,j},{a}_{j,k},{a}_{i,k}):={a}_{i,j}{a}_{j,k}-{a}_{i,j}{a}_{i,k}-{a}_{j,k}{a}_{i,k}+{a}_{i,k}^{2}.$$$$\lambda \sum _{i=1}^{N}\sum _{j=1}^{N}\sum _{k=1}^{N}({a}_{i,j}{a}_{j,k}-{a}_{i,j}{a}_{i,k}-{a}_{j,k}{a}_{i,k}+{a}_{i,k}^{2}),$$
- Constraint 10: The objective we seek is to minimise vehicle travel time. What we could do is see how long each vehicle takes to complete the route and try to minimise as much of the time as possible. However, this function soon becomes complex so we have decided to develop a different idea that simplifies the process and smoothes the objective function. If we impose the condition that all vehicles travel less distance than the distance travelled by vehicle number 1, we will have that minimising the maximum of the distances will be equivalent to minimising the distance travelled by the first vehicle. We then have the following condition. For each $q\in \{2,\dots ,Q\}$:$$\sum _{i=0}^{N+1}\sum _{j=0}^{N+1}{d}_{i,j}{x}_{i,j,1,q}\le \sum _{i=0}^{N+1}\sum _{j=0}^{N+1}{d}_{i,j}{x}_{i,j,1,1}.$$We transform this inequality into equality by taking once again ${D}_{max}:={\sum}_{i=0}^{n}{max}_{j}\left\{{d}_{i,j}\right\}$ and the variables ${b}_{h,q}$ (the variables ${b}_{h,q}$ are like the sub tour’s one in the MTZ slack variables and they are in their binary expression) in:$$\sum _{i=0}^{N+1}\sum _{j=0}^{N+1}{d}_{i,j}{x}_{i,j,1,q}+\sum _{h=0}^{{h}_{max}}{2}^{h}{b}_{h,q}-\sum _{i=0}^{N+1}\sum _{j=0}^{N+1}{d}_{i,j}{x}_{i,j,1,1}=0.$$Under these conditions the function to be minimized corresponds to:$$\sum _{i=0}^{N+1}\sum _{j=0}^{N+1}{d}_{i,j}{x}_{i,j,1,1}.$$This condition has the disadvantage that we are eliminating solutions where it is another vehicle that travels the longest distance. Let us explore how to avoid this problem and get more flexibility in the model to make it easier for the Quantum Annealing to find the optimum one. We can establish an auxiliary variable D and we set that the distance travelled by each vehicle must be less than this variable, that is to say:$$\sum _{i=0}^{N+1}\sum _{j=0}^{N+1}{d}_{i,j}{x}_{i,j,1,q}\le D\phantom{\rule{4.pt}{0ex}},\phantom{\rule{4.pt}{0ex}}\mathrm{for}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{4.pt}{0ex}}q\in \{1,\dots ,Q\}.$$The variable D is an integer, so we must treat it in some way in order to include it in the model. As we explained in the introduction of the section dedicated to the formulation of the MTZ model Section 5.2, it is convenient to try to avoid the binary representation of integer variables. To do so, we can express D as a combination of the distances between edges by taking $D={\sum}_{i=0}^{N+1}{\sum}_{j=0}^{N+1}{x}_{i,j}{b}_{i,j}$. Thus after imposing the constraint (31) we have that the function to minimize is D.

## 8. Results

#### Discussion

- ${x}_{j,i,2}+{x}_{k,j,2}\le 2{x}_{k,i,2}+{w}_{i,j,k}^{1}$
- ${x}_{j,i,2}+{x}_{k,j,2}\ge 2{x}_{k,i,2}-{w}_{i,j,k}^{2}$.

## 9. Conclusions and Further Work

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## Appendix A

#### Appendix A.1. TSP Formulation N^{2}

#### Appendix A.2. Improved Model 3N^{2} Q

- ${x}_{i,j,0,q}=1$ means that the city i is reached earlier than the j and the edge $(i,j)$ is not travelled.
- ${x}_{i,j,1,q}=1$ means that the vehicle q travels the cities i and j, it reaches the city i before the j and it travels the edge $(i,j)$.
- ${x}_{i,j,2,q}=1$ means that the city j is reached earlier than the i and the edge $(j,i)$ is not travelled.

- Constraint 1: For each $i,j,q$, one and only one of the possibilities must be met for r, so:$$\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{4.pt}{0ex}}i,j,q:\phantom{\rule{4.pt}{0ex}}\sum _{r=0}^{2}{x}_{i,j,r,q}=1,$$
- Constraint 6: That the city i is reached before the city j does not depend on each vehicle. Therefore, for all the vehicles that either arrive at city i earlier than j, or arrive at city j earlier than i. Introducing the auxiliary variables ${a}_{i,j}$, we have the following constraint. $\mathrm{For}\phantom{\rule{4.pt}{0ex}}\mathrm{all}\phantom{\rule{1.em}{0ex}}i,j\in \{1,\dots ,N\}:$$$\sum _{q=1}^{Q}{x}_{i,j,0,q}+{x}_{i,j,1,q}={a}_{i,j}Q.$$
- Constraint 8: It must be fulfilled that either the vehicle pass through the city i before the j or arrive before to the city j than the i. Therefore, it must be verified that, $\mathrm{for}\phantom{\rule{1.em}{0ex}}i\in \{0,\dots ,N\},\phantom{\rule{1.em}{0ex}}j\in \{1,\dots ,N\}\phantom{\rule{1.em}{0ex}}\mathrm{and}\phantom{\rule{1.em}{0ex}}q\in \{1,\dots ,Q\}$:$${x}_{i,j,0,q}+{x}_{i,j,1,q}=1-({x}_{j,i,0,q}+{x}_{j,i,1,q}).$$
- Constraint 9: If the city i is reached before j and the city j is reached before the city k, then the city i must be reached before the city k. This condition will prevent the vehicle from returning to a city it has already passed through and therefore prevents a cycle from forming.$$\lambda \sum _{i=1}^{N}\sum _{j=1}^{N}\sum _{k=1}^{N}({a}_{i,j}{a}_{j,k}-{a}_{i,j}{a}_{i,k}-{a}_{j,k}{a}_{i,k}+{a}_{i,k}^{2}),$$

## Appendix B. Restriction Penalty

- -
- $P(0,0,1)=1$ So that ${c}_{6}=1$.
- -
- $P(0,1,0)=0$ So that ${c}_{4}=0$.
- -
- $P(0,1,1)=0$ So that ${c}_{5}+{c}_{6}=1\Rightarrow {c}_{5}=-1$.
- -
- $P(1,0,0)=0$ So that ${c}_{1}=0$.
- -
- $P(1,0,1)=0$ So that ${c}_{1}+{c}_{3}+{c}_{6}=0\Rightarrow {c}_{3}=-1$
- -
- $P(1,1,0)=1$ So that ${c}_{2}=1$.So far, we have a system of six equations with six certain compatible unknowns. First, however, an additional restriction must be verified. Let us verify if it is met.
- -
- $P(1,1,1)=0$. ${\sum}_{i=1}^{6}{c}_{i}=1-1-1+1=0$. So that indeed all the requirements are met.

## References

- Gavish, B.; Graves, S.C. The Travelling Salesman Problem and Related Problems; Operations Research Center, Massachusetts Institute of Technology: Boston, MA, USA, 1978. [Google Scholar]
- Hochba, D.S. Approximation algorithms for NP-hard problems. ACM Sigact News
**1997**, 28, 40–52. [Google Scholar] [CrossRef] - Lewis, M.; Glover, F. Quadratic unconstrained binary optimization problem preprocessing: Theory and empirical analysis. Networks
**2017**, 70, 79–97. [Google Scholar] [CrossRef] - Cipra, B. An introduction to the Ising model. Am. Math. Mon.
**1987**, 94, 937–959. [Google Scholar] [CrossRef] - McGeoch, C.; Cong, W. Experimental evaluation of an adiabiatic quantum system for combinatorial optimization. In Proceedings of the ACM International Conference on Computing Frontiers, Ischia, Italy, 14–16 May 2013; Volume 13. [Google Scholar]
- McGeoch, C. Adiabatic quantum computation and quantum annealing: Theory and practice. Synth. Lect. Quantum Comput.
**2014**, 5, 1–93. [Google Scholar] [CrossRef] - Brooke, J.; Rosenbaum, D.; Aeppli, G. Quantum annealing of a disordered magnet. Science
**1999**, 284, 779–781. [Google Scholar] [CrossRef] [PubMed][Green Version] - Born, M.; Fock, V. Beweis des Adiabatensatzes. Z. Phys.
**1928**, 51, 165–180. [Google Scholar] [CrossRef] - Farhi, E.; Gutmann, S.; Sipser, M. Quantum computation by adiabatic evolution. arXiv
**2000**, arXiv:quant-ph/0001106. [Google Scholar] - Bian, Z.; Macready, F.; William, G.; Geordie, R. The Ising Model: Teaching an old Problem New Tricks; D-Wave Systems Inc.: Burnaby, BC, Canada, 2010; Volume 2. [Google Scholar]
- Toth, P.; Vigo, D. The Vehicle Routing Problem; SIAM: Philadelphia, PA, USA, 2002. [Google Scholar]
- Toth, P.; Vigo, D. Models, relaxations and exact approaches for the capacitated vehicle routing problem. Discret. Appl. Math.
**2002**, 123, 487–512. [Google Scholar] [CrossRef][Green Version] - Ralphs, T.; Kopman, L.; Pulleyblank, W.; Trotter, L. On the capacitated vehicle routing problem. Math. Program.
**2003**, 94, 343–359. [Google Scholar] [CrossRef] - Atchade-Adelomou, P.; Alonso-Linaje, G.; Albo-Canals, J.; Casado-Fauli, D. qRobot: A Quantum Computing Approach in Mobile Robot Order Picking and Batching Problem Solver Optimization. Algorithms
**2021**, 14, 194. [Google Scholar] [CrossRef] - Miller, C.; Tucker, A.; Zemlin, R. Integer programming formulation of traveling salesman problems. Oper. Res. Lett.
**1960**, 10, 27–36. [Google Scholar] [CrossRef] - Boruvka, O. On a minimal problem. Práce Moravské Pridovedecké Spolecnosti
**1926**, 3, 37–58. [Google Scholar] - Boruvka, O. Prıspevek k rešenı otázky ekonomické stavby elektrovodnıch sıtı (contribution to the solution of a problem of economical construction of electrical networks). Elektronickỳ Obzor
**1926**, 15, 153–154. [Google Scholar] - Kruskal, J. On the shortest spanning subtree of a graph and the traveling salesman problem. Proc. Am. Math. Soc.
**1956**, 7, 48–50. [Google Scholar] [CrossRef] - Bellmore, M.; Nemhauser, G. The Traveling Salesman Problem: A Survey. Oper. Res.
**1968**, 16, 538–558. [Google Scholar] [CrossRef] - Lenstra, J.; Rinnooy Kan, H. Some Simple Applications of the Travelling Salesman Problem. J. Oper. Res. Soc.
**1975**, 26, 717–733. [Google Scholar] [CrossRef] - Adelomou, P.; Ribé, E.; Cardona, X. Formulation of the social workers’ problem in quadratic unconstrained binary optimization form and solve it on a quantum computer. J. Comput. Commun.
**2020**, 11, 44–68. [Google Scholar] [CrossRef] - Lee, J.Y.; Shi, S.-Y.; Park, T.H.; Zhang, B.-T. Solving traveling salesman problems with DNA molecules encoding numerical values. Biosystems
**2004**, 78, 39–47. [Google Scholar] [CrossRef][Green Version] - Ball, P. DNA Computer Helps Travelling Salesman; Springer Science and Business Media LLC: New York, NY, USA, 2000. [Google Scholar]
- Pataki, G. Teaching integer programming formulations using the traveling salesman problem. SIAM Rev.
**2003**, 45, 116–123. [Google Scholar] [CrossRef][Green Version] - Martoňák, R.; Santoro, G.; Tosatti, E. Quantum annealing of the traveling-salesman problem. Phys. Rev. E
**2004**, 70, 057701. [Google Scholar] [CrossRef][Green Version] - Warren, R. Adapting the traveling salesman problem to an adiabatic quantum computer. Quantum Inf. Process.
**2013**, 4, 1781–1785. [Google Scholar] [CrossRef] - Warren, R. Small traveling salesman problems. J. Adv. Appl. Math.
**2017**, 2. [Google Scholar] [CrossRef] - Greco, F. Traveling Salesman Problem; BoD–Books on Demand: Norderstedt, Germany, 2008; ISBN 978-953-51-5750-2. [Google Scholar]
- Reinelt, G. TSPLIB—A traveling salesman problem library. ORSA J. Comput.
**1991**, 4, 376–384. [Google Scholar] [CrossRef] - Crosson, E.; Harrow, A. Simulated quantum annealing can be exponentially faster than classical simulated annealing. In Proceedings of the 2016 IEEE 57th Annual Symposium on Foundations of Computer Science (FOCS), New Brunswick, NJ, USA, 9–11 October 2016; pp. 714–723. [Google Scholar]
- Leung, K.; Jin, H.-D.; Xu, Z.-B. An expanding self-organizing neural network for the traveling salesman problem. Neurocomputing
**2004**, 62, 267–292. [Google Scholar] [CrossRef][Green Version] - Cochrane, E.; Beasley, J. The co-adaptive neural network approach to the Euclidean travelling salesman problem. Neural Netw.
**2003**, 10, 1499–1525. [Google Scholar] [CrossRef] - Feld, S.; Gabor, T.; Seidel, C.; Neukart, F.; Galter, I.; Mauerer, W.; Linnhoff-Popien, C. A hybrid solution method for the capacitated vehicle routing problem using a quantum annealer. Front. ICT
**2019**, 6, 13. [Google Scholar] [CrossRef] - Irie, H.; Wongpaisarnsin, G.; Terabe, M.; Miki, A.; Taguchi, S. Quantum annealing of vehicle routing problem with time, state and capacity. In International Workshop on Quantum Technology and Optimization Problems; Springer: Cham, Switzerland, 2019; pp. 145–156. [Google Scholar]
- Focacci, F.; Lodi, A.; Milano, M. A hybrid exact algorithm for the TSPTW. INFORMS J. Comput.
**2002**, 4, 403–417. [Google Scholar] [CrossRef][Green Version] - Edelkamp, S.; Gath, M.; Cazenave, T.; Teytaud, F. Algorithm and knowledge engineering for the TSPTW problem. In Proceedings of the 2013 IEEE Symposium on Computational Intelligence in Scheduling (CISched), Singapore, 16–19 April 2013; pp. 44–51. [Google Scholar]
- Atchade-Adelomou, P.; Golobardes-Ribé, E.; Vilasís-Cardona, X. Using the Variational-Quantum-Eigensolver (VQE) to Create an Intelligent Social Workers Schedule Problem Solver. In Hybrid Artificial Intelligent Systems, Proceedings of the 5th International Conference, HAIS 2020, Gijón, Spain, 11–13 November 2020; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2020; pp. 245–260. [Google Scholar]
- Atchade-Adelomou, P.; Golobardes-Ribe, E.; Vilasis-Cardona, X. Using the Parameterized Quantum Circuit combined with Variational-Quantum-Eigensolver (VQE) to create an Intelligent social workers’ schedule problem solver. arXiv
**2020**, arXiv:2010.05863. [Google Scholar] - Atchade-Adelomou, P.; Casado-Fauli, D.; Golobardes-Ribe, E.; Vilasis-Cardona, X. quantum Case-Based Reasoning (qCBR). arXiv
**2021**, arXiv:2104.00409. [Google Scholar] - Applegate, D.; Cook, W. A computational study of the job-shop scheduling problem. ORSA J. Comput.
**1991**, 3, 149–156. [Google Scholar] [CrossRef] - Papalitsas, C.; Andronikos, T.; Giannakis, K.; Theocharopoulou, G.; Fanarioti, S. A QUBO model for the traveling salesman problem with time windows. Algorithms
**2019**, 12, 224. [Google Scholar] [CrossRef][Green Version] - Boixo, S.; Rønnow, F.; Isakov, S.; Wang, Z.; Wecker, D.; Lidar, D.; Martinis, J.; Troyer, M. Evidence for quantum annealing with more than one hundred qubits. Nat. Phys.
**2014**, 3, 218–224. [Google Scholar] [CrossRef][Green Version] - Preskill, J. Quantum Computing in the NISQ era and beyond. Quantum
**2018**, 2, 79. [Google Scholar] [CrossRef] - D-Wave Systems Inc. Technical Description of the D-Wave Quantum Processing Unit; D-Wave Systems Inc.: Burnaby, BC, Canada, 2020. [Google Scholar]
- De Vogelaere, R. Methods of Integration Which Preserve the Contact Transformation Property of the Hamilton Equations; Technical Report; Department of Mathematics, University of Notre Dame: Notre Dame, IN, USA, 1956. [Google Scholar]
- Marston, C.; Balint-Kurti, G. The Fourier grid Hamiltonian method for bound state eigenvalues and eigenfunctions. J. Chem. Phys.
**1989**, 6, 3571–3576. [Google Scholar] [CrossRef][Green Version] - Shin, S.; Graeme, S.; Smolin, J.; Vazirani, U. How “quantum” is the D-Wave machine? arXiv
**2014**, arXiv:1401.7087. [Google Scholar] - Lucas, A. Ising formulations of many NP problems. Front. Phys.
**2014**, 2, 5. [Google Scholar] [CrossRef][Green Version] - Teplukhin, A.; Kendrick, B.; Tretiak, S.; Dub, P. Electronic structure with direct diagonalization on a D-wave quantum annealer. Sci. Rep.
**2020**, 10, 20753. [Google Scholar] [CrossRef] - Alonso-Linaje, G.; Atchade-Adelomou, P.; Gonzalez-Bermejo, S. Improvement in the Formulation of the TSP for Its Generalizations Type QUBO. 2021. Available online: https://github.com/pifparfait/GPS (accessed on 1 December 2021).
- Jäntschi, L.; Katona, G.; Diudea, M. Modeling Molecular Properties by Cluj Indices. Match
**2000**, 41, 151–188. [Google Scholar] - Zhang, R.; Prokhorchuk, A.; Dauwels, J. Deep Reinforcement Learning for Traveling Salesman Problem with Time Windows and Rejections. In Proceedings of the 2020 International Joint Conference on Neural Networks (IJCNN), Glasgow, UK, 19–24 July 2020. [Google Scholar] [CrossRef]
- Atchade-Adelomou, P.; Alonso-Linaje, G. Quantum Enhanced Filter: QFilter. arXiv
**2021**, arXiv:2104.03418. [Google Scholar]

**Figure 1.**Example of a TSP solution with six different cities. It begins at node 0, and the arrows indicate the order in which the towns will be visited.

**Figure 2.**In these graphs, we can observe the algorithm’s results in different scenarios of the GPS formulation. We can follow the correct scalability of the algorithm. We provide the code [50] to check its proper functioning and to allow others to simulate lower values or values higher than N = 16.

**Figure 3.**In these graphs, we can observe the algorithm’s results in different scenarios of the VRP formulation. We can follow the correct scalability of the algorithm. We provide the code [50] to verify the proper functioning of the formulation. Vehicle number 1 is red, and the next is light-steel-blue. While the depot is the 0 node in pale-green colour, and the rest are represented in light-steel-blue. In this case, we have variables cities from 4 to 12 and using up to 2 vehicles. It is important to highlight that this VRP minimises the time travelled by the cars. The number of qubits used is 2418 to test the last case.

**Figure 4.**Path length comparison for N = 9. In this graph, we see how the length of the solution paths for the case of 9 Cities is very similar so that both models give good results.

**Figure 5.**Time comparison for N = 9. This graph shows the time taken to carry out the executions in the case of 9 cities. Although it seems that there is a lot of difference, it only represents 10% of the total time, which, as we have seen in other experiences, is not significant.

**Figure 6.**Path length comparison for N = 11. For the example of 11 cities, we can observe that the outcomes are quite similar. Although the time difference is not significant again, the difference between path lengths is. Let us remember that the advantage of the modelling we have worked is based on improving the number of qubits used. We then have that the larger the problems we are working on, the better that difference will be appreciated in the number of variables.

**Figure 7.**Time comparison for N = 11. For the example of 11 cities, we can observe that the outcomes are quite similar because although there is a mean difference of about 20 s between the results of both simulations, the experience with this problem and other similar ones is that this very small difference does not affect the results on the length of the solution path.

**Figure 8.**In this figure we can appreciate the exponential behaviour and the number of interconnections that each model offers. Our model (GPS) improves the number of qubits and gives us a great result reducing the number of connections a lot. The Native_TSP behaves as $0.8{(N+2)}^{5}$ while the GPS as $2{(N+2)}^{3}$.

**Figure 9.**Comparison of the different models based on the number of qubits. This graph shows the behaviour and evolution of the numbers of qubits for each model. We see the best performance of our GPS model compared to the other models.

**Figure 10.**Benchmark between MTZ and GPS model based on the number of qubits. We can appreciate that for 30 cities, GPS model needs 2700 qubits while the MTZ 4458.

**Table 1.**A regular polygon layout has been taken where the cities occupy the positions of the nodes [50] for the elaboration of all tables. In this scenario of 4 cities, we set comparison with the 3 models, MTZ, native TSP and GPS. The comparison is based on the number of times to find the solution, the distance travelled, and the number of qubits. We can appreciate the good performance of our GPS model, and above all the savings it offers us in the number of qubits.

GPS | Native TSP | MTZ | |
---|---|---|---|

Number of qubits | 75 | 100 | 140 |

Elapsed Time (min) | 0.332 | 0.08 | 0.569 |

Path Length (m) | 5.65 | 5.65 | 5.65 |

**Table 2.**A regular polygon layout has been taken where the cities occupy the positions of the nodes [50] for the elaboration of all tables. In this scenario of 6 cities, we set comparison with the 3 models, MTZ, native TSP and GPS. The comparison is based on the number of times to find the solution, the distance travelled, and the number of qubits. We can appreciate the good performance of our GPS model, and above all the savings it offers us in the number of qubits.

GPS | Native TSP | MTZ | |
---|---|---|---|

Number of qubits | 147 | 294 | 266 |

Elapsed Time (min) | 0.337 | 0.39 | 1.338 |

Path Length (m) | 6.00 | 6.00 | 8.46 |

**Table 3.**A regular polygon layout has been taken where the cities occupy the positions of the nodes [50] for the elaboration of all tables. In this scenario of 8 cities, we set comparison with the 3 models, MTZ, native TSP and GPS. The comparison is based on the number of times to find the solution, the distance travelled, and the number of qubits. We can appreciate the good performance of our GPS model, and above all the savings it offers us in the number of qubits.

GPS | Native TSP | MTZ | |
---|---|---|---|

Number of qubits | 243 | 648 | 522 |

Elapsed Time (min) | 1.209 | 1.177 | 2.676 |

Path Length (m) | 6.122 | 9.58 | 11.46 |

**Table 4.**A regular polygon layout has been taken where the cities occupy the positions of the nodes [50] for the elaboration of all tables. In this scenario of 10 cities, we set comparison with the 3 models, MTZ, native TSP and GPS. The comparison is based on the number of times to find the solution, the distance travelled, and the number of qubits. We can appreciate the good performance of our GPS model, and above all the savings it offers us in the number of qubits.

GPS | Native TSP | MTZ | |
---|---|---|---|

Number of qubits | 363 | 1210 | 770 |

Elapsed Time (min) | 3.316 | 3.087 | 4.175 |

Path Length (m) | 12.51 | 10.978 | - |

**Table 5.**A regular polygon layout has been taken where the cities occupy the positions of the nodes [50] for the elaboration of all tables. In this scenario of 12 cities, we set comparison with the 3 models, MTZ, native TSP and GPS. The comparison is based on the number of times to find the solution, the distance travelled, and the number of qubits.

GPS | Native TSP | MTZ | |
---|---|---|---|

Number of qubits | 507 | 2028 | 1066 |

Elapsed Time (min) | 7.992 | 9.677 | 10.578 |

Path Length (m) | 14.286 | 12.28 | - |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Gonzalez-Bermejo, S.; Alonso-Linaje, G.; Atchade-Adelomou, P.
GPS: A New TSP Formulation for Its Generalizations Type QUBO. *Mathematics* **2022**, *10*, 416.
https://doi.org/10.3390/math10030416

**AMA Style**

Gonzalez-Bermejo S, Alonso-Linaje G, Atchade-Adelomou P.
GPS: A New TSP Formulation for Its Generalizations Type QUBO. *Mathematics*. 2022; 10(3):416.
https://doi.org/10.3390/math10030416

**Chicago/Turabian Style**

Gonzalez-Bermejo, Saul, Guillermo Alonso-Linaje, and Parfait Atchade-Adelomou.
2022. "GPS: A New TSP Formulation for Its Generalizations Type QUBO" *Mathematics* 10, no. 3: 416.
https://doi.org/10.3390/math10030416