Can Graph Neural Networks Count Substructures?
Zhengdao Chen, Lei Chen, Soledad Villar, Joan Bruna
Abstract
The ability to detect and count certain substructures in graphs is important for solving many tasks on graph-structured data, especially in the contexts of computational chemistry and biology as well as social network analysis. Inspired by this, we propose to study the expressive power of graph neural networks (GNNs) via their ability to count attributed graph substructures, extending recent works that examine their power in graph isomorphism testing and function approximation. We distinguish between two types of substructure counting: induced-subgraph-count and subgraph-count, and establish both positive and negative answers for popular GNN architectures. Specifically, we prove that Message Passing Neural Networks (MPNNs), 2-Weisfeiler-Lehman (2-WL) and 2-Invariant Graph Networks (2-IGNs) cannot perform induced-subgraph-count of any connected substructure consisting of 3 or more nodes, while they can perform subgraph-count of star-shaped substructures. As an intermediary step, we prove that 2-WL and 2-IGNs are equivalent in distinguishing non-isomorphic graphs, partly answering an open problem raised in [38] . We also prove positive results for k-WL and k-IGNs as well as negative results for k-WL with a finite number of iterations. We then conduct experiments that support the theoretical results for MPNNs and 2-IGNs. Moreover, motivated by substructure counting and inspired by [45] , we propose the Local Relational Pooling model and demonstrate that it is not only effective for substructure counting but also able to achieve competitive performance on molecular prediction tasks.
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.
110 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- How Powerful are Spectral Graph Neural Networks cites What graph neural networks cannot learn: depth vs width
- How Powerful are Spectral Graph Neural Networks cites Generalization and Representational Limits of Graph Neural Networks
- How Powerful are Spectral Graph Neural Networks cites Distance Encoding: Design Provably More Powerful Neural Networks for Graph Representation Learning
- Open Graph Benchmark: Datasets for Machine Learning on Graphs cites Strategies for Pre-training Graph Neural Networks
- Generalization and Representational Limits of Graph Neural Networks cites What graph neural networks cannot learn: depth vs width
- Weisfeiler and Lehman Go Cellular: CW Networks cites Open Graph Benchmark: Datasets for Machine Learning on Graphs
- Weisfeiler and Lehman Go Cellular: CW Networks cites Strategies for Pre-training Graph Neural Networks
- Weisfeiler and Lehman Go Cellular: CW Networks cites Weisfeiler and Lehman Go Topological: Message Passing Simplicial Networks
- Distance Encoding: Design Provably More Powerful Neural Networks for Graph Representation Learning cites Open Graph Benchmark: Datasets for Machine Learning on Graphs
Cited by top-tier papers110
- Distance Encoding: Design Provably More Powerful Neural Networks for Graph Representation LearningPan Li, Yanbang Wang, Hongwei Wang, Jure LeskovecNeurIPS 2020 · 391 citations
- Weisfeiler and Lehman Go Cellular: CW NetworksCristian Bodnar, Fabrizio Frasca, Nina Otter, Yuguang Wang et al.NeurIPS 2021 · 330 citations
- Weisfeiler and Lehman Go Topological: Message Passing Simplicial NetworksCristian Bodnar, Fabrizio Frasca, Yuguang Wang, Nina Otter et al.ICML 2021 · 315 citations
- Pure Transformers are Powerful Graph LearnersJinwoo Kim, Dat Nguyen, Seonwoo Min, Sungjun Cho et al.NeurIPS 2022 · 311 citations
- How Powerful are Spectral Graph Neural NetworksXiyuan Wang, Muhan ZhangICML 2022 · 309 citations
Builds on5
- Open Graph Benchmark: Datasets for Machine Learning on GraphsWeihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong et al.NeurIPS 2020 · 3,935 citations
- Strategies for Pre-training Graph Neural NetworksWeihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik et al.ICLR 2020 · 1,744 citations
- Generalization and Representational Limits of Graph Neural NetworksVikas K. Garg, Stefanie Jegelka, Tommi S. JaakkolaICML 2020 · 363 citations
- What graph neural networks cannot learn: depth vs widthAndreas LoukasICLR 2020 · 336 citations
- Neural Subgraph Isomorphism CountingXin Liu, Haojie Pan, Mutian He, Yangqiu Song et al.KDD 2020 · 70 citations
Related papers
- Boosting the Cycle Counting Power of Graph Neural Networks with I-GNNsYinan Huang, Xingang Peng, Jianzhu Ma, Muhan ZhangICLR 2023 · 3 citations
- Graph Neural Networks Can (Often) Count SubstructuresPaolo Pellizzoni, Till Hendrik Schulz, Karsten M. BorgwardtICLR 2025
- Counting Graph Substructures with Graph Neural NetworksCharilaos I. Kanatsoulis, Alejandro RibeiroICLR 2024 · 17 citations
- Beyond Weisfeiler-Lehman: A Quantitative Framework for GNN ExpressivenessBohang Zhang, Jingchu Gai, Yiheng Du, Qiwei Ye et al.ICLR 2024 · 59 citations
- Distance-Restricted Folklore Weisfeiler-Leman GNNs with Provable Cycle Counting PowerJunru Zhou, Jiarui Feng, Xiyuan Wang, Muhan ZhangNeurIPS 2023 · 15 citations
