# Counting Motifs with Graph Sampling

arXiv: https://arxiv.org/abs/1802.07773 · HTML: https://mlsanity.com/paper/1802.07773/

## Key facts

- Cited by 3 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 21 Feb 2018.

## Built on by (most cited first, 3 of 3)

- [Relational Graph Convolutional Networks: A Closer Look](https://mlsanity.com/paper/2107.10015/) (2021)
- [Reinforcement Learning Enhanced Weighted Sampling for Accurate Subgraph Counting on Fully Dynamic Graph Streams](https://mlsanity.com/paper/2211.06793/) (2022)
- [PAIR: Pairwise-Aware Inclusion Reweighting for Adaptive Rollout Allocation in RLVR](https://mlsanity.com/paper/2608.11368/) (2026)

## Abstract (arXiv)

Applied researchers often construct a network from a random sample of nodes in order to infer properties of the parent network. Two of the most widely used sampling schemes are subgraph sampling, where we sample each vertex independently with probability p and observe the subgraph induced by the sampled vertices, and neighborhood sampling, where we additionally observe the edges between the sampled vertices and their neighbors. In this paper, we study the problem of estimating the number of motifs as induced subgraphs under both models from a statistical perspective. We show that: for any connected h on k vertices, to estimate s=mathsfs(h,G), the number of copies of h in the parent graph G of maximum degree d, with a multiplicative error of ε, (a) For subgraph sampling, the optimal sampling ratio p is Thetak(max (sε2)^-frac1k, ; fracdk-1sε2 ), achieved by Horvitz-Thompson type of estimators. (b) For neighborhood sampling, we propose a family of estimators, encompassing and outperforming the Horvitz-Thompson estimator and achieving the sampling ratio Ok(min (fracdsε2)^frac1k-1, ; √fracdk-2sε2). This is shown to be optimal for all motifs with at most 4 vertices and cliques of all sizes. The matching minimax lower bounds are established using certain algebraic properties of subgraph counts. These results quantify how much more informative neighborhood sampling is than subgraph sampling, as empirically verified by experiments on both synthetic and real-world data. We also address the issue of adaptation to the unknown maximum degree, and study specific problems for parent graphs with additional structures, e.g., trees or planar graphs.
