Lune

ICLR2024Top-tier venue

Counting Graph Substructures with Graph Neural Networks

Charilaos I. Kanatsoulis, Alejandro Ribeiro

Abstract

Graph Neural Networks (GNNs) are powerful representation learning tools that have achieved remarkable performance in various downstream tasks. However, there are still open questions regarding their ability to count and list substructures, which play a crucial role in biological and social networks. In this work, we fill this gap and characterize the representation and generalization power of GNNs in terms of their ability to produce powerful representations that count substructures. In particular, we study the message-passing operations of GNNs with random node input in a novel fashion, and show how they can produce equivariant representations that are associated with high-order statistical moments. Using these representations, we prove that GNNs can learn how to count cycles, cliques, quasi-cliques, and the number of connected components in a graph. We also provide new insights into the generalization capacity of GNNs. Our analysis is constructive and enables the design of a generic GNN architecture that shows remarkable performance in four distinct tasks: cycle detection, cycle counting, graph classification, and molecular property prediction.

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.

11 top-tier papers have 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

  • Recipe for a General, Powerful, Scalable Graph Transformer cites What graph neural networks cannot learn: depth vs width
  • Recipe for a General, Powerful, Scalable Graph Transformer cites Weisfeiler and Lehman Go Cellular: CW Networks
  • Recipe for a General, Powerful, Scalable Graph Transformer cites Principal Neighbourhood Aggregation for Graph Nets
  • What Expressivity Theory Misses: Message Passing Complexity for GNNs cites Weisfeiler and Lehman Go Cellular: CW Networks
  • Weisfeiler and Lehman Go Cellular: CW Networks cites Principal Neighbourhood Aggregation for Graph Nets
  • Graph Self-Supervised Learning with Learnable Structural and Positional Encodings cites Identity-aware Graph Neural Networks
  • Graph Self-Supervised Learning with Learnable Structural and Positional Encodings cites Recipe for a General, Powerful, Scalable Graph Transformer
  • Graph Self-Supervised Learning with Learnable Structural and Positional Encodings cites Weisfeiler and Lehman Go Cellular: CW Networks
  • Relational Graph Transformer cites Identity-aware Graph Neural Networks
  • Relational Graph Transformer cites Recipe for a General, Powerful, Scalable Graph Transformer
  • Relational Graph Transformer cites What graph neural networks cannot learn: depth vs width
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers11

  1. Relational Graph TransformerVijay Prakash Dwivedi, Sri Jaladi, Yangyi Shen, Federico Lopez et al.ICLR 2026 · 35 citations
  2. GeoDynamics: A Geometric State-Space Neural Network for Understanding Brain Dynamics on Riemannian ManifoldsTingting Dan, Jiaqi Ding, Guorong WuNeurIPS 2025 · 4 citations
  3. What Expressivity Theory Misses: Message Passing Complexity for GNNsNiklas Kemper, Tom Wollschläger, Stephan GünnemannNeurIPS 2025 · 3 citations
  4. Graph Self-Supervised Learning with Learnable Structural and Positional EncodingsAsiri Wijesinghe, Hao Zhu, Piotr KoniuszWWW 2025 · 3 citations
  5. Efficient and Accurate Subgraph Counting: A Bottom-up Flow-learning based ApproachQiuyu Guo, Jianye Yang, Wenjie Zhang, Hanchen Wang et al.VLDB 2025 · 3 citations

Builds on19

  1. Recipe for a General, Powerful, Scalable Graph TransformerLadislav Rampásek, Michael Galkin, Vijay Prakash Dwivedi, Anh Tuan Luu et al.NeurIPS 2022 · 1,216 citations
  2. Principal Neighbourhood Aggregation for Graph NetsGabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò et al.NeurIPS 2020 · 914 citations
  3. What graph neural networks cannot learn: depth vs widthAndreas LoukasICLR 2020 · 336 citations
  4. Weisfeiler and Lehman Go Cellular: CW NetworksCristian Bodnar, Fabrizio Frasca, Nina Otter, Yuguang Wang et al.NeurIPS 2021 · 330 citations
  5. Identity-aware Graph Neural NetworksJiaxuan You, Jonathan Michael Gomes Selman, Rex Ying, Jure LeskovecAAAI 2021 · 316 citations

Related papers

  1. Can Graph Neural Networks Count Substructures?Zhengdao Chen, Lei Chen, Soledad Villar, Joan BrunaNeurIPS 2020 · 392 citations
  2. Boosting the Cycle Counting Power of Graph Neural Networks with I2^2-GNNsYinan Huang, Xingang Peng, Jianzhu Ma, Muhan ZhangICLR 2023 · 3 citations
  3. Graph Neural Networks Can (Often) Count SubstructuresPaolo Pellizzoni, Till Hendrik Schulz, Karsten M. BorgwardtICLR 2025
  4. Beyond Weisfeiler-Lehman: A Quantitative Framework for GNN ExpressivenessBohang Zhang, Jingchu Gai, Yiheng Du, Qiwei Ye et al.ICLR 2024 · 59 citations
  5. Distance-Restricted Folklore Weisfeiler-Leman GNNs with Provable Cycle Counting PowerJunru Zhou, Jiarui Feng, Xiyuan Wang, Muhan ZhangNeurIPS 2023 · 15 citations
Dusk over the sea between two cliffs drawn in fine vertical lines