Learning Graph Algorithms With Recurrent Graph Neural Networks

Florian Grötschla, Joël Mathys, Roger Wattenhofer
12/9/2022
cs.LGcs.AI
gnn

Official code: floriangroetschla/Recurrent-GNNs-for-algorithm-learning (3 stars, Jupyter Notebook, Apache-2.0, last commit 2022-12-16).

Abstract

Classical graph algorithms work well for combinatorial problems that can be thoroughly formalized and abstracted. Once the algorithm is derived, it generalizes to instances of any size.

Show full abstract

However, developing an algorithm that handles complex structures and interactions in the real world can be challenging. Rather than specifying the algorithm, we can try to learn it from the graph-structured data. Graph Neural Networks (GNNs) are inherently capable of working on graph structures; however, they struggle to generalize well, and learning on larger instances is challenging. In order to scale, we focus on a recurrent architecture design that can learn simple graph problems end to end on smaller graphs and then extrapolate to larger instances. As our main contribution, we identify three essential techniques for recurrent GNNs to scale. By using (i) skip connections, (ii) state regularization, and (iii) edge convolutions, we can guide GNNs toward extrapolation. This allows us to train on small graphs and apply the same model to much larger graphs during inference. Moreover, we empirically validate the extrapolation capabilities of our GNNs on algorithmic datasets.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
30Jupyter Notebook, PythonDec 9, 20223 years agoApache-2.0

Similar Papers

Cite this paper

@article{grtschla2022learning,
  title  = {Learning Graph Algorithms With Recurrent Graph Neural Networks},
  author = {Florian Grötschla and Joël Mathys and Roger Wattenhofer},
  year   = {2022},
  eprint = {2212.04934},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2212.04934}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2212.04934.svg)](https://codeofpaper.com/paper/2212.04934)

Discussion