Connected by Construction: Learning Tractable Near-Tour Marginals for Travseling Salesman Problems


Abstract

Learning-based methods for the traveling salesman problem (TSP) are often evaluated through the tours produced after decoding or search, but the learned object itself frequently lives in a surrogate space such as heatmaps, assignments, construction policies, or search-guidance scores. This hides the fundamental question: what Hamiltonian structure has actually been learned before decoding? In this study, we directly answer this question by learning TSP through a structurally meaningful latent object, rather than leaving most of the Hamiltonian structure to the final decoding stage. Based on a connected-by-construction rooted \(1\)-tree Gibbs family, we propose an end-to-end unsupervised learning pipeline called C2TSP. The pipeline learns residual edge perturbations from unbiased TSP cost through implicit differentiation. For structural correction, a smoothed Held–Karp layer restores expected degree balance, while certificate-guided sharpening further pushes the connected distribution toward more tour-like structures. Experiments show that C2TSP yields strong decoding performance while preserving interpretable structural information. Ablations further verify that edge perturbation and certificate-guided sharpening jointly improve both tour cost and tour-like structure.

1 Introduction↩︎

Machine learning methods have been increasingly used for combinatorial optimization because they can provide fast approximate solutions while maintaining competitive empirical performance. As a canonical combinatorial optimization problem, the traveling salesman problem (TSP) has received particular attention. A feasible TSP solution must satisfy both local and global structural constraints: every node has degree two, and the selected edges must form one connected cycle. However, many learning-based TSP methods do not represent this global connected edge structure directly in the learned object. Autoregressive construction models generate tours sequentially and enforce feasibility procedurally through masking and decoding rules [1][4]. Heatmap-based methods predict edge scores and then rely on repair, sampling, local search, or tree search to obtain a valid tour [5][9]. Assignment-space relaxations, such as Sinkhorn-based methods, provide smooth permutation-like objects but do not directly model the edge-adjacency structure that determines tour cost [10][12]. Hybrid methods such as NeuroLKH use learned signals to guide strong handcrafted heuristics [13]. Although these methods have achieved strong empirical results with affordable inference time, two limitations remain: they do not provide a tractable global distribution over connected combinatorial objects, and their final performance can be tightly coupled with downstream decoding or search, making the learned representation and the post-processing effect difficult to separate [14], [15].

In contrast, we propose a connected-by-construction representation based on the rooted \(1\)-tree family. After fixing a root node, a rooted \(1\)-tree consists of a spanning tree on the non-root nodes together with exactly two edges incident to the root. Therefore, every latent configuration is globally connected by construction and satisfies the root degree constraint exactly. The remaining structural defect is the non-root degree mismatch: a rooted \(1\)-tree becomes a Hamiltonian cycle when every non-root node also has degree two. Unlike a Gibbs distribution over Hamiltonian cycles, whose partition function is intractable, the rooted \(1\)-tree Gibbs family admits an exact factorization, which enables exact marginal computation and expected-cost training. This connects our method to the classical Held–Karp relaxation, where node penalties modify edge costs and minimum \(1\)-trees provide strong TSP lower bounds [16], [17]. Prior work has explored tree-based or Held–Karp-related structures for TSP from theoretical, heuristic, or learning perspectives [18][20]. Our goal is to turn this connected structure into an end-to-end differentiable latent representation for learning near-tour marginals.

We build an end-to-end unsupervised learning pipeline from this connected-by-construction rooted \(1\)-tree latent family, called C2TSP. The model first predicts residual edge perturbations that tilt the rooted \(1\)-tree Gibbs distribution toward low-cost structures guided by the expected TSP cost. To correct the remaining non-root degree defect, we introduce a smoothed Held–Karp equilibration layer, motivated by its compatibility with the rooted \(1\)-tree prior and the classical Held–Karp lower-bound structure [16]. This layer solves for node-additive dual variables so that the expected degree of every non-root node equals two under the dual-modified rooted \(1\)-tree distribution, and it is trained end-to-end by differentiating through the equilibrium map, following the general paradigm of implicit optimization layers [21][24]. After equilibration, the residual error is no longer a connectivity failure, but the non-tour mass inside a connected, degree-balanced latent family. We control this residual defect using a certificate that upper-bounds non-tour mass by the total variance of the non-root degrees. A certificate-guided residual refinement then reduces this non-tour mass, followed by another re-equilibration step. Finally, decoding is performed by sampling from the learned edge marginals rather than by search-based post-processing.

The contributions of this paper are as follows.

  • We introduce a tractable rooted \(1\)-tree representation for TSP that ensures global connectivity by construction while admitting exact marginal computation for expected-cost training.

  • We develop C2TSP, an end-to-end unsupervised learning pipeline in which a GNN predicts residual edge perturbations from the expected TSP cost and a smoothed Held–Karp equilibration layer restores expected degree balance.

  • We derive a non-tour mass certificate and use it to guide residual refinement, pushing the learned connected distribution toward more tour-like structures.

  • We empirically show that the proposed rooted \(1\)-tree representation yields strong pure-decoding performance, while several baselines benefit more from additional local search. Further ablations show how edge perturbation and certificate-guided sharpening shift the connected distribution toward more tour-like and lower-cost structures.

2 Methodology↩︎

2.1 Problem definition↩︎

2.1.0.1 Exact Hamiltonian Gibbs model.

Let \(V=\{1,\ldots,n\}\) and let \(\mathcal{E}\) be the edge set of the complete undirected graph. Each Hamiltonian cycle \(H\in\mathcal{H}\) has edge-incidence vector \(x_H\in\{0,1\}^{|\mathcal{E}|}\), and \(D\in\mathbb{R}^{|\mathcal{E}|}\) denotes the edge-cost vector. A smooth exact model is the Hamiltonian Gibbs law \[\begin{align} q_D^{\mathcal{H}}(H) = \frac{1}{Z_{\mathcal{H}}(D)} \exp\!\left( -\frac{1}{\tau}\langle D,x_H\rangle \right), \qquad H\in\mathcal{H}, \label{eq:ham-gibbs} \end{align}\tag{1}\] where \(Z_{\mathcal{H}}(D)\) is the Hamiltonian partition function. This model is intractable because evaluating \(Z_{\mathcal{H}}(D)\) and differentiating \(\log Z_{\mathcal{H}}(D)\) require summing over exponentially many Hamiltonian cycles.

2.1.0.2 Connected by construction: the rooted \(1\)-tree surrogate.

Since exact Hamiltonian Gibbs inference is intractable, we pursue a tractable surrogate with structural guarantee, that (1) preserves core tour structure, (2) certifies the structural gap it leaves, and (3) learns to reduce that gap under the equilibration guarantees developed below. Note that a Hamiltonian cycle is always a connected spanning edge set with degree two at every node. We preserve connectivity by using rooted \(1\)-trees, and address the remaining degree condition via a smoothed Held–Karp (HK) equilibration layer.

Fix a root \(r\in V\) and write \(\bar V:=V\setminus\{r\}\). Let \(\mathcal{U}_r\) denote the family of rooted \(1\)-trees, namely spanning trees on \(\bar V\) together with exactly two edges incident to \(r\). Every \(U\in\mathcal{U}_r\) is connected by construction, satisfies \(d_r(U)=2\), and has edge-incidence vector \(x_U\in\{0,1\}^{|\mathcal{E}|}\). And it is easy to verify that \(\mathcal{H}\subseteq \mathcal{U}_r\). For any edge parameter \(\eta\in\mathbb{R}^{|\mathcal{E}|}\), we define the rooted \(1\)-tree Gibbs law \[\begin{align} q_\eta(U) = \frac{1}{Z_r(\eta)} \exp\!\left( -\frac{1}{\tau}\langle \eta,x_U\rangle \right), \qquad U\in\mathcal{U}_r, \label{eq:rooted-gibbs} \end{align}\tag{2}\] and its edge marginal \[\begin{align} \mu(\eta) := \mathbb{E}_{q_\eta}[x_U]. \label{eq:rooted-marginal} \end{align}\tag{3}\]

Lemma 1 shows that the tractable marginal 2 is tractable with exact partition function. The remaining task is to formalize the edge parameters \(\eta\) that preserve the degree-two structure and reduce structural deficiency inside \(\mathcal{U}_r\).

