Less Is More - On the Importance of Sparsification for Transformers and Graph Neural Networks for TSP

Attila Lischka, Jiaming Wu, Rafael Basso, Morteza Haghir Chehreghani, Balázs KulcsárarXiv 2024 · DOI

The Challenge of Dense Graphs

The Traveling Salesman Problem (TSP) is a cornerstone of combinatorial optimization. While modern Graph Neural Networks (GNNs) and Transformers have made significant strides in solving it, they often struggle with a phenomenon known as "information flooding."

Most machine learning models treat the TSP as a dense graph where every city is connected to every other city. While mathematically accurate, this approach causes node embeddings to become indistinguishable during the learning process. As nodes aggregate information from the entire graph simultaneously, their mathematical representations converge, making it nearly impossible for the decoder to determine the next optimal city in the tour.

In dense graphs, node embeddings (right) become noisy and similar, hindering the decoder's ability to distinguish between cities.

Methods: Pruning for Performance

To combat this, the authors propose sparsification—a data preprocessing step that prunes "unpromising" edges before the model begins training. This acts as a form of feature engineering, forcing the model to focus only on the most relevant neighbors.

Sparsification Techniques

The study evaluates two primary methods for selecting which edges to retain:

  1. $k$-nearest neighbors ($k$-nn): A simple approach that keeps only the $k$ closest cities for each node.
  2. 1-Trees: A more sophisticated method based on Minimum Spanning Trees. Unlike $k$-nn, 1-Trees ensure the resulting sparse graph remains connected, which is vital for global information flow.

Connectivity is King

A critical finding of the research is that connectivity is essential for effective learning. While $k$-nn is computationally simple, it often creates isolated "islands" of nodes that cannot communicate with the rest of the graph. The 1-Tree method is superior because it guarantees a connected graph while still maintaining high levels of sparsity.

Sparsification via 1-Trees ensures a connected graph, which is vital for maintaining information flow across the entire TSP instance.

Ensembles of Sparsity

To mitigate the risk of accidentally deleting a long edge that might be part of an optimal tour, the authors utilize an ensemble of encoders. Each encoder processes the same TSP instance but at a different level of sparsification (e.g., one looks at the 3 nearest neighbors, while another looks at 50), ensuring a robust representation.

Key Results

The quantitative improvements brought by sparsification are dramatic:

  • GAT Performance: For a Graph Attention Network (GAT) trained on TSP100, sparsification reduced the optimality gap from 15.66% down to 0.7%—a 22-fold improvement.
  • State-of-the-Art: The ensemble Transformer model achieved a near-perfect optimality gap of just 0.10% for TSP100 and a perfect 0.00% for TSP50, outperforming previous top-tier encoder-decoder models.
  • Data Efficiency: These results were achieved using significantly less training data (16 million instances) compared to prior models that required up to 50 million instances.

Conclusion

By reducing the "noise" in the input graph, sparsification allows models to produce sharper, more discriminative embeddings. This "less is more" approach demonstrates that strategic preprocessing can be just as impactful as architectural innovation in solving complex combinatorial problems.

Summary updated

BibTeX
@misc{lischka2024less,
  author = {Attila Lischka and Jiaming Wu and Rafael Basso and Morteza Haghir Chehreghani and Balázs Kulcsár},
  title = {{Less Is More - On the Importance of Sparsification for Transformers and Graph Neural Networks for TSP}},
  year = {2024},
  eprint = {2403.17159},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.17159},
}
Figure