Can Graph Neural Networks Count Substructures?

Zhengdao Chen, Lei Chen, Soledad Villar, Joan Bruna
2/10/2020
cs.LGcs.DMstat.ML
gnn

Official code: leichen2018/GNN-Substructure-Counting (36 stars, Python, last commit 2021-03-03).

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.

Show full abstract

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 substructures 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 Maron et al. (2019). 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 Murphy et al. (2019), 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.

View on arXivView PDF

Code Implementations(1)

The official implementation of ''Can Graph Neural Networks Count Substructures?'' NeurIPS 2020

364PythonOct 22, 20205 years ago

Similar Papers

Cite this paper

@article{chen2020graph,
  title  = {Can Graph Neural Networks Count Substructures?},
  author = {Zhengdao Chen and Lei Chen and Soledad Villar and Joan Bruna},
  year   = {2020},
  eprint = {2002.04025},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2002.04025}
}

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/2002.04025.svg)](https://codeofpaper.com/paper/2002.04025)

Discussion