Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

Quantum Reports

Efficient Encoding of the Traveling Salesperson Problem on a Quantum Computer

John Stenger, Sean Crowe, Joseph Diaz, Ramiro Rodriguez, Daniel Gunlycke, Joanna Ptasinski

Published Jul 17, 2025• 3 citations
Publisher

Abstract

Abstract We propose an amplitude encoding of the traveling salesperson problem along with a method for calculating the cost function. Our encoding requires a number of qubits which grows logarithmically with the number of cities. We propose to calculate the cost function classically based on the probability distribution extracted from measuring the quantum computer. This is in contrast from the typical method of evaluating the cost function by taking the expectation value of a quantum operator. We demonstrate our method using a variational quantum eigensolver algorithm to find the shortest route for a given graph. We find that there is a broad range in the hyperparameters of the optimization procedure for which the best route is found.

DOI
10.3390/quantum7030032

Related papers

Travelling Salesperson Problem with Quantum Computing

Bhanu Lalith Aakash Medury, Vyoma Harshitha Podapati

Combinatorial optimization problems involve find-ing an optimal solution from a finite set of feasible solutions.Dynamic Programming attempts to solve a combinatorial prob-lem by performing an exhaustive search over the entire domain of the problem.In many such cases, this exhaustive search is not effective or tractable.Travelling salesperson problem is an important combinatorial optimization problem in which the salesperson is given N cities to travel with the condition that he has to travel each city exactly once and return to the origin.Among the finite set of feasible routes, the salesperson has to choose an optimal route with shortest total distance.The route can be optimal either by cost or by distance.The classical algorithm which attempts to find the shortest distance/cost to travel all the cities run in exponential time complexity.For small number of cities, the classical algorithm is effective and feasible but as the number of cities increase, the number of possible routes and the time required to compute them grows exponentially.However, addressing this problem by implementing quantum computing significantly reduces the time required to compute these routes.A quantum algorithm is required to run on a quantum computer to obtain meaningful results as quantum computers use Quantum Bits which differ from the bits used by a classical computer.A.

International Journal of Engineering Research and•Mar 12, 2020•1 citation

Efficient Encodings of the Travelling Salesperson Problem for Variational Quantum Algorithms

Manuel Schnaus, Lilly Palackal, Benedikt Poggel +4 more

Routing problems are a common optimization problem in industrial applications, which occur on a large scale in supply chain planning. Due to classical limitations for solving NP-hard problems, quantum computing hopes to improve upon speed or solution quality. Several suggestions have been made for encodings of routing problems to solve them with variational quantum algorithms. However, for an end user it is hard to decide a priori which encoding will give the best solutions according to their needs. In this work, we investigate different encodings for the Travelling Salesperson Problem. We compare their scaling and performance when using the Quantum Approximate Optimization Algorithm and the Variational Quantum Eigensolver and provide a clear guide for users when to choose which encoding. For small instances, we find evidence that the permutation encoding can yield good results since it does not suffer from feasibility issues.

arXiv:2404.05448•IEEE International Conference on Quantum Software (QSW)•Jul 7, 2024•7 citations

A Quantum Encoding of Traveling Salesperson Tours via Route Generation, Cost Phases, and a Reversible Valid-Permutation Oracle

Alexander Johannes Stasik, Franz Georg Fuchs

For a traveling salesperson problem (TSP) of $n$ cities, we present a compact quantum encoding based on a time-register representation of tours. A candidate route is represented as a sequence of $n-1$ city labels over discrete time steps, with one fixed start city and the remaining cities encoded in binary registers. We describe three ingredients of the construction: uniform route generation over the route register, a reversible validity oracle, and a phase oracle that encodes the total tour cost. The validity oracle checks both that the non-start city labels form a permutation and, for incomplete graphs, that every directed edge used by the route exists. The cost oracle then accumulates the start-edge, intermediate-transition, and return-edge costs into a tour-dependent phase for valid routes. This yields a coherent superposition of candidate routes with feasibility and tour-length information embedded directly in the quantum state. The complete construction uses $\mathcal{O}(n\log n)$ qubits, while a naive implementation requires $\mathcal{O}(n^3\log_2 n)$ CX gates and $\mathcal{O}\!\left(n^3[\log_2 n+\log_2(1/ε)]\right)$ $T$ gates, where $ε$ denotes the target approximation precision. The encoding is compatible with amplitude amplification or spectral filtering techniques such as the quantum singular value transform (QSVT) or Grover's algorithm. However, due to the exponentially small fraction of valid tours, the overall complexity remains exponential even when combined with amplitude amplification.

quant-pharXiv:2603.21283•Mar 24, 2026•0 citations

Quantum Algorithm for the Traveling Salesperson Problem

Andrew Haverly, M. A. Novotny, Shahram Rahimi

