Structure As Search: Unsupervised Permutation Learning for Combinatorial Optimization

Yimeng Min, Carla P. Gomes

TL;DR

This paper introduces a fully unsupervised, non-autoregressive framework for the Traveling Salesman Problem (TSP) where high-quality solutions emerge directly from learned permutations without any explicit search or sequential decoding. By leveraging the algebraic properties of Hamiltonian cycles as a structural inductive bias, the model achieves competitive performance against classical heuristics and traditional search-based neural methods at sub-millisecond inference speeds.

What Problem Does This Paper Address?

The Traveling Salesman Problem (TSP) is a classic NP-hard combinatorial optimization problem. Traditional exact solvers like Concorde don't scale well due to exponential runtimes, forcing practitioners to rely on handcrafted local search heuristics like Lin-Kernighan-Helsgaun (LKH).

Recently, deep learning approaches have attempted to learn TSP solutions directly from data. However, these generally fall into two restrictive categories:

  1. Supervised Learning (SL): Requires computationally expensive ground-truth optimal tours for training data.
  2. Reinforcement Learning (RL): Suffers from high training variance and sparse rewards, typically generating tours autoregressively (city-by-city) and requiring explicit post-hoc search procedures (like beam search or 2-OPT refinement) to achieve good results.

The authors tackle a fundamental question: Can a neural network capture and exploit the inherent combinatorial structure of the TSP to output high-quality, valid solutions in a single non-autoregressive step, completely free of supervision and explicit search?

Methods

The core innovation lies in treating structure as a replacement for search.

Instead of predicting a sequence of cities, the model learns a permutation matrix $P$ that transforms a canonical Hamiltonian cycle (a simple loop visiting nodes in order: $1 \rightarrow 2 \rightarrow \dots \rightarrow n \rightarrow 1$) into the optimal tour. This canonical cycle is represented mathematically by a cyclic shift matrix $V$. Any valid Hamiltonian cycle can be expressed via the similarity transformation $PVP^\top$.

To make this optimization differentiable, the authors relax the discrete permutation matrix $P$ into a soft, doubly-stochastic matrix $T$ using a Graph Neural Network (GNN) combined with the Gumbel-Sinkhorn operator. The network minimizes an unsupervised loss function directly corresponding to the tour length: $$\mathcal{L}_{TSP} = \langle D, TVT^\top \rangle$$ where $D$ is the pairwise distance matrix. At inference time, the soft matrix $T$ is mapped back to a hard permutation matrix $P$ deterministically using the Hungarian algorithm.

Training history showing strong correlation between training loss reduction and validation TSP distance improvement.

The Hamiltonian Cycle Ensemble

To mitigate occasional suboptimal solutions (long-tail failures), the authors introduce an ensemble method based on a neat number-theoretic property: powers of the cyclic shift matrix $V^k$ represent distinct valid Hamiltonian cycles if and only if the greatest common divisor $\gcd(k, n) = 1$. By training separate models on these different topological priors and selecting the shortest tour at inference time, the framework significantly boosts robustness.

Datasets

The model was trained and evaluated on standard, uniformly distributed 2D TSP instances across three problem sizes:

  • TSP-20: 100,000 training instances
  • TSP-50: 500,000 training instances
  • TSP-100: 1,500,000 training instances

All sizes used 1,000 independent instances for validation and 1,000 for testing.

Key Insights and Ideas

  • Structural Inductive Bias over Search: The architecture guarantees a valid Hamiltonian cycle by construction ($PVP^\top$). Because feasibility is structurally locked in, the neural network can focus its entire capacity on minimizing tour length rather than struggling to learn the rules of a valid tour.
  • Algebraic Diversity for Free: Utilizing $V^k$ (where $\gcd(k,n)=1$) allows the creation of an ensemble of models that explore diverse structural priors without altering the underlying GNN architecture or requiring stochastic rollouts.
  • Hardware Non-Determinism as a Feature: In the appendix, the authors introduce Hardware Perturbation Inference (HPI). By simply toggling FMA (Fused Multiply-Add) operations under TF32 precision on NVIDIA H100 GPUs, they exploit low-level numerical non-determinism to generate diverse candidate solutions for ensembling without retraining the model.

Key Results

The proposed unsupervised, search-free method demonstrates remarkable performance compared to traditional baselines and search-heavy neural networks:

  • Optimality Gaps: The base model achieves optimality gaps of 6.00% (TSP-20), 10.4% (TSP-50), and 8.00% (TSP-100).
  • Ensemble Performance: When scaling up the coprime shift ensemble, the performance improves drastically, dropping the optimality gaps to 3.52% (TSP-20), 2.81% (TSP-50), and 5.03% (TSP-100). This beats classical heuristics like Christofides and heavily outperforms large-width beam search variants on larger instances.
Mean tour length decreases substantially as the number of coprime shifts increases in the ensemble.
  • Inference Speed: Because the model is non-autoregressive and search-free, it is incredibly fast. On an NVIDIA H100 GPU, a single instance takes just 0.15 ms to 0.40 ms to solve. Even a 5-model subset ensemble takes only 2 ms total.

Limitations and Future Work

While this approach marks a significant step forward for search-free combinatorial optimization, some limitations remain:

  • The Performance Gap with State-of-the-Art RL: The model does not yet match the performance of top-tier RL methods like POMO (which achieves a ~1.07% gap on TSP-100), as POMO benefits from exploiting multiple equivalent solutions via parallel rollouts.
  • Hyperparameter Sensitivity: The authors noted that they performed a highly targeted, minimal hyperparameter sweep. More extensive tuning or alternative GNN message-passing schemes could yield better results.
  • Extension to Other Problems: The current formulation relies heavily on the specific algebraic structure of Hamiltonian cycles for TSP. Adapting this "structure as search" paradigm to other combinatorial problems (e.g., graph coloring or knapsack) remains an open challenge.

Summary updated

BibTeX
@inproceedings{min2025structure,
  author = {Yimeng Min and Carla P. Gomes},
  title = {{Structure As Search: Unsupervised Permutation Learning for Combinatorial Optimization}},
  booktitle = {NPGML @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=w74BKgbso1},
}
Figure