The traveling salesperson problem asks for a shortest tour through a set of cities, visiting each exactly once and returning to the start. It can be expressed as a QUBO, as an integer program with route constraints, or directly as a search over permutations. These representations describe the same decision but expose different structures to an optimization algorithm.
The city-position model
Let xit = 1 when city i is visited at tour position t. Require every city to appear once and every position to contain one city. The travel objective is ∑tijdijxitxj,t+1 with the time index interpreted cyclically. It is quadratic, and the assignment rules are linear. They can be kept explicit or converted into squared penalties.
With n cities there are n2 binary variables and n choices at each tour position. By contrast, a tour represented directly as a permutation stores n entries. The distance input for a symmetric instance requires n(n − 1)/2 distinct off-diagonal values. The quadratic representation adds structure to express the positional relationships, rather than merely storing those distances.
Illustration: standalone Python calculation.
from itertools import permutations
points=[(0,0),(0,1),(1,1),(1,0)]
def length(p):
return sum(abs(points[i][0]-points[j][0])+abs(points[i][1]-points[j][1])
for i,j in zip(p,p[1:]+p[:1]))
assert min(length(p) for p in permutations(range(4)))==4 In the square example, the optimum follows the boundary. A direct permutation representation cannot express a repeated city, whereas the binary representation needs its assignment rules to exclude that possibility.
Choose moves that preserve the important structure
A tour-based local search can reverse a segment, relocate a city or exchange two cities while preserving the visit-once condition. For a symmetric distance matrix, a two-edge exchange can be evaluated from the affected edges. Starting from a feasible permutation, a single binary-variable flip breaks one city row and one position row. Larger coordinated changes or repair methods may be needed.
An edge-based integer model uses edge variables instead. It can use degree constraints and inequalities excluding disconnected subtours. The useful choice depends on the size of the instance and the available method.
Decide what a benchmark should measure
For a quantum optimization experiment, a binary formulation may be precisely what the team needs. For a routing deployment, a specialized formulation and solver deserve consideration. Compare feasible tour lengths against strong routing references, with matched budgets and the same distance data. Report the model size and any additional encoding or decoding cost separately. An interesting research question is when the convenience of a binary representation justifies its computational cost. The purpose of mathematical modeling is to choose a representation that serves the decision being made.
For research involving a routing formulation, discuss an optimization project.