Lune

ICML2026Top-tier venue

Which Algorithms Can Graph Neural Networks Learn?

Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll, Floris Geerts, Yusu Wang, Christopher Morris

Abstract

In recent years, there has been growing interest in understanding neural architectures' ability to learn to execute discrete algorithms, a line of work often referred to as neural algorithmic reasoning. The goal is to integrate algorithmic reasoning capabilities into larger neural pipelines. Many such architectures are based on (message-passing) graph neural networks (MPNNs), owing to their permutation equivariance and ability to deal with sparsity and variable-sized inputs. However, existing work is either largely empirical and lacks formal guarantees or it focuses solely on expressivity, leaving open the question of when and how such architectures generalize beyond a finite training set. In this work, we propose a general theoretical framework that characterizes the sufficient conditions under which MPNNs can learn an algorithm from a training set of small instances and provably approximate its behavior on inputs of arbitrary size. Our framework applies to a broad class of algorithms, including single-source shortest paths, minimum spanning trees, and general dynamic programming problems, such as the 0-1 knapsack problem. In addition, we establish impossibility results for a wide range of algorithmic tasks, showing that standard MPNNs cannot learn them, and we derive more expressive MPNN-like architectures that overcome these limitations. Finally, we refine our analysis for the Bellman-Ford algorithm, yielding a substantially smaller required training set and significantly extending the recent work of Nerem et al. [2025] by allowing for a differentiable regularization loss. Empirical results largely support our theoretical findings.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Generalization and Representational Limits of Graph Neural Networks cites What graph neural networks cannot learn: depth vs width
  • Distance Encoding: Design Provably More Powerful Neural Networks for Graph Representation Learning cites Can Graph Neural Networks Count Substructures?
  • Learning to Approximate Uniform Facility Location via Graph Neural Networks cites Generalization and Representational Limits of Graph Neural Networks
  • Can Graph Neural Networks Count Substructures? cites What graph neural networks cannot learn: depth vs width
  • Can Graph Neural Networks Count Substructures? cites Generalization and Representational Limits of Graph Neural Networks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Learning to Approximate Uniform Facility Location via Graph Neural NetworksChendi Qian, Christopher Morris, Stefanie Jegelka, Christian SohlerICML 2026

Builds on52

  1. Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link PredictionZhaocheng Zhu, Zuobai Zhang, Louis-Pascal A. C. Xhonneux, Jian TangNeurIPS 2021 · 546 citations
  2. Can Graph Neural Networks Count Substructures?Zhengdao Chen, Lei Chen, Soledad Villar, Joan BrunaNeurIPS 2020 · 392 citations
  3. Distance Encoding: Design Provably More Powerful Neural Networks for Graph Representation LearningPan Li, Yanbang Wang, Hongwei Wang, Jure LeskovecNeurIPS 2020 · 391 citations
  4. Generalization and Representational Limits of Graph Neural NetworksVikas K. Garg, Stefanie Jegelka, Tommi S. JaakkolaICML 2020 · 363 citations
  5. What graph neural networks cannot learn: depth vs widthAndreas LoukasICLR 2020 · 336 citations

Related papers

  1. Graph Neural Networks are Dynamic ProgrammersAndrew Joseph Dudzik, Petar VelickovicNeurIPS 2022 · 82 citations
  2. Neural Execution of Graph AlgorithmsPetar Velickovic, Rex Ying, Matilde Padovano, Raia Hadsell et al.ICLR 2020 · 192 citations
  3. What Can Neural Networks Reason About?Keyulu Xu, Jingling Li, Mozhi Zhang, Simon S. Du et al.ICLR 2020 · 281 citations
  4. Primal-Dual Neural Algorithmic ReasoningYu He, Ellen VitercikICML 2025
  5. Learning to Execute Graph Algorithms Exactly with Graph Neural NetworksMuhammad Fetrat Qharabagh, Artur Back de Luca, George Giapitzakis, Kimon FountoulakisICML 2026
Dusk over the sea between two cliffs drawn in fine vertical lines