The TSP encoded as an N×N permutation-matrix QUBO. Chromatic block Gibbs updates resolve row and column constraints while shrinking the tour. Below, that sampler runs live in your browser: watch the loop over ten cities anneal from the naive ordering down toward the proven optimum.
optimal tour — the sampler found the provably shortest loop
simulated benchmark result, results may vary (not customer results)
Drag the temperature slider to hold the sampler at that heat and keep sampling — hot tours thrash, cold tours freeze. You can also drag any city on the map; the optimum is recomputed as you let go.
Rows are stops in the tour, columns are cities. Exactly one cell is lit per row and per column — that is the permutation constraint the QUBO enforces. Rows are tinted by chromatic block; the outlined pair is the block updating this sweep.
The tour is written as a 10×10 binary matrix: cell (stop, city) is 1 when that city is visited at that stop. A valid tour needs exactly one 1 in every row and every column, so the QUBO adds a heavy penalty for any row or column that breaks the rule, and a cost term that sums the distance of each leg the matrix selects.
Chromatic block Gibbs updates split the ten stop-positions into five colored blocks. A sweep freezes four blocks and resamples the fifth, so row and column constraints are repaired block by block instead of being fought all at once — and because every proposed move is a swap inside the permutation, the matrix never stops being a legal tour while the distance term pulls it shorter.
The demo above runs that process on the cities in front of you. Its optimum is not assumed — it is proven by exhaustive Held–Karp dynamic programming over all orderings of these ten cities, so the gap readout is exact.
$uv run thrml-bench run --exp 9
Experiment 9 of the thermo benchmark suite — the travelling salesperson, encoded as a permutation-matrix QUBO and solved with chromatic block Gibbs sampling.