Lemma 1 (Tractable rooted \(1\)-tree marginal). The partition function \(Z_r(\eta)\) in 2 factorizes into a weighted spanning-tree partition function on \(\bar V\) and a two-edge root-selection normalizer. Consequently, \(Z_r(\eta)\), the edge marginal \(\mu(\eta)\), and all degree moments are computable exactly.

2.2 Held–Karp equilibration and structural-gap certificate↩︎

Given the \(1\)-tree Gibbs family, the remaining Hamiltonian condition is to enforce degree two at the non-root nodes. Since the Gibbs law is parameterized by edge costs, the dual prices for the non-root degree constraints need to be represented as an edge-additive field. For \(\lambda\in\mathbb{R}^{n-1}\) indexed by \(\bar V\), define the node-to-edge lift \(A:\mathbb{R}^{n-1}\to\mathbb{R}^{|\mathcal{E}|}\) by \[\begin{align} (A\lambda)_{ij} = \begin{cases} \lambda_i+\lambda_j, & i,j\in\bar V,\\ \lambda_k, & \{i,j\}=\{r,k\},\;k\in\bar V . \end{cases} \label{eq:lift} \end{align}\tag{4}\] Then, for every \(U\in\mathcal{U}_r\), \[\begin{align} \langle A\lambda,x_U\rangle = \sum_{i\in\bar V}\lambda_i d_i(U). \label{eq:lift-degree-identity} \end{align}\tag{5}\] Thus \(A\lambda\) is exactly the edge-additive representation of the non-root degree prices.

For a generic edge cost field \(c\in\mathbb{R}^{|\mathcal{E}|}\), consider the entropy-regularized degree-correction problem for the \(1\)-tree Gibbs family as \[\begin{align} \min_{p\in\Delta(\mathcal{U}_r)} \quad& \sum_{U\in\mathcal{U}_r}p(U)\langle c,x_U\rangle + \tau\sum_{U\in\mathcal{U}_r}p(U)\log p(U) \label{eq:hk-primal} \\ \mathrm{s.t.}\quad& \sum_{U\in\mathcal{U}_r}p(U)d_i(U)=2, \qquad i\in\bar V , \nonumber \end{align}\tag{6}\] where \(\Delta(\mathcal{U}_r)\) denotes the probability simplex over rooted \(1\)-trees. This problem asks for the lowest free-energy distribution over connected rooted \(1\)-trees whose expectation of non-root degree match the Hamiltonian target. Substituting the lift identity 5 into the Lagrangian collapses the degree multipliers into a tilted edge cost \(c+A\lambda\), which keeps the partition function in the rooted 1-tree family denoted by \(q_{c+A\lambda}\), as stated below.

