Travelling Salesman Problem
If you must visit every city once and return to the starting point, how can you find the shortest total route?
Set the problem size
The cities are generated automatically. Change the number or regenerate the map to create another problem.
How QPRIMORA transforms the problem
The important layer is the transformation between a user's objective and the computation executed by a quantum processor.
See how the problem is transformed step by step
Open each layer to see how a route-planning request becomes a mathematical optimization model and then a quantum-computing representation.
A
DECISION VARIABLES
How do we describe a route with binary variables?
+
For every city i and every visiting position t, QPRIMORA introduces one binary decision variable:
xi,t = 1 means city i is visited at position t. Otherwise it is 0.
B
CONSTRAINTS
What makes a binary string a valid route?
+
For every city i, exactly one visiting position must be selected.
At every route position t, exactly one city must be selected.
C
OBJECTIVE FUNCTION
How do we tell the computer what “better” means?
+
Among all valid routes, the objective is to minimize the total distance between consecutive cities.
D
QUBO
Combine objective and constraints into one optimization model
+
The route distance and the constraint penalties can be combined into a Quadratic Unconstrained Binary Optimization model:
Q contains both route-distance information and penalties for invalid routes.
E
COST HAMILTONIAN
How does QUBO enter the quantum-computing layer?
+
A binary variable can be mapped to a qubit operator:
After substitution, the QUBO objective becomes a Cost Hamiltonian HC. Low-energy quantum states correspond to better candidate routes.
F
QAOA + VIRTUAL QPU
How does the quantum path produce candidate routes?
+
The quantum optimization path does not simply “calculate the route”. It attempts to reshape the probability distribution so that better solutions are measured more frequently.
Compare two ways to solve the same problem
Virtual QPU
Why does this problem become difficult?
The number of possible tours grows extremely quickly. The values below show permutations before removing equivalent rotations and reversed routes.
The Virtual QPU on this website is simulated on classical hardware. Its measured runtime therefore does not demonstrate a quantum hardware speed advantage. This demo illustrates problem representation, primitive mapping and the quantum optimization computation path. QAOA does not currently have an established general practical speedup for TSP.
From real-world intent to QPU execution
QPRIMORA's objective is to make users describe what they want to solve, rather than how a QPU should execute it.