The traveling salesperson problem (TSP) is “if a traveling salesman wishes to visit exactly once each of a list of$m$cities (where the cost of traveling from city$i$to city$j$is$c_{ij}$) and then return to the home city, what is the least costly route the traveling salesman can take [1]?” The TSP is an NP-Complete problem. This paper introduces a solution to the TSP using Grover's quantum algorithm. This paper also introduces a quantum algorithm to the minimum (and maximum) spanning tree problem. The full circuit implementation is presented using the open-source Qiskit environment [2]. This paper provides the number of qubits required, the quantum depth, and the quantum volume of the algorithm for the TSP. This paper also shows how to solve the minimum (and maximum) spanning tree using Grover's algorithm.

IEEE Asia-Pacific Conference on Computer Science and Data Engineering (CSDE)•Dec 4, 2023•1 citation

Quantum iterative approach to the Traveling Salesman Problem

Arturo Rodríguez-Almazán, Guillermo Rivas, Ricardo S. Alonso +2 more

The Traveling Salesman Problem (TSP) is a classical NP-hard problem in combinatorial optimization, where determining the shortest route among a set of cities becomes computationally prohibitive as the problem size increases. This work explores quantum computing as an alternative approach to address this complexity. Unlike existing methods that primarily rely on quantum annealing, we propose a quantum iterative framework integrating Quantum Phase Estimation (QPE) and Grover's search algorithm. Route costs are encoded as quantum phases, enabling QPE to efficiently evaluate them, while Amplitude Amplification, implemented via the Grover-Long algorithm, iteratively refines the solution space toward the optimal route. A proof-of-concept case study on a small-scale TSP instance demonstrates the feasibility of this approach and its potential for scaling to larger optimization problems. Furthermore, under an expectation-based analysis, the algorithm exhibits an expected computational complexity of $O(\frac{m^2\log_2(m)\log_2(1/ε)}{\sqrtε})$ which depends on the error tolerance parameter $ε$. This estimation omits the initialization term, which we expect future refinements to render subdominant to Phase Estimation.

quant-pharXiv:2606.11843•Physica Scripta•Jun 11, 2026•0 citations

An Efficient Quantum Algorithm for the Traveling Salesman Problem

Anant Sharma, Nupur Deshpande, Sanchita Purohit Ghosh +2 more

Abstract The traveling salesman problem is the problem of finding out the shortest route in a network of cities, that a salesman needs to travel to cover all the cities, without visiting the same city more than once. This problem is known to be N P -hard with a brute-force complexity of O ( N N ) or O ( N 2 N ) for N number of cities. This problem is equivalent to finding out the shortest Hamiltonian cycle in a given graph, if at least one Hamiltonian cycle exists in it. Quantum algorithms for this problem typically provide with a quadratic speedup only, using Grover’s search, thereby having a complexity of O ( N N /2 ) or O ( N N ). We present a bounded-error quantum polynomial-time (BQP) algorithm for solving the problem, providing with an exponential speedup. The overall complexity of our algorithm is O ( N 3 log( N ) κ / ϵ + 1/ ϵ 3 ), where the errors ϵ are O (1/poly( N )), and κ is the not-too-large condition number of the matrix encoding all Hamiltonian cycles.

Quantum Information and Computation•Feb 22, 2025•1 citation
Abstract We propose an amplitude encoding of the traveling salesperson problem along with a method for calculating the cost function. Our encoding requires a number of qubits which grows logarithmically with the number of cities. We propose to calculate the cost function classically based on the probability distribution extracted from measuring the quantum computer. This is in contrast from the typical method of evaluating the cost function by taking the expectation value of a quantum operator. We demonstrate our method using a variational quantum eigensolver algorithm to find the shortest route for a given graph. We find that there is a broad range in the hyperparameters of the optimization procedure for which the best route is found.
Combinatorial optimization problems involve find-ing an optimal solution from a finite set of feasible solutions.Dynamic Programming attempts to solve a combinatorial prob-lem by performing an exhaustive search over the entire domain of the problem.In many such cases, this exhaustive search is not effective or tractable.Travelling salesperson problem is an important combinatorial optimization problem in which the salesperson is given N cities to travel with the condition that he has to travel each city exactly once and return to the origin.Among the finite set of feasible routes, the salesperson has to choose an optimal route with shortest total distance.The route can be optimal either by cost or by distance.The classical algorithm which attempts to find the shortest distance/cost to travel all the cities run in exponential time complexity.For small number of cities, the classical algorithm is effective and feasible but as the number of cities increase, the number of possible routes and the time required to compute them grows exponentially.However, addressing this problem by implementing quantum computing significantly reduces the time required to compute these routes.A quantum algorithm is required to run on a quantum computer to obtain meaningful results as quantum computers use Quantum Bits which differ from the bits used by a classical computer.A.
Routing problems are a common optimization problem in industrial applications, which occur on a large scale in supply chain planning. Due to classical limitations for solving NP-hard problems, quantum computing hopes to improve upon speed or solution quality. Several suggestions have been made for encodings of routing problems to solve them with variational quantum algorithms. However, for an end user it is hard to decide a priori which encoding will give the best solutions according to their needs. In this work, we investigate different encodings for the Travelling Salesperson Problem. We compare their scaling and performance when using the Quantum Approximate Optimization Algorithm and the Variational Quantum Eigensolver and provide a clear guide for users when to choose which encoding. For small instances, we find evidence that the permutation encoding can yield good results since it does not suffer from feasibility issues.
For a traveling salesperson problem (TSP) of nnn cities, we present a compact quantum encoding based on a time-register representation of tours. A candidate route is represented as a sequence of n−1n-1n−1 city labels over discrete time steps, with one fixed start city and the remaining cities encoded in binary registers. We describe three ingredients of the construction: uniform route generation over the route register, a reversible validity oracle, and a phase oracle that encodes the total tour cost. The validity oracle checks both that the non-start city labels form a permutation and, for incomplete graphs, that every directed edge used by the route exists. The cost oracle then accumulates the start-edge, intermediate-transition, and return-edge costs into a tour-dependent phase for valid routes. This yields a coherent superposition of candidate routes with feasibility and tour-length information embedded directly in the quantum state. The complete construction uses O(nlog⁡n)\mathcal{O}(n\log n)O(nlogn) qubits, while a naive implementation requires O(n3log⁡2n)\mathcal{O}(n^3\log_2 n)O(n3log2​n) CX gates and O ⁣(n3[log⁡2n+log⁡2(1/ε)])\mathcal{O}\!\left(n^3[\log_2 n+\log_2(1/ε)]\right)O(n3[log2​n+log2​(1/ε)]) TTT gates, where εεε denotes the target approximation precision. The encoding is compatible with amplitude amplification or spectral filtering techniques such as the quantum singular value transform (QSVT) or Grover's algorithm. However, due to the exponentially small fraction of valid tours, the overall complexity remains exponential even when combined with amplitude amplification.
The traveling salesperson problem (TSP) is “if a traveling salesman wishes to visit exactly once each of a list ofmmmcities (where the cost of traveling from cityiiito cityjjjiscijc_{ij}cij​) and then return to the home city, what is the least costly route the traveling salesman can take [1]?” The TSP is an NP-Complete problem. This paper introduces a solution to the TSP using Grover's quantum algorithm. This paper also introduces a quantum algorithm to the minimum (and maximum) spanning tree problem. The full circuit implementation is presented using the open-source Qiskit environment [2]. This paper provides the number of qubits required, the quantum depth, and the quantum volume of the algorithm for the TSP. This paper also shows how to solve the minimum (and maximum) spanning tree using Grover's algorithm.
The Traveling Salesman Problem (TSP) is a classical NP-hard problem in combinatorial optimization, where determining the shortest route among a set of cities becomes computationally prohibitive as the problem size increases. This work explores quantum computing as an alternative approach to address this complexity. Unlike existing methods that primarily rely on quantum annealing, we propose a quantum iterative framework integrating Quantum Phase Estimation (QPE) and Grover's search algorithm. Route costs are encoded as quantum phases, enabling QPE to efficiently evaluate them, while Amplitude Amplification, implemented via the Grover-Long algorithm, iteratively refines the solution space toward the optimal route. A proof-of-concept case study on a small-scale TSP instance demonstrates the feasibility of this approach and its potential for scaling to larger optimization problems. Furthermore, under an expectation-based analysis, the algorithm exhibits an expected computational complexity of O(m2log⁡2(m)log⁡2(1/ε)ε)O(\frac{m^2\log_2(m)\log_2(1/ε)}{\sqrtε})O(ε​m2log2​(m)log2​(1/ε)​) which depends on the error tolerance parameter εεε. This estimation omits the initialization term, which we expect future refinements to render subdominant to Phase Estimation.
Abstract The traveling salesman problem is the problem of finding out the shortest route in a network of cities, that a salesman needs to travel to cover all the cities, without visiting the same city more than once. This problem is known to be N P -hard with a brute-force complexity of O ( N N ) or O ( N 2 N ) for N number of cities. This problem is equivalent to finding out the shortest Hamiltonian cycle in a given graph, if at least one Hamiltonian cycle exists in it. Quantum algorithms for this problem typically provide with a quadratic speedup only, using Grover’s search, thereby having a complexity of O ( N N /2 ) or O ( N N ). We present a bounded-error quantum polynomial-time (BQP) algorithm for solving the problem, providing with an exponential speedup. The overall complexity of our algorithm is O ( N 3 log( N ) κ / ϵ + 1/ ϵ 3 ), where the errors ϵ are O (1/poly( N )), and κ is the not-too-large condition number of the matrix encoding all Hamiltonian cycles.