Theorem 1 (Smoothed Held–Karp equilibrium). The Lagrange dual of 6 is \[\begin{align} \max_{\lambda\in\mathbb{R}^{n-1}} \Phi_\tau(c,\lambda), \qquad \Phi_\tau(c,\lambda) := -\tau\log Z_r(c+A\lambda) - 2\mathbf{1}^\top\lambda . \label{eq:hk-dual} \end{align}\qquad{(1)}\] Moreover, \[\begin{align} \frac{\partial \Phi_\tau(c,\lambda)}{\partial \lambda_i} &= \mathbb{E}_{q_{c+A\lambda}}[d_i(U)]-2, \qquad i\in\bar V, \label{eq:hk-gradient} \\ \frac{\partial^2 \Phi_\tau(c,\lambda)}{\partial\lambda_i\partial\lambda_j} &= -\frac{1}{\tau} \operatorname{Cov}_{q_{c+A\lambda}} \bigl(d_i(U),d_j(U)\bigr), \qquad i,j\in\bar V . \label{eq:hk-hessian} \end{align}\] {#eq: sublabel=eq:eq:hk-gradient,eq:eq:hk-hessian} Hence \(\Phi_\tau(c,\lambda)\) is concave in \(\lambda\), and any stationary maximizer \(\lambda^\star(c)\) satisfies \[\begin{align} \mathbb{E}_{q_{c+A\lambda^\star(c)}}[d_i(U)] = 2, \qquad i\in\bar V . \label{eq:hk-degree-balance} \end{align}\qquad{(2)}\]

The proof is given in Appendix 5.2. Theorem 1 shows that the degree multipliers enter each \(1\)-tree energy through \(\langle A\lambda,x_U\rangle-2\mathbf{1}^\top\lambda\), and that optimizing over \(p\in\Delta(\mathcal{U}_r)\) recovers the Gibbs law \(q_{c+A\lambda}\). The HK layer is therefore the implicit map \[c \mapsto \lambda^\star(c) \quad\text{defined by}\quad \nabla_\lambda\Phi_\tau(c,\lambda^\star(c))=0 .\] This equilibration removes the degree defect of the connected surrogate. The remaining structural gap is the residual probability mass assigned to degree-balanced rooted \(1\)-trees outside Hamiltonian-cycle support. The next result certifies this residual gap.

2.2.0.1 Structural-gap certificate.

Let \(\mathcal{N}:=\mathcal{U}_r\setminus\mathcal{H}\), and \(\gamma(q):=q(\mathcal{N})\) denote the set of non-tour \(1\) trees and their mass, respectively. HK equilibration enforces degree balance only in expectation: \(\mathbb{E}_q[d_i(U)]=2\) for all \(i\in\bar V\). But this does not force \(q\) to be supported on \(\mathcal{H}\), as non-root degree may still fluctuate across rooted \(1\)-trees but still having mean degree 2. The residual gap is therefore bounded by degree variance and can serve as a certificate that we can formally establish using same second-order statistic governing the HK Hessian ?? , as stated in the theorem below.

Theorem 2 (Certificate for residual non-tour mass). For \(q\in\Delta(\mathcal{U}_r)\) at the HK equilibrium solution, the non-tour mass satisfies \[\begin{align} \gamma(q) \le \frac{1}{2} \sum_{i\in\bar V} \operatorname{Var}_q(d_i(U)). \label{eq:non-tour-certificate} \end{align}\qquad{(3)}\] For the HK-equilibrated Gibbs law \(q^\star=q_{c+A\lambda^\star(c)}\), this becomes \[\begin{align} \label{eq:hessian-certificate} \gamma(q^\star) \le \frac{1}{2} \sum_{i\in\bar V} \operatorname{Var}_{q^\star}(d_i(U))= \frac{1}{2} \operatorname{tr} \operatorname{Cov}_{q^\star}(d(U),d(U)) = -\frac{\tau}{2} \operatorname{tr} \nabla_{\lambda\lambda}^2 \Phi_\tau(c,\lambda^\star(c)). \end{align}\qquad{(4)}\]

The proof is given in Appendix 5.3. Thus the same covariance that defines the HK Hessian in Theorem 1 also certifies the residual structural gap left after HK equilibration. As a consequence, the \(1\)-tree Gibbs family not only provides tractable marginal, but also supplies the analytical structure that allows us to enforce the structure primitives to become Hamiltonian cycles.

2.3 Oracle residual edge field and learned re-equilibration↩︎

The certificate in Theorem 2 measures the structural gap left after HK equilibration. This gap cannot be removed by another node-price update. To see this, following 6 , for any \(\beta\in\mathbb{R}^{n-1}\), \[\label{eq:hk-node-shift-equivariance} \Phi_\tau(c+A\beta,\lambda) = \Phi_\tau(c,\lambda+\beta) + 2\mathbf{1}^\top\beta .\tag{7}\]

Thus a node-additive edge shift only reparametrizes the HK price and leaves the equilibrated Gibbs law and its edge marginals unchanged. Hence the residual edge correction is in general not unique and can be absorbed into the HK price. We need to select the identifiable representative by removing this node-price component and retaining the part orthogonal to all node-additive edge fields \(A\lambda\).

To identify the oracle form of this residual, suppose the omitted tour-valid structure inside the rooted \(1\)-tree family is represented at the marginal level by inequalities \(C\mu\le h\), where \(C\) and \(h\) are exponential in size in general, due to the combinatorial structure of the problem. Now extending 6 with these constraints gives the entropy-regularized oracle recovery problem \[\begin{align} \min_{p\in\Delta(\mathcal{U}_r)} \quad& \sum_{U\in\mathcal{U}_r} p(U)\langle D,x_U\rangle + \tau \sum_{U\in\mathcal{U}_r}p(U)\log p(U) \label{eq:oracle-recovery} \\ \mathrm{s.t.}\quad& \mathbb{E}_p[d_i(U)]=2, \qquad i\in\bar V, \qquad C\,\mathbb{E}_p[x_U]\le h . \nonumber \end{align}\tag{8}\]

Proposition 3 (Oracle orthogonal residual edge field). Let \((p^\star,\bar\lambda^\star,\nu^\star)\) satisfy the KKT conditions of 8 , where \(\bar\lambda^\star\) are the degree multipliers and \(\nu^\star\ge0\) are the multipliers of \(C\mu\le h\). Define the raw oracle edge field \(\widetilde{\Gamma}^\star:=C^\top\nu^\star\). Let \[\widetilde{\Gamma}^\star = A\beta^\star+\Gamma^\star, \qquad \Gamma^\star\in\operatorname{Im}(A)^\perp ,\] be its decomposition into a node-additive component and an orthogonal residual component, and define the absorbed HK price \(\lambda^\star:=\bar\lambda^\star+\beta^\star\). Then \(\lambda^\star\) is an HK price for the shifted cost field \(D+\Gamma^\star\): \(\lambda^\star \in \mathop{\mathrm{argmax}}_{\lambda} \Phi_\tau(D+\Gamma^\star,\lambda)\).

Consequently, the oracle re-equilibrated edge cost is \[\eta^\star:=D+\Gamma^\star+A\lambda^\star .\]

The proof is given in Appendix 5.4. Proposition 3 shows that the raw dual effect \(C^\top\nu^\star\) separates into a node-additive component \(A\beta^\star\), which is absorbed into the HK price, and an orthogonal residual component \(\Gamma^\star\in\operatorname{Im}(A)^\perp\), which is the identifiable oracle edge field. The corresponding rooted \(1\)-tree Gibbs law \(q_{\eta^\star}\) then recovers the oracle solution. Since the omitted constraints are intractable, we seek to learn a residual edge field \(\Gamma_\theta\) and re-equilibrate: \[\begin{align} \lambda^\star(\theta) &:= \lambda^\star(D+\Gamma_\theta), \qquad \eta^\star_\theta := D+\Gamma_\theta+A\lambda^\star(\theta), \label{eq:learned-reequilibration} \end{align}\tag{9}\] Thus in this study, we use learning to supply the residual edge geometry, while rooted \(1\)-tree inference and HK equilibration are used to structure the trajectory in shaping and learning such residual. The learned law is degree-balanced after re-equilibration, and Theorem 2 certifies its remaining structural gap.

2.4 Unsupervised learning with certificate-directed re-equilibration↩︎

With learnable object identified as an orthogonal residual edge field, we next present the formal pipeline to train this residual that is guided by the unbiased TSP cost: \[\mathcal{L}_{\rm TSP}(\theta) = \frac{1}{M} \sum_{m=1}^M \langle D^m,u_\theta(D^m)\rangle , \label{eq:final-unsup-loss}\tag{10}\] where \(u_\theta(D)\) is the edge marginal of the \(1\)-tree Gibbs family produced by the forward map discussed below. This induces an unsupervised learning framework, and more importantly, that learns from unbiased TSP cost signals as the structural constraints are not enforced into the loss function as penalty terms. The forward process supplies the structure constraints, where HK recovery leads to expected degree balance, and certificate-directed sharpening further reduce a certified upper bound on residual non-tour mass. The backward propagation can be computed via implicit gradient with details discussed in the Appendix 6.2.

2.4.0.1 Canonical HK forward map.

By Theorem 1, every edge input \(c\) induces HK price \(\lambda^\star(c)\), an equilibrated edge cost \(c+A\lambda^\star(c)\), and a rooted \(1\)-tree marginal \(\mu(c+A\lambda^\star(c))\). As a result, for each instance \(D\), the canonical forward map starts with a raw edge field \(\widetilde{\Gamma}_\theta(D)\), followed by removing the node-price component as in Prop. 3: \[\Gamma_\theta^{(0)}(D) = P_\perp\widetilde{\Gamma}_\theta(D), \qquad P_\perp:=P_{\operatorname{Im}(A)^\perp}. \label{eq:projected-residual-learning}\tag{11}\]

The projected residual then enters the HK equilibration layer. Given \(c_\theta(D) = D+\Gamma_\theta^{(0)}(D),\) one can run \(L\) HK iterations indexed by \(\ell=0,\ldots,L-1\), producing \[\lambda_{\theta,\ell}^{(0)}(D) \longrightarrow \lambda_{\theta,L}^{(0)}(D) \approx \lambda^\star(c_\theta^{(0)}(D)).\] The terminal HK price defines the \(1\)-tree marginals that are evaluated in the loss function 10 . \[\eta_\theta^{(0)}(D) = c_\theta^{(0)}(D)+A\lambda_{\theta,L}^{(0)}(D), \qquad u_\theta^{(0)}(D) = \mu(\eta_\theta^{(0)}(D)). \label{eq:base-hk-forward}\tag{12}\]

2.4.0.2 Bernoulli certificate and marginal-sharpening forward map.

The certificate in Theorem 2 bounds the residual non-tour mass after HK equilibration, but directly differentiating the full covariance certificate would require higher-order covariance derivatives. In practice, one can instead use a Bernoulli upper certificate that depends only on the recovered edge marginal \(u\) at HK equilibrium: \[\mathcal{C}_{\rm Ber}(u) := \sum_{e\in\mathcal{E}}w_eu_e(1-u_e), \qquad w_e:=\frac{1}{2}\sum_{i\in\bar V}B_{ie},\] where \(Bx_U=d_{\bar V}(U)\). Its marginal derivative by is

\[b_{\rm Ber}(u):=\nabla_u\mathcal{C}_{\rm Ber}(u)= w\odot(1-2u) \label{eq:ber95descent}\tag{13}\]

Since \(\eta\) is an edge-cost parameter, a positive step in this direction sharpens the marginal by penalizing low-probability edges and rewarding high-probability edges.

Proposition 4 (Bernoulli certificate descent). Let \(q_\eta\) be an HK-equilibrated rooted \(1\)-tree Gibbs law and let \(u=\mu(\eta)\). Then \(\mathcal{C}_{\rm Ber}(u)\) is a valid non-tour certificate \(\gamma(q_\eta)\le\mathcal{C}_{\rm Ber}(u)\). Moreover, for any HK-equilibrated edge input \(c\), let \[\eta(c)=c+A\lambda^\star(c), \qquad u(c)=\mu(\eta(c)).\] For \(c_\alpha=c+\alpha b_{\rm Ber}(u(c))\) following Eq. 13 and \(u_\alpha= \mu\!\left(c_\alpha+A\lambda^\star(c_\alpha)\right)\), we have, for all sufficiently small \(\alpha>0\), \(\mathcal{C}_{\rm Ber}(u_\alpha)< \mathcal{C}_{\rm Ber}(u(c))\), whenever the re-equilibrated sharpening direction is nonzero.

Proposition 4 proves that the marginal derivative 13 is a descent direction that minimizes the non-tour mass. This directly motivates a deterministic sharpening map applied after the canonical HK forward pass. Starting from \((\Gamma_\theta^{(0)},u_\theta^{(0)})\), for \(k=0,\ldots,K-1\), set \[\Gamma_\theta^{(k+1)}(D) := \Gamma_\theta^{(k)}(D) + \alpha_k b_{\rm Ber}(u_\theta^{(k)}(D)).\] with \(\alpha_k>0\) a fixed hyperparameter for sharpening aggressiveness, and re-equilibrate with \[c_\theta^{(k+1)}(D) = D+\Gamma_\theta^{(k+1)}(D), \qquad \lambda_\theta^{(k+1)}(D) = \lambda^\star(c_\theta^{(k+1)}(D)),\] \[\eta_\theta^{(k+1)}(D) = c_\theta^{(k+1)}(D)+A\lambda_\theta^{(k+1)}(D), \qquad u_\theta^{(k+1)}(D) = \mu(\eta_\theta^{(k+1)}(D)).\] which then supply to 10 the final marginal \(u_\theta(D):=u_\theta^{(K)}(D)\). When \(K=0\), this reduces to the canonical HK forward map.

3 Experiments↩︎

We evaluate on 2-D symmetric Euclidean TSP instances, with node coordinates sampled uniformly from the unit square. We denote the dataset with \(n\) nodes by TSP-\(n\). This data-generation protocol follows the standard setting used in prior neural TSP work [5], while we compute the optimal labels via Concorde [25]. We evaluate C2TSP in two complementary regimes against representative neural and hybrid baselines, including DIFUSCO [8], DIMES [6], Fast-T2T [9], UTSP [7], and NeuroLKH [13]. We train all models at TSP-100 and apply zero-shot at every test size. Details are given in Appendix 6.

3.0.0.1 Decoding.

The trained network produces edge marginals \(\mu\) from which a tour is recovered without any external solver. We compare at six decode levels: (L1) greedy degree-2 repair; (L2) L1 followed by 2-opt local search for \(1\), \(10\), or \(100\) iterations; (L3) Gumbel perturbation of \(\mu\), then decoded greedily and taken best-of-perturbation sample; (L4) and MAP decoder.

3.0.0.2 Connecting to LKH.

Each learning method is used as a candidate-and-initial-tour oracle for LKH-3, with five integration levels of progressively more learned signal: (H0) vanilla LKH-3; (H1) a pre-computed initial tour from L1; (H2) top-\(5\) candidates per node, ordered by \(\mu\); (H3) the same candidates reordered by a \(0.5{:}0.5\) rank fusion of \(\mu\) and the network-induced reduced cost \(C_{\rm mod}\); and (H4) the full configuration combining H1 with the H2 (H3 for C2TSP) candidate set. H3 is C2TSP-only because they require a network-side non-root dual that the other methods do not produce.

a

b

c

Figure 1: Empirical analysis on TSP50. (Left) Training dynamics of C2TSP on TSP-100. “P” denotes the perturb branch and “P+S” the full perturb-then-sharpen pipeline; solid lines (“Dec.”) report the optimality gap of the decoded discrete tour, while dashed lines (“Rel.”) report the optimality gap of the continuous relaxation. (Middle) Empirical CDF of optimal-edge coverage when the tour is obtained by direct argmax over the GNN edge scores (no search). (Right) Optimality gap as a function of 2-opt iterations starting from the model’s initial tour. Baselines construct the initial tour greedily from the heatmap; C2TSP uses MAP decoding..

3.1 Main results↩︎

Table 1 reports optimality gap and per-instance wall time at every decode level. C2TSP achieves the lowest optimality gap in 20 of the 25 (size, decoder-level) cells, and is uniformly best at the heaviest local-search budget (L2\(\times\)​100). The advantage is largest precisely where the decoder is weakest, indicating the rooted \(1\)-tree distribution already encodes tour-like structure before any post-processing. The remaining best-cells go to DIMES at \(n\!\ge\!500\) under low-search regimes, where its near-scale-invariant heatmap edges out our marginal-based decoders. Within C2TSP, the MAP decoder (L4) is competitive with L2\(\times\)​1 at small \(n\) but degrades at \(n\!\ge\!500\), indicating that the soft marginal \(\mu\) carries mass beyond what the single MAP \(1\)-tree retains.

Table 1: Decoder results. Optimality gap (%) and per-instance wall time in seconds (in parentheses).
Method Level TSP50 TSP100 TSP200 TSP500 TSP1000
C2TSP L1 6.12 (0.14) 9.44 (0.15) 12.71 (0.20) 17.73 (0.97) 21.98 (7.34)
L2 \(\times 1\) 3.73 (0.14) 7.03 (0.15) 10.32 (0.19) 14.97 (0.93) 19.77 (7.19)
L2 \(\times 10\) 1.44 (0.14) 1.97 (0.15) 3.25 (0.20) 7.84 (0.94) 13.06 (7.19)
L2 \(\times 100\) 1.43 (0.14) 1.90 (0.15) 2.21 (0.20) 2.75 (0.94) 3.83 (7.21)
L3 3.09 (0.14) 5.11 (0.17) 7.97(0.29) 13.54 (1.61) 20.35 (10.08)
L4 2.36 (0.14) 4.83 (0.17) 8.74 (0.29) 15.38 (1.63) 21.96 (11.98)
DIFUSCO L1 17.24 (0.07) 22.60 (0.35) 36.34 (0.96) 82.08 (5.97) 141.05 (24.18)
L2 \(\times 1\) 12.93 (0.07) 19.07 (0.35) 33.92 (0.96) 80.56 (5.94) 139.96 (24.06)
L2 \(\times 10\) 2.71 (0.07) 6.78 (0.35) 22.43 (0.96) 72.08 (5.94) 133.36 (24.06)
L2 \(\times 100\) 2.48 (0.07) 3.73 (0.35) 5.74 (0.98) 32.86 (5.96) 94.93 (24.09)
L3 9.63 (0.07) 15.41 (0.37) 36.39 (1.05) 97.00 (6.50) 172.62 (26.40)
Fast-T2T L1 17.63 (\(<\!.01\)) 14.31 (0.01) 21.36 (0.02) 41.20 (0.15) 74.62 (0.62)
L2 \(\times 1\) 12.55 (\(<\!.01\)) 11.04 (0.01) 18.60 (0.02) 39.23 (0.12) 73.20 (0.49)
L2 \(\times 10\) 2.60 (\(<\!.01\)) 2.80 (0.01) 9.01 (0.02) 31.84 (0.12) 67.50 (0.49)
L2 \(\times 100\) 2.46 (\(<\!.01\)) 2.44 (0.01) 4.39 (0.03) 10.47 (0.14) 42.72 (0.52)
L3 8.46 (0.01) 7.77 (0.03) 24.95 (0.11) 74.42 (0.70) 136.48 (2.96)
DIMES L1 13.72 (\(<\!.01\)) 16.08 (\(<\!.01\)) 16.18 (0.01) 16.23 (0.04) 15.84 (0.16)
L2 \(\times 1\) 10.05 (\(<\!.01\)) 13.29 (\(<\!.01\)) 14.28 (\(<\!.01\)) 14.97 (0.01) 14.96 (0.03)
L2 \(\times 10\) 2.66 (\(<\!.01\)) 4.28 (\(<\!.01\)) 6.61 (\(<\!.01\)) 9.67 (0.01) 11.23 (0.04)
L2 \(\times 100\) 2.55 (\(<\!.01\)) 3.25 (\(<\!.01\)) 3.54 (0.01) 3.73 (0.02) 3.95 (0.07)
L3 7.87 (0.01) 9.66 (0.02) 11.58 (0.09) 15.12 (0.57) 19.38 (2.41)
UTSP L1 16.56 (\(<\!.01\)) 20.59 (\(<\!.01\)) 24.43 (\(<\!.01\)) 31.90 (0.02) 39.21 (0.10)
L2 \(\times 1\) 12.54 (\(<\!.01\)) 17.62 (\(<\!.01\)) 22.45 (\(<\!.01\)) 30.80 (\(<\!.01\)) 38.54 (\(<\!.01\))
L2 \(\times 10\) 4.28 (\(<\!.01\)) 8.40 (\(<\!.01\)) 14.57 (\(<\!.01\)) 25.35 (\(<\!.01\)) 34.77 (0.01)
L2 \(\times 100\) 4.02 (\(<\!.01\)) 5.66 (\(<\!.01\)) 7.19 (0.01) 9.98 (0.02) 18.88 (0.04)
L3 60.95 (0.01) 125.21 (0.02) 220.61 (0.08) 414.43 (0.49) 633.80 (2.03)
Figure 2: TSP50 ablation of edge perturbation and certificate-guided sharpening. Left: sampled optimality-gap distributions for the full pipeline (P+S), the variant without edge perturbation but with sharpening (N-P+S), and the variant without both perturbation and sharpening (N-P). Right: instance-wise gap comparisons between the full pipeline and the no-perturbation variants.

Table 2 reports gap and median LKH wall time. At H1, every method stays within \(\sim\!0.5\,\text{\textpertenthousand}\) of vanilla LKH-3 (H0): a learned initial tour is largely uninformative, because LKH’s local search quickly escapes any mediocre start. The picture inverts at H2 and H4, where the heatmap drives LKH’s candidate machinery, and DIFUSCO, DIMES, and Fast-T2T degrade by one to three orders of magnitude at \(n\!\ge\!500\). C2TSP is the only learned model that survives this deeper integration, remaining within \(\sim\!1\,\text{\textpertenthousand}\) of vanilla LKH at every size. Figure 1 (Middle & Right) indicates that the common thread across both main results is that the rooted \(1\)-tree representation preserves global connected structure by construction, so local-sweep procedures (whether 2-opt or LKH-3) inherit a globally consistent starting point and need only repair local degree defects.

Table 2: LKH-integration results. Optimality gap (\(\text{\textpertenthousand}\)) and median LKH wall time per instance (s).
Level Method TSP100 TSP200 TSP500 TSP1000 TSP2000
H0 LKH-3 0.38 (0.11) 0.22 (0.49) 0.36 (2.32) 0.39 (7.49) 0.02 (31.23)
H1 C2TSP 0.18 (0.07) 0.41 (0.29) 0.20 (2.49) 0.46 (5.89) -0.07 (26.73)
DIFUSCO 0.29 (0.07) 0.34 (0.28) 0.19 (2.54) 0.40 (7.98) OOM
Fast-T2T 0.32 (0.08) 0.64 (0.39) 0.23 (1.99) 0.39 (7.24) 0.06 (27.93)
DIMES 0.44 (0.10) 0.73 (0.32) 0.19 (1.84) 0.29 (6.39) 0.24 (21.87)
UTSP 0.27 (0.11) 0.61 (0.27) 0.16 (2.16) 0.41 (6.46) 0.12 (24.73)
C2TSP 0.11 (0.07) 0.13 (0.30) 0.20 (2.82) 0.53 (8.70) 0.71 (37.77)
DIFUSCO 0.88 (0.08) 4.91 (0.22) 50.14 (1.87) 130.10 (5.57) OOM
Fast-T2T 0.02 (0.09) 0.76 (0.41) 10.99 (1.99) 36.46 (6.40) 80.65 (20.75)
DIMES 3.24 (0.12) 6.18 (0.29) 8.27 (1.80) 9.21 (6.77) 6.56 (24.03)
UTSP 145.13 (0.09) 211.09 (0.15) 217.26 (1.57) 185.35 (6.11) 142.49 (19.77)
H3 C2TSP 0.11 (0.06) 0.04 (0.29) 0.18 (2.49) 0.52 (9.20) 0.56 (37.23)
NeuroLKH 0.63 (0.06) 0.53 (0.21) 23.11 (1.01) 38.38 (4.82) 40.66 (27.04)
H4 C2TSP 0.11 (0.07) 0.01 (0.30) 0.20 (2.25) 0.58 (8.41) 0.64 (36.87)
DIFUSCO 1.01 (0.08) 2.50 (0.24) 50.53 (1.76) 135.08 (5.50) OOM
Fast-T2T 0.04 (0.09) 0.87 (0.44) 9.16 (2.07) 34.85 (6.59) 82.91 (21.11)
DIMES 3.57 (0.12) 4.11 (0.32) 4.33 (1.95) 4.23 (7.66) 3.55 (27.26)
UTSP 65.56 (0.10) 105.35 (0.15) 131.00 (1.57) 118.76 (6.41) 102.62 (21.77)

3pt

3.2 Ablation and structural analysis↩︎

3.2.0.1 Component ablation.

Figure 2 (Left) shows that removing edge perturbation substantially degrades decoded performance: the average gap increases from \(1.55\%\) to \(12.74\%\), with many long-tail instances exceeding \(20\%\). Figure 2 (Right) further show that the full pipeline improves over the no-perturbation variants on almost all test instances. Table 3 explains this gap from a structural perspective. Without learned perturbation, the smoothed rooted \(1\)-tree distribution has weak edge concentration and low recovery of optimal tour edges. Sharpening alone improves these metrics, but remains far from the learned variants. In contrast, perturbation-only training already produces substantially more tour-like marginals and much better decoded tours. Figure 1 (Left) shows a complementary training view. Without sharpening, the relaxed rooted \(1\)-tree objective converges quickly but the decoded tour quality remains limited, suggesting that low relaxed cost alone is not sufficient. Sharpening helps translate the learned connected structure into better decoded tours.

Figure 3: Refinement and decoding on a representative TSP50 instance. Top: Heatmaps of the raw cost matrix, the perturbed cost matrix, and the sharpened cost matrix, with nodes reordered according to the optimal tour so that optimal-tour edges appear near the super- and sub-diagonals. Bottom: the corresponding MAP rooted 1-trees and the optimal tour. Titles report rooted 1-tree or tour costs.
Table 3: TSP50 ablation of structural and decoding metrics. Top2 Conc. measures concentration of each node’s incident marginal mass on its two largest incident edges. Edge Cov. and Edge Cost Cov. report unweighted and cost-weighted recovery of Concorde-tour edges.
Method Gap (%) \(\downarrow\) Top2 Conc. \(\uparrow\) Edge Cov. \(\uparrow\) Edge Cost Cov. \(\uparrow\)
P + S 1.55 0.9000 0.8751 0.8357
P 2.21 0.7438 0.8442 0.8006
N-P 19.25 0.1507 0.5845 0.5105
N-P + S 12.74 0.1923 0.6847 0.6046

3.2.0.2 Structural analysis.

Figure 3 presents an example of a TSP50 instance that demonstrates the mechanisms of the proposed model across its refinement stages. Because nodes are reordered according to the optimal tour, low-cost mass near the super- and sub-diagonals indicates alignment with optimal-tour edges, whereas isolated low-cost regions far from the diagonal may induce structurally poor rooted \(1\)-trees. In the raw cost matrix, low-cost edges are dispersed across the edge space. Edge perturbation substantially reshapes this pattern by moving low-cost mass toward the tour-aligned diagonal band. Sharpening then makes a more localized adjustment: the heatmap before and after sharpening has a similar global pattern, but ambiguous off-diagonal low-cost regions are further suppressed. This is expected because sharpening acts as a fine-tuning step rather than a full re-learning step, which is also reflected in the MAP rooted \(1\)-tree, where only a small number of edges are changed. The resulting MAP rooted \(1\)-tree is therefore shaped toward a more tour-like structure, rather than merely assigned a lower cost.

4 Conclusion↩︎

This work establishes connected latent support as a design principle for learning-based TSP. We introduced C2TSP, a differentiable rooted \(1\)-tree pipeline whose support is connected by construction, whose marginals are exactly computable, and whose remaining degree defects are corrected through a smoothed Held–Karp equilibration layer. The model learns residual edge perturbations directly from the original TSP cost, while certificate-guided sharpening reduces a provable upper bound on residual non-tour mass. In this way, C2TSP shifts the learned object from unconstrained edge scores to a tractable near-tour marginal with explicit structural meaning. Empirically, this representation yields strong pure-decoding performance and remains robust when used as a candidate source for LKH, where several heatmap-based baselines degrade at larger sizes. The main limitation of our study mainly follows from the same tractable surrogate, where the rooted \(1\)-trees relax exact Hamiltonian-cycle support as the design choice. C2TSP enforces connectivity in the support and restores degree balance in expectation, while the remaining degree fluctuations are controlled through equilibration and sharpening rather than eliminated exactly. This gap opens natural directions for tighter certificate-directed updates, richer tractable connected families, and scalable approximations to exact marginal computation. Overall, the results show that the differentiable latent object is a central modeling choice for learning-based TSP. By encoding connectedness before decoding, C2TSP exposes a near-tour marginal whose structural evolution can be trained, certified, and analyzed.

5 Proofs↩︎

5.1 Proof of Lemma 1↩︎

Proof. Let \(r\in V\) be the fixed root and \(\bar V=V\setminus\{r\}\). For non-root edges \(\{i,j\}\subseteq\bar V\), define \[w^\eta_{ij} = \exp\!\left(-\eta_{ij}/\tau\right),\] and for root edges define \[a_i = \exp\!\left(-\eta_{ri}/\tau\right), \qquad i\in\bar V .\] Every rooted \(1\)-tree \(U\in\mathcal{U}_r\) decomposes uniquely into a spanning tree \(T\) on \(\bar V\) and an unordered pair of distinct root neighbors \(\{i,j\}\subseteq\bar V\). Therefore, \[\begin{align} Z_r(\eta) &= \sum_T \sum_{i<j} \exp\!\left( -\frac{1}{\tau} \Bigl[ \sum_{e\in T}\eta_e+\eta_{ri}+\eta_{rj} \Bigr] \right) \notag\\ &= \left( \sum_T \prod_{e\in T} w^\eta_e \right) \left( \sum_{i<j,\;i,j\in\bar V} a_i a_j \right). \end{align}\] By the matrix-tree theorem, \[\sum_T \prod_{e\in T} w^\eta_e = \det L^\sharp(W),\] where \(L^\sharp(W)\) is any cofactor of the weighted Laplacian on the non-root graph. Hence, \[Z_r(\eta) = \det L^\sharp(W) \sum_{i<j,\;i,j\in\bar V} a_i a_j .\] This proves the partition factorization.

The same factorization gives exact edge marginals. For non-root edges, the spanning-tree marginal identity gives \[\mu_{ij}(\eta) = w^\eta_{ij} R^{\mathrm{eff}}_{ij}(W), \qquad \{i,j\}\subseteq\bar V ,\] where \(R^{\mathrm{eff}}_{ij}(W)\) is the effective resistance between \(i\) and \(j\) in the weighted non-root graph. For root edges, the marginal is the probability that \(i\) belongs to the sampled unordered pair of root neighbors: \[\mu_{ri}(\eta) = \frac{a_i\sum_{j\in\bar V,\;j\neq i}a_j}{\sum_{k<\ell,\;k,\ell\in\bar V}a_k a_\ell}, \qquad i\in\bar V .\] The computational cost is dominated by one Laplacian factorization on the non-root graph, so the partition function, edge marginals, and degree moments are computable exactly. ◻

5.2 Proof of Theorem 1↩︎

Proof. For a fixed edge cost field \(c\in\mathbb{R}^{|\mathcal{E}|}\) and node prices \(\lambda\in\mathbb{R}^{n-1}\), define \[E_{c,\lambda}(U) := \langle c+A\lambda,x_U\rangle .\] By the node-to-edge lift identity, \[\langle A\lambda,x_U\rangle = \sum_{i\in\bar V}\lambda_i d_i(U).\] Therefore the Lagrangian of 6 , up to the simplex constraint \(p\in\Delta(\mathcal{U}_r)\), is \[\mathcal{L}(p,\lambda) = \sum_{U\in\mathcal{U}_r}p(U)E_{c,\lambda}(U) + \tau\sum_{U\in\mathcal{U}_r}p(U)\log p(U) - 2\mathbf{1}^\top\lambda .\] For fixed \(\lambda\), minimizing over \(p\in\Delta(\mathcal{U}_r)\) gives the Gibbs distribution \[p_\lambda(U) = \frac{1}{Z_r(c+A\lambda)} \exp\!\left( -\frac{1}{\tau}E_{c,\lambda}(U) \right) = q_{c+A\lambda}(U),\] and the minimized value is \[-\tau\log Z_r(c+A\lambda) - 2\mathbf{1}^\top\lambda .\] Thus the Lagrange dual objective is \[\Phi_\tau(c,\lambda) = -\tau\log Z_r(c+A\lambda) - 2\mathbf{1}^\top\lambda .\]

We next compute its derivatives. Since \[\frac{\partial E_{c,\lambda}(U)}{\partial\lambda_i} = d_i(U),\] differentiating the log-partition function gives \[\frac{\partial\Phi_\tau(c,\lambda)}{\partial\lambda_i} = \mathbb{E}_{q_{c+A\lambda}}[d_i(U)]-2 .\] Differentiating once more, \[\frac{\partial^2\Phi_\tau(c,\lambda)}{\partial\lambda_i\partial\lambda_j} = -\frac{1}{\tau} \operatorname{Cov}_{q_{c+A\lambda}} \bigl(d_i(U),d_j(U)\bigr).\] For any vector \(a\in\mathbb{R}^{n-1}\), \[a^\top\nabla^2_{\lambda\lambda}\Phi_\tau(c,\lambda)a = -\frac{1}{\tau} \operatorname{Var}_{q_{c+A\lambda}} \left( \sum_{i\in\bar V}a_i d_i(U) \right) \le 0 .\] Hence \(\Phi_\tau(c,\lambda)\) is concave in \(\lambda\). Therefore any stationary maximizer \(\lambda^\star(c)\) satisfies \[0 = \frac{\partial\Phi_\tau(c,\lambda^\star(c))}{\partial\lambda_i} = \mathbb{E}_{q_{c+A\lambda^\star(c)}}[d_i(U)]-2, \qquad i\in\bar V .\] This proves the HK degree-balance condition. ◻

5.3 Proof of Theorem 2↩︎

Proof. For any \(U\in\mathcal{U}_r\), define \[S(U):=\sum_{i\in\bar V}(d_i(U)-2)^2 .\] Every rooted \(1\)-tree has root degree two and \(n\) edges, hence \[\sum_{i\in\bar V} d_i(U)=2(n-1), \qquad \sum_{i\in\bar V}(d_i(U)-2)=0 .\] If \(U\notin\mathcal{H}\), the integral deviations \(\{d_i(U)-2\}_{i\in\bar V}\) are not all zero and sum to zero. Therefore at least one deviation is positive and at least one is negative, so \[S(U)=\sum_{i\in\bar V}(d_i(U)-2)^2\ge 2 .\] Thus \[\mathbf{1}\{U\in\mathcal{N}\} \le \frac{1}{2} S(U).\] Taking expectation under \(q\) gives \[\gamma(q) = q(\mathcal{N}) \le \frac{1}{2} \sum_{i\in\bar V} \mathbb{E}_q[(d_i(U)-2)^2].\] Under the degree-balance condition \(\mathbb{E}_q[d_i(U)]=2\), this becomes \[\gamma(q) \le \frac{1}{2} \sum_{i\in\bar V} \operatorname{Var}_q(d_i(U)).\] For \(q^\star=q_{c+A\lambda^\star(c)}\), the Hessian identity follows directly from ?? : \[\nabla_{\lambda\lambda}^2\Phi_\tau(c,\lambda^\star(c)) = -\frac{1}{\tau} \operatorname{Cov}_{q^\star}(d(U),d(U)).\] Taking traces gives ?? . ◻

5.4 Proof of Proposition 3↩︎

Proof. The Lagrangian of 8 , up to constants independent of \(p\), is \[\sum_{U\in\mathcal{U}_r}p(U) \left\langle D+A\bar\lambda+C^\top\nu, x_U \right\rangle + \tau\sum_{U\in\mathcal{U}_r}p(U)\log p(U).\] Stationarity in \(p\) gives \[p^\star(U) = q_{D+A\bar\lambda^\star+C^\top\nu^\star}(U).\] Decompose the raw field as \[C^\top\nu^\star=A\beta^\star+\Gamma^\star, \qquad \Gamma^\star\in\operatorname{Im}(A)^\perp,\] and set \(\lambda^\star:=\bar\lambda^\star+\beta^\star\). Then \[D+A\bar\lambda^\star+C^\top\nu^\star = D+\Gamma^\star+A\lambda^\star,\] so \(p^\star=q_{\eta^\star}\) with \[\eta^\star=D+\Gamma^\star+A\lambda^\star .\] The degree KKT conditions give \[\mathbb{E}_{p^\star}[d_i(U)]=2, \qquad i\in\bar V .\] By ?? , this is equivalent to \[\nabla_\lambda\Phi_\tau(D+\Gamma^\star,\lambda^\star)=0.\] Concavity of \(\Phi_\tau\) in \(\lambda\) gives \[\lambda^\star\in\mathop{\mathrm{argmax}}_\lambda\Phi_\tau(D+\Gamma^\star,\lambda).\] Finally, \[\mu^\star = \mathbb{E}_{p^\star}[x_U] = \mathbb{E}_{q_{\eta^\star}}[x_U] = \mu(\eta^\star).\] ◻

5.5 Proof of Proposition 4↩︎

We use the following notation. Let \(B:\mathbb{R}^{|\mathcal{E}|}\to\mathbb{R}^{|\bar V|}\) be the non-root degree operator, so that \[Bx_U=d_{\bar V}(U), \qquad U\in\mathcal{U}_r.\] With the lift \(A\) defined in 4 , we have \(A=B^\top\). For an edge parameter \(\eta\), write \[u(\eta):=\mu(\eta)=\mathbb{E}_{q_\eta}[x_U], \qquad \Sigma_x(\eta):=\operatorname{Cov}_{q_\eta}(x_U,x_U).\] When the parameter is clear, we write simply \(u\) and \(\Sigma_x\).

Recall \[\mathcal{C}_{\rm Ber}(u) = \sum_{e\in\mathcal{E}}w_eu_e(1-u_e), \qquad w_e:=\frac{1}{2}\sum_{i\in\bar V}B_{ie}.\] Its marginal gradient is \[b_{\rm Ber}(u) := \nabla_u\mathcal{C}_{\rm Ber}(u) = w\odot(1-2u).\] The projected sharpening direction is \[g_{\rm Ber}(u) := P_\perp b_{\rm Ber}(u), \qquad P_\perp:=P_{\operatorname{Im}(A)^\perp}.\]

Lemma 2 (Bernoulli upper certificate). Let \(q_\eta\) be HK-equilibrated and let \(u=\mu(\eta)\). Then \[\gamma(q_\eta) \le \mathcal{C}_{\rm Ber}(u).\]

Proof. For each \(i\in\bar V\), \[d_i(U) = \sum_{e\in\mathcal{E}}B_{ie}x_{U,e}.\] The rooted \(1\)-tree Gibbs law factorizes into a weighted spanning-tree law on \(\bar V\) and an independent weighted two-edge root-selection law. Edge indicators in both factors are negatively associated; hence, for \(e\ne f\), \[\operatorname{Cov}_{q_\eta}(x_{U,e},x_{U,f})\le 0.\] Therefore, \[\begin{align} \operatorname{Var}_{q_\eta}(d_i(U)) &= \operatorname{Var}_{q_\eta} \left( \sum_{e\in\mathcal{E}}B_{ie}x_{U,e} \right) \\ &= \sum_{e\in\mathcal{E}}B_{ie}^2 \operatorname{Var}_{q_\eta}(x_{U,e}) + 2\sum_{e<f}B_{ie}B_{if} \operatorname{Cov}_{q_\eta}(x_{U,e},x_{U,f}) \\ &\le \sum_{e\in\mathcal{E}}B_{ie}u_e(1-u_e), \end{align}\] because \(B_{ie}\in\{0,1\}\). Combining this with Theorem 2 gives \[\begin{align} \gamma(q_\eta) &\le \frac{1}{2} \sum_{i\in\bar V} \operatorname{Var}_{q_\eta}(d_i(U)) \\ &\le \frac{1}{2} \sum_{i\in\bar V} \sum_{e\in\mathcal{E}} B_{ie}u_e(1-u_e) \\ &= \sum_{e\in\mathcal{E}} \left( \frac{1}{2}\sum_{i\in\bar V}B_{ie} \right) u_e(1-u_e) \\ &= \mathcal{C}_{\rm Ber}(u). \end{align}\] ◻

Lemma 3 (Tangent identity of HK re-equilibration). Fix an edge input \(c\) at which the local HK map \(c\mapsto \lambda^\star(c)\) is differentiable. Define \[\eta(c):=c+A\lambda^\star(c), \qquad T_c:=D\eta(c).\] Then \[B\Sigma_xT_c=0, \qquad T_cv-v\in\operatorname{Im}(A) \quad \text{for every }v\in\mathbb{R}^{|\mathcal{E}|},\] where \(\Sigma_x=\Sigma_x(\eta(c))\).

Proof. The HK equilibrium condition is \[B\mu(c+A\lambda^\star(c))-2\mathbf{1}=0.\] The rooted \(1\)-tree Gibbs marginal satisfies \[D\mu(\eta)[v] = -\frac{1}{\tau}\Sigma_xv.\] Differentiating the HK equilibrium condition in direction \(v\) gives \[B\Sigma_xT_cv=0.\] Since this holds for every \(v\), \[B\Sigma_xT_c=0.\]

The second identity follows directly from \[\eta(c)=c+A\lambda^\star(c).\] Indeed, differentiating in direction \(v\) gives \[T_cv = v+A\,D\lambda^\star(c)[v],\] and hence \[T_cv-v = A\,D\lambda^\star(c)[v] \in\operatorname{Im}(A).\] ◻

Lemma 4 (Projected Bernoulli descent identity). Define the reduced certificate \[\overline{\mathcal{C}}_{\rm Ber}(c) := \mathcal{C}_{\rm Ber} \left( \mu(c+A\lambda^\star(c)) \right).\] Let \[u=u(c):=\mu(c+A\lambda^\star(c)), \qquad \Sigma_x=\Sigma_x(c+A\lambda^\star(c)).\] Then \[D\overline{\mathcal{C}}_{\rm Ber}(c) [g_{\rm Ber}(u)] = - \frac{1}{\tau} \left\| T_cg_{\rm Ber}(u) \right\|_{\Sigma_x}^2 \le 0,\] where \[\|v\|_{\Sigma_x}^2:=v^\top\Sigma_xv .\]

Proof. Let \[b=b_{\rm Ber}(u), \qquad g=g_{\rm Ber}(u).\] For any edge-input perturbation \(\delta c\), \[\begin{align} D\overline{\mathcal{C}}_{\rm Ber}(c)[\delta c] &= b^\top D\mu(c+A\lambda^\star(c))[T_c\delta c] \\ &= - \frac{1}{\tau} b^\top\Sigma_xT_c\delta c . \end{align}\] Taking \(\delta c=g\), it remains to simplify \(b^\top\Sigma_xT_cg\).

Because \(g=P_\perp b\), the removed component lies in \(\operatorname{Im}(A)\). Thus there exists \(\beta\) such that \[b-g=A\beta.\] Using \(A=B^\top\) and Lemma 3, \[(A\beta)^\top\Sigma_xT_cg = \beta^\top B\Sigma_xT_cg = 0.\] Therefore, \[b^\top\Sigma_xT_cg = g^\top\Sigma_xT_cg.\]

By Lemma 3, \[T_cg-g\in\operatorname{Im}(A).\] Hence there exists \(\zeta\) such that \[T_cg=g+A\zeta, \qquad \text{equivalently} \qquad g=T_cg-A\zeta.\] Again using \(A=B^\top\) and \(B\Sigma_xT_c=0\), \[(A\zeta)^\top\Sigma_xT_cg = \zeta^\top B\Sigma_xT_cg = 0.\] Thus \[\begin{align} g^\top\Sigma_xT_cg &= (T_cg-A\zeta)^\top\Sigma_xT_cg \\ &= (T_cg)^\top\Sigma_xT_cg \\ &= \|T_cg\|_{\Sigma_x}^2. \end{align}\] Substituting into the directional derivative gives \[D\overline{\mathcal{C}}_{\rm Ber}(c)[g] = - \frac{1}{\tau} \|T_cg\|_{\Sigma_x}^2 \le 0.\] ◻

The above three lemmas together allow us to formally close the proof for Proposition 4, as summarized below.

Proof of Proposition 4. The certificate claim follows from Lemma 2.

For the descent claim, fix an edge input \(c\) at which the local HK map is differentiable, and let \[u(c)=\mu(c+A\lambda^\star(c)).\] By Lemma 4, \[D\overline{\mathcal{C}}_{\rm Ber}(c) [g_{\rm Ber}(u(c))] = - \frac{1}{\tau} \left\| T_cg_{\rm Ber}(u(c)) \right\|_{\Sigma_x}^2 .\] Therefore the derivative is strictly negative whenever the re-equilibrated sharpening direction is nonzero, namely whenever \[\left\| T_cg_{\rm Ber}(u(c)) \right\|_{\Sigma_x}>0.\] By differentiability of \(\overline{\mathcal{C}}_{\rm Ber}\), there exists \(\bar\alpha>0\) such that for every \(0<\alpha<\bar\alpha\), \[\overline{\mathcal{C}}_{\rm Ber} \left( c+\alpha g_{\rm Ber}(u(c)) \right) < \overline{\mathcal{C}}_{\rm Ber}(c).\] With \[c_\alpha=c+\alpha g_{\rm Ber}(u(c)), \qquad u_\alpha=\mu(c_\alpha+A\lambda^\star(c_\alpha)),\] this is exactly \[\mathcal{C}_{\rm Ber}(u_\alpha) < \mathcal{C}_{\rm Ber}(u(c)).\] The proposition follows. ◻

6 Training details↩︎

6.1 Experimental environment↩︎

Experiments were conducted on a workstation equipped with an AMD Ryzen Threadripper PRO 7955WX v16 CPU and 1 NVIDIA RTX 5090, running Ubuntu 22.04 LTS. The models were implemented using Python 3.10 and PyTorch 2.7.0, with additional libraries including torch-scatter 2.1.2 and torch-geometric 2.6.1. For reproducibility, a random seed of 42 was set for all random number generators. The code for this experiment is available at https://anonymous.4open.science/r/C2TSP-EF65.

6.2 Training procedure and implicit differentiation↩︎

We summarize the training procedure of C2TSP and the implicit differentiation used to backpropagate through the smoothed HK equilibration layer. The node price \(\lambda\) has a degenerate additive direction, so we resolve this degeneration by mapping \(\lambda\) to a fixed nondegenerate subspace; for simplicity, we still write the resulting coordinate as \(\lambda\).

Theorem 5 (Implicit differentiation of the HK layer). Let \[F(\theta,\lambda) := \mathbb{E}_{q_{D+\Gamma_\theta+A\lambda}} [d_{\bar V}(U)] - 2\mathbf{1} .\] Suppose that \[F(\theta,\lambda^\star(\theta))=0\] and that \[H(\theta,\lambda^\star) := -\partial_\lambda F(\theta,\lambda^\star)\] is positive definite on the chosen nondegenerate subspace. Then \(\lambda^\star(\theta)\) is locally unique and differentiable, and \[\frac{d\lambda^\star}{d\theta} = - \bigl(\partial_\lambda F(\theta,\lambda^\star)\bigr)^{-1} \partial_\theta F(\theta,\lambda^\star).\] Hence, the backward pass through the HK layer reduces to a single linear solve in the dimension of the restricted \(\lambda\) subspace.

Figure 4: Training C2TSP with residual rooted 1-tree sharpening

6.3 Structured MAP decoding↩︎

The structured MAP decoder converts the final rooted \(1\)-tree distribution into feasible tours for evaluation. Given the final sharpened cost \(C^{(T)}\) and marginal \(\mu^{(T)}\), the decoder repeatedly extracts MAP rooted \(1\)-trees, repairs them into Hamiltonian tours, and returns the candidate with the lowest true metric cost. Unlike local-search-based post-processing, this decoder directly uses the connected rooted \(1\)-tree structure and only applies a repair step to enforce the global connectivity constraint.

For each decode draw \(k=0,\ldots,K-1\), we form a perturbed cost \[C^{(k)} = C^{(T)}+\sigma \Delta C^{(k)},\] where \(\Delta C^{(0)}=0\) gives the deterministic candidate and the remaining draws use small graph-structured perturbations. The perturbation is used only to diversify the MAP rooted \(1\)-tree candidates. Given \(C^{(k)}\), the decoder computes \[\mathcal{T}^{(k)} = \mathrm{MAPRootedOneTree}(C^{(k)},r),\] which consists of a minimum spanning tree on the non-root nodes together with the two cheapest root edges. Since \(\mathcal{T}^{(k)}\) is connected but not necessarily a tour, it is repaired into a feasible Hamiltonian cycle: \[\pi^{(k)} = \mathrm{Repair}(\mathcal{T}^{(k)},\mu^{(T)},C^{(k)},D).\] The repair step use the learned marginals, the perturbed cost, and the true metric distance matrix. Each candidate is evaluated by its true metric tour cost, and the decoder returns the best one: \[\widehat{\pi} = \mathop{\mathrm{argmin}}_{\pi^{(k)}} \mathrm{TourCost}(\pi^{(k)},D).\]

Figure 5: Structured MAP decoding

References↩︎

[1]
O. Vinyals, M. Fortunato, and N. Jaitly, “Pointer networks,” in Advances in neural information processing systems, 2015, vol. 28.
[2]
I. Bello, H. Pham, Q. V. Le, M. Norouzi, and S. Bengio, “Neural combinatorial optimization with reinforcement learning,” arXiv preprint arXiv:1611.09940, 2016.
[3]
W. Kool, H. van Hoof, and M. Welling, “Attention, learn to solve routing problems!” in International conference on learning representations, 2019.
[4]
Y.-D. Kwon, J. Choo, B. Kim, I. Yoon, Y. Gwon, and S. Min, “POMO: Policy optimization with multiple optima for reinforcement learning,” in Advances in neural information processing systems, 2020.
[5]
Z.-H. Fu, K.-B. Qiu, and H. Zha, “Generalize a small pre-trained model to arbitrarily large tsp instances,” in Proceedings of the AAAI conference on artificial intelligence, 2021, vol. 35, pp. 7474–7482.
[6]
R. Qiu, Z. Sun, and Y. Yang, “Dimes: A differentiable meta solver for combinatorial optimization problems,” Advances in Neural Information Processing Systems, vol. 35, pp. 25531–25546, 2022.
[7]
Y. Min, Y. Bai, and C. P. Gomes, “Unsupervised learning for solving the travelling salesman problem,” in Advances in neural information processing systems, 2023.
[8]
Z. Sun and Y. Yang, “Difusco: Graph-based diffusion solvers for combinatorial optimization,” Advances in neural information processing systems, vol. 36, pp. 3706–3731, 2023.
[9]
Y. Li, J. Guo, R. Wang, H. Zha, and J. Yan, “Fast t2t: Optimization consistency speeds up diffusion-based training-to-testing solving for combinatorial optimization,” Advances in Neural Information Processing Systems, vol. 37, pp. 30179–30206, 2024.
[10]
G. E. Mena, D. Belanger, S. W. Linderman, and J. Snoek, “Learning latent permutations with gumbel-sinkhorn networks,” in International conference on learning representations, 2018.
[11]
M. Paulus, D. Choi, D. Tarlow, A. Krause, and C. J. Maddison, “Gradient estimation with stochastic softmax tricks,” Advances in Neural Information Processing Systems, vol. 33, pp. 5691–5704, 2020.
[12]
Y. Min and C. P. Gomes, “Graph neural networks are heuristics,” arXiv preprint arXiv:2601.13465, 2026.
[13]
L. Xin, W. Song, Z. Cao, and J. Zhang, “NeuroLKH: Combining deep learning model with lin-kernighan-helsgaun heuristic for solving the traveling salesman problem,” in Advances in neural information processing systems, 2021.
[14]
Y. Xia, X. Yang, Z. Liu, Z. Liu, L. Song, and J. Bian, “Position: Rethinking post-hoc search-based neural approaches for solving large-scale traveling salesman problems,” arXiv preprint arXiv:2406.03503, 2024.
[15]
M. Böther, O. Kißig, M. Taraz, S. Cohen, K. Seidel, and T. Friedrich, “What’s wrong with deep learning in tree search for combinatorial optimization,” arXiv preprint arXiv:2201.10494, 2022.
[16]
M. Held and R. M. Karp, “The traveling-salesman problem and minimum spanning trees,” Operations research, vol. 18, no. 6, pp. 1138–1162, 1970.
[17]
M. Held and R. M. Karp, “The traveling-salesman problem and minimum spanning trees: Part II,” Mathematical programming, vol. 1, no. 1, pp. 6–25, 1971.
[18]
A. Parjadis, Q. Cappart, B. Dilkina, A. Ferber, and L.-M. Rousseau, “Learning lagrangian multipliers for the travelling salesman problem,” arXiv preprint arXiv:2312.14836, 2023.
[19]
S. O. Gharan, A. Saberi, and M. Singh, “A randomized rounding approach to the traveling salesman problem,” in 2011 IEEE 52nd annual symposium on foundations of computer science, 2011, pp. 550–559.
[20]
K. Genova and D. P. Williamson, “An experimental evaluation of the best-of-many christofides’ algorithm for the traveling salesman problem,” Algorithmica, vol. 78, no. 4, pp. 1109–1130, 2017.
[21]
B. Amos and J. Z. Kolter, “OptNet: Differentiable optimization as a layer in neural networks,” in Proceedings of the 34th international conference on machine learning, 2017, pp. 136–145.
[22]
A. Agrawal, B. Amos, S. Barratt, S. Boyd, S. Diamond, and J. Z. Kolter, “Differentiable convex optimization layers,” in Advances in neural information processing systems, 2019, pp. 9558–9570.
[23]
S. Bai, J. Z. Kolter, and V. Koltun, “Deep equilibrium models,” in Advances in neural information processing systems, 2019, pp. 688–699.
[24]
M. Blondel et al., “Efficient and modular implicit differentiation,” in Advances in neural information processing systems, 2022.
[25]
D. L. Applegate, R. E. Bixby, V. Chvátal, and W. J. Cook, “The traveling salesman problem: A computational study,” in The traveling salesman problem, Princeton university press, 2011.