Learning to Execute Graph Algorithms Exactly with Graph Neural Networks
Muhammad Fetrat Qharabagh, Artur Back de Luca, George Giapitzakis, Kimon Fountoulakis
Abstract
Understanding what graph neural networks can learn, especially their ability to learn to execute algorithms, remains a central theoretical challenge. In this work, we prove exact learnability results for graph algorithms under bounded-degree and finite-precision constraints. Our approach follows a two-step process. First, we train an ensemble of multi-layer perceptrons (MLPs) to execute the local instructions of a single node. Second, during inference, we use the trained MLP ensemble as the update function within a graph neural network (GNN). Leveraging Neural Tangent Kernel (NTK) theory, we show that local instructions can be learned from a small training set, enabling the complete graph algorithm to be executed during inference without error and with high probability. To illustrate the learning power of our setting, we establish a rigorous learnability result for the LOCAL model of distributed computation. We further demonstrate positive learnability results for widely studied algorithms such as message flooding, breadth-first and depth-first search, and Bellman-Ford.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 666134b1-d0a2-400d-aa58-95cc3e62940fBuilds on28
- Faith and Fate: Limits of Transformers on CompositionalityNouha Dziri, Ximing Lu, Melanie Sclar, Xiang Lorraine Li et al.NeurIPS 2023 · 728 citations
- What graph neural networks cannot learn: depth vs widthAndreas LoukasICLR 2020 · 336 citations
- Combining Label Propagation and Simple Models out-performs Graph Neural NetworksQian Huang, Horace He, Abhay Singh, Ser-Nam Lim et al.ICLR 2021 · 322 citations
- Exploring Length Generalization in Large Language ModelsCem Anil, Yuhuai Wu, Anders Andreassen, Aitor Lewkowycz et al.NeurIPS 2022 · 267 citations
- Neural Execution of Graph AlgorithmsPetar Velickovic, Rex Ying, Matilde Padovano, Raia Hadsell et al.ICLR 2020 · 192 citations
Related papers
- Learning to Add, Multiply, and Execute Algorithmic Instructions Exactly with Neural NetworksArtur Back de Luca, George Giapitzakis, Kimon FountoulakisNeurIPS 2025 · 4 citations
- Which Algorithms Can Graph Neural Networks Learn?Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll et al.ICML 2026
- How Neural Networks Extrapolate: From Feedforward to Graph Neural NetworksKeyulu Xu, Mozhi Zhang, Jingling Li, Simon Shaolei Du et al.ICLR 2021 · 364 citations
- A Convergence Analysis of Gradient Descent on Graph Neural NetworksPranjal Awasthi, Abhimanyu Das, Sreenivas GollapudiNeurIPS 2021 · 15 citations
- Let's Agree to Degree: Comparing Graph Convolutional Networks in the Message-Passing FrameworkFloris Geerts, Filip Mazowiecki, Guillermo A. PérezICML 2021 · 42 citations
