Graph Neural Networks are Dynamic Programmers
Andrew Joseph Dudzik, Petar Velickovic
Abstract
Recent advances in neural algorithmic reasoning with graph neural networks (GNNs) are propped up by the notion of algorithmic alignment. Broadly, a neural network will be better at learning to execute a reasoning task (in terms of sample complexity) if its individual components align well with the target algorithm. Specifically, GNNs are claimed to align with dynamic programming (DP), a general problem-solving strategy which expresses many polynomial-time algorithms. However, has this alignment truly been demonstrated and theoretically quantified? Here we show, using methods from category theory and abstract algebra, that there exists an intricate connection between GNNs and DP, going well beyond the initial observations over individual algorithms such as Bellman-Ford. Exposing this connection, we easily verify several prior findings in the literature, produce better-grounded GNN architectures for edge-centric tasks, and demonstrate empirical results on the CLRS algorithmic reasoning benchmark. We hope our exposition will serve as a foundation for building stronger algorithmically aligned GNNs.
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.
Cited by top-tier papers23
- Neural Sheaf Diffusion: A Topological Perspective on Heterophily and Oversmoothing in GNNsCristian Bodnar, Francesco Di Giovanni, Benjamin Paul Chamberlain, Pietro Lió et al.NeurIPS 2022 · 313 citations
- The CLRS Algorithmic Reasoning BenchmarkPetar Velickovic, Adrià Puigdomènech Badia, David Budden, Razvan Pascanu et al.ICML 2022 · 118 citations
- Can Graph Learning Improve Planning in LLM-based Agents?Xixi Wu, Yifei Shen, Caihua Shan, Kaitao Song et al.NeurIPS 2024 · 67 citations
- Neural Algorithmic Reasoning with Causal RegularisationBeatrice Bevilacqua, Kyriacos Nikiforou, Borja Ibarz, Ioana Bica et al.ICML 2023 · 39 citations
- Simulation of Graph Algorithms with Looped TransformersArtur Back de Luca, Kimon FountoulakisICML 2024 · 31 citations
Builds on10
- Learning to Simulate Complex Physics with Graph NetworksAlvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying et al.ICML 2020 · 1,439 citations
- 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
- How Neural Networks Extrapolate: From Feedforward to Graph Neural NetworksKeyulu Xu, Mozhi Zhang, Jingling Li, Simon Shaolei Du et al.ICLR 2021 · 364 citations
- Neural Execution of Graph AlgorithmsPetar Velickovic, Rex Ying, Matilde Padovano, Raia Hadsell et al.ICLR 2020 · 192 citations
- Size-Invariant Graph Representations for Graph Classification ExtrapolationsBeatrice Bevilacqua, Yangze Zhou, Bruno RibeiroICML 2021 · 124 citations
Related papers
- What Can Neural Networks Reason About?Keyulu Xu, Jingling Li, Mozhi Zhang, Simon S. Du et al.ICLR 2020 · 281 citations
- Which Algorithms Can Graph Neural Networks Learn?Solveig Wittig, Antonis Vasileiou, Robert R. Nerem, Timo Stoll et al.ICML 2026
- Deep Equilibrium Algorithmic ReasoningDobrik Georgiev, Joseph Wilson, Davide Buffelli, Pietro LióNeurIPS 2024 · 7 citations
- Primal-Dual Neural Algorithmic ReasoningYu He, Ellen VitercikICML 2025
- Bridging the Gaps between Graph Neural Networks and Data-Flow Analysis: The Closer, the BetterQingchen Yu, Xin Liu, Qingguo Zhou, Chunming WuISSTA 2025
