Neural Algorithmic Reasoning for Combinatorial Optimisation

Dobrik Georgiev, Danilo Numeroso, Davide Bacciu, Pietro Lio

Abstract

Solving NP-hard/complete combinatorial problems with neural networks is a challenging research area that aims to surpass classical approximate algorithms. The long-term objective is to outperform hand-designed heuristics for NP-hard/complete problems by learning to generate superior solutions solely from training data. Current neural-based methods for solving CO problems often overlook the inherent "algorithmic" nature of the problems. In contrast, heuristics designed for CO problems, e.g. TSP, frequently leverage well-established algorithms, such as those for finding the minimum spanning tree. In this paper, we propose leveraging recent advancements in neural algorithmic reasoning to improve the learning of CO problems. Specifically, we suggest pre-training our neural model on relevant algorithms before training it on CO instances. Our results demonstrate that, using this learning setup, we achieve superior performance compared to non-algorithmically informed deep learning models.

Introduction

Neural Combinatorial Optimization (NCO) seeks to replace traditional, hand-crafted heuristics with deep learning models capable of solving complex problems directly from data. However, a significant limitation of current NCO models is their treatment of these problems as standard predictive tasks, ignoring the algorithmic foundations that classical heuristics rely upon. For instance, the Christofides algorithm for the Travelling Salesman Problem (TSP) utilizes polynomial-time (P) subroutines like Minimum Spanning Tree (MST) or shortest path calculations. This research investigates whether transferring knowledge from these fundamental polynomial-time algorithms can enhance a neural network's ability to solve and generalize on NP-hard combinatorial problems.

Methodology

We employ an Encode-Process-Decode architecture centered around a Message-Passing Neural Network (MPNN). The core innovation lies in a two-stage transfer learning pipeline:

  1. Neural Algorithmic Reasoning (NAR) Pre-training: The MPNN is first trained to mimic the step-by-step execution trajectories of classical algorithms. For TSP, we focus on algorithms like Bellman-Ford and Prim’s MST, using the CLRS-30 benchmark framework.
  2. Transfer to NP-Hard Tasks: We explored several strategies to inject this algorithmic knowledge into the target task, including Pre-train and Freeze (PF), Pre-train and Fine-Tune (PFT), 2-Processor transfer (2PROC), and Multi-Task Learning (MTL).

This approach marks the first attempt to transfer algorithmic reasoning across complexity classes, specifically from P to NP-hard problems.

Key Insights: The Power of Fine-Tuning

A critical finding is that Pre-train and Fine-Tune (PFT) is the most effective transfer method for P $\rightarrow$ NP tasks. While prior NAR research on simpler tasks often favored multi-task setups, the transition to NP-hard problems requires the network to adapt its rigid algorithmic representations into flexible heuristics. Furthermore, the relevance of the pre-training algorithm is paramount; pre-training on task-related algorithms (e.g., MST for TSP) yields significantly better results than unrelated ones.

Relative error over training epochs comparing the baseline MPNN against the algorithmically pre-trained MPNN_PFT. The pre-trained model exhibits faster convergence and lower overall error.

As shown in the training dynamics, injecting algorithmic knowledge acts as a strong inductive bias, leading to faster convergence and delayed overfitting compared to training from scratch.

Experimental Results

Models were trained on small graphs (10-20 nodes) and evaluated on much larger, unseen graph sizes (up to 1000 nodes) to test out-of-distribution (OOD) generalization.

TSP Performance

In TSP evaluations using beam search, the algorithmically informed model (MPNN${PFT}$) consistently outperformed both the baseline MPNN and previous state-of-the-art architectures. For 100-node TSP graphs, MPNN${PFT}$ achieved a relative error of 26.9%, a notable improvement over the baseline's 31.1% and the 97.6% error seen in prior autoregressive models.

Comprehensive performance comparison (relative error %) on TSP for various models across different test graph sizes and beam search widths.

Vertex K-Center (VKC)

Similar trends were observed for the Vertex K-Center problem. Pre-training on Bellman-Ford and greedy algorithms improved extrapolation to larger graphs, achieving a 26.4% error on 100 nodes compared to 36.3% for a deterministic Farthest First baseline.

Conclusion and Future Work

While algorithmically informed neural models significantly outperform standard deep learning baselines and simple heuristics, they do not yet match the performance of highly optimized classical solvers like LKH or Concorde. A primary bottleneck is scalability; the $O(N)$ message-passing steps required to simulate algorithmic execution become computationally expensive on very large graphs. Future research will focus on aligning neural execution with parallel algorithms to reduce the required iterations and improve runtime efficiency.

Summary updated

BibTeX
@inproceedings{georgiev2023neural,
  author = {Dobrik Georgiev and Danilo Numeroso and Davide Bacciu and Pietro Lio},
  title = {{Neural Algorithmic Reasoning for Combinatorial Optimisation}},
  booktitle = {LoG},
  year = {2023},
  url = {https://openreview.net/forum?id=TRH89iFglO},
}
Figure