# Efficient Sampling Algorithms for Approximate Temporal Motif Counting (Extended Version)

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

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 28 Jul 2020.

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

- [TempME: Towards the Explainability of Temporal Graph Neural Networks via Motif Discovery](https://mlsanity.com/paper/2310.19324/) (2023)
- [FinCast: A Foundation Model for Financial Time-Series Forecasting](https://mlsanity.com/paper/2508.19609/) (2025)
- [PRESTO: Simple and Scalable Sampling Techniques for the Rigorous Approximation of Temporal Motif Counts](https://mlsanity.com/paper/2101.07152/) (2021)
- [odeN: Simultaneous Approximation of Multiple Motif Counts in Large Temporal Networks](https://mlsanity.com/paper/2108.08734/) (2021)
- [Scalable Motif Counting for Large-scale Temporal Graphs](https://mlsanity.com/paper/2204.09236/) (2022)
- [Beyond Linearity and Time-Homogeneity: Relational Hyper Event Models with Time-Varying Non-Linear Effects](https://mlsanity.com/paper/2509.05289/) (2025)

## Abstract (arXiv)

A great variety of complex systems ranging from user interactions in communication networks to transactions in financial markets can be modeled as temporal graphs, which consist of a set of vertices and a series of timestamped and directed edges. Temporal motifs in temporal graphs are generalized from subgraph patterns in static graphs which take into account edge orderings and durations in addition to structures. Counting the number of occurrences of temporal motifs is a fundamental problem for temporal network analysis. However, existing methods either cannot support temporal motifs or suffer from performance issues. In this paper, we focus on approximate temporal motif counting via random sampling. We first propose a generic edge sampling (ES) algorithm for estimating the number of instances of any temporal motif. Furthermore, we devise an improved EWS algorithm that hybridizes edge sampling with wedge sampling for counting temporal motifs with 3 vertices and 3 edges. We provide comprehensive analyses of the theoretical bounds and complexities of our proposed algorithms. Finally, we conduct extensive experiments on several real-world datasets, and the results show that our ES and EWS algorithms have higher efficiency, better accuracy, and greater scalability than the state-of-the-art sampling method for temporal motif counting.
