TIMEST: Temporal Information Motif Estimator Using Sampling Trees

Yunjie Pan, Omkar Bhalerao, C. Seshadhri, Nishil Talati

TL;DR

TIMEST is a novel algorithm designed to count complex temporal patterns (motifs) in massive, time-stamped graphs. By leveraging a "temporal spanning tree" sampling approach, it achieves a 28x speedup over state-of-the-art GPU-based exact methods while maintaining less than 5% error, finally making the analysis of 5- and 6-node temporal motifs practical for large-scale networks.

What Problem Does This Paper Address?

In the world of graph mining, motifs are small, recurring subgraphs that act as the "building blocks" of a network. While we understand static motifs well, most real-world data—financial transactions, social media interactions, and biological pathways—is temporal, meaning edges have timestamps.

Temporal motif mining is notoriously difficult because it adds strict timing constraints: not only must the nodes be connected in a specific shape, but the edges must also occur in a specific chronological order within a short time window ($\delta$). This leads to a combinatorial explosion. A graph with a few million edges can contain trillions of potential temporal motifs. Consequently, existing exact algorithms often hit a wall at motifs with just four vertices, and current approximate methods are either too slow or lose accuracy as motif complexity grows.

Methods

The authors introduce TIMEST (Temporal Information Motif Estimator Using Sampling Trees), which shifts the strategy from "finding the whole motif" to "sampling a representative backbone."

  1. Temporal Spanning Tree Sampling: Instead of searching for the entire complex motif (which might have many cycles), TIMEST identifies a spanning tree of that motif. Trees are much easier to handle computationally.
  2. Weighted Sampling via Dynamic Programming: The algorithm precomputes "sampling weights" for every edge in the input graph. These weights represent how many partial matches to the motif's spanning tree exist starting from that edge. This allows TIMEST to sample sub-structures that are highly likely to be part of a target motif.
  3. Relaxed Constraints: To keep the sampling process efficient, TIMEST doesn't enforce every single rule of the motif immediately. It uses three specific "relaxed" constraints during the initial sampling phase:
  4. Constraint 1: Enforcing edge order and time windows only for adjacent edges in the tree.
  5. Constraint 2: Ensuring that adjacent edges don't map to the same vertex (preserving the graph's topology).
  6. Constraint 3: Using a $2\delta$ sliding window approach to handle global time constraints without missing patterns that straddle interval boundaries.
  7. Randomized Estimation: After sampling a tree, the algorithm checks how many full motifs it can be extended into and uses standard statistical techniques to scale this up to a global estimate.

Datasets

The authors evaluated TIMEST on four diverse, large-scale temporal datasets:

  • wiki-talk (WT): A network of Wikipedia user talk page edits (1.1M nodes, 7.8M edges).
  • stackoverflow (SO): User interactions on the Q&A site (2.6M nodes, 63.5M edges).
  • bitcoin (BI): A public ledger of transactions (48.1M nodes, 113.1M edges).
  • reddit-reply (RE): A massive dataset of comment threads (8.4M nodes, 636.3M edges).

They tested these against a library of connected 4-, 5-, and 6-vertex temporal motifs, including complex patterns like 6-node cycles and bipartite structures.

Key Insights and Ideas

  • The Power of the "Best" Tree: A motif can have many spanning trees. TIMEST uses a heuristic called "constraint looseness" to pick the spanning tree that is the most "restrictive." By sampling the rarest part of the motif first, the algorithm significantly reduces the search space.
  • CPU vs. GPU: Interestingly, while the state-of-the-art exact method (Everest) uses high-end GPUs, TIMEST is implemented on a standard CPU. Its algorithmic efficiency is so high that it outperforms the GPU implementation by an order of magnitude.
  • Handling the "Boundary" Problem: Most sampling methods partition time into rigid blocks, which misses motifs that start in one block and end in another. TIMEST’s $2\delta$ overlapping sliding window ensures that every valid motif is counted exactly once (or a predictable number of times), allowing for unbiased estimation.

Key Results

  • Massive Speedups: TIMEST demonstrated an average 28x speedup over Everest (the SOTA GPU exact algorithm) and a 6x speedup over PRESTO (the SOTA approximate algorithm).
  • High Accuracy: In most test cases, the estimation error remained below 5%.
  • Practical Impact: In a financial fraud detection scenario, TIMEST counted a specific money-laundering motif in just 4 minutes with 0.6% error. For comparison, exact methods took more than two days to complete the same task.
  • Scalability: TIMEST successfully processed 6-node motifs on the Reddit dataset where previous methods simply timed out or ran out of memory.

Limitations and Future Work

The authors acknowledge a few areas for growth:

  • Total Ordering: TIMEST currently assumes a "total ordering" of edges (Edge 1 < Edge 2 < Edge 3). In some applications, a "partial order" (where some edges can happen simultaneously or in any order) might be more useful.
  • Extreme Density: While it handles most motifs well, TIMEST still struggles with extremely dense 6-node cliques (like $M_{6-5}$), where the number of valid samples is so low that the variance of the estimator increases.
  • Future Directions: The authors suggest extending the framework to support arbitrary partial orderings and exploring even more sophisticated heuristics for spanning tree selection.

Summary updated

BibTeX
@article{pan2025timest,
  author = {Yunjie Pan and Omkar Bhalerao and C. Seshadhri and Nishil Talati},
  title = {{TIMEST: Temporal Information Motif Estimator Using Sampling Trees}},
  journal = {Proc. VLDB Endow.},
  year = {2025},
}
Figure