Abstract
Frequent-subgraph mining (FSM) is a fundamental task in network analysis, yet it is computationally intensive, particularly in dynamic graphs where edges are continuously added and deleted. This paper introduces a novel approximation algorithm for mining frequent $k$-vertex subgraphs in fully-dynamic evolving graphs. By transitioning from edge-based sampling to a principled subgraph-based reservoir sampling approach, the authors provide a solution that maintains high-accuracy pattern detection with theoretical guarantees, significantly outperforming exact counting methods in terms of speed.
Introduction
Finding small, frequent patterns—or motifs—within large graphs is essential for applications ranging from social network analysis to bioinformatics. However, FSM is NP-hard even on static graphs. The complexity increases in evolving graphs, such as transaction networks or social media streams, where the graph structure changes in real-time. Existing methods often struggle with edge deletions or fail to scale. This research addresses these challenges by proposing a suite of algorithms designed to maintain a high-quality approximation of frequent patterns as the graph evolves.
Methodology
The core of the proposed approach is subgraph-based reservoir sampling. Unlike traditional methods that sample edges, this approach maintains a fixed-size reservoir ($M$) of $k$-vertex subgraphs, ensuring uniform sampling probability. The methodology is built on three pillars:
- Uniform Subgraph Sampling: Every subgraph of size $k$ has an equal probability of being included in the reservoir, which simplifies the estimation of global frequencies.
- Handling Deletions via Random Pairing: To maintain uniformity in the face of edge deletions, the authors adapt a "Random Pairing" technique. This uses a system of counters to determine whether to replace a deleted subgraph immediately or wait for a future insertion to maintain the sample's statistical properties.
- Efficiency through Skip Optimization: To avoid the bottleneck of enumerating every new subgraph, the algorithm utilizes Vitter’s skip optimization. By employing bottom-k sketches to estimate local neighborhood sizes, the algorithm can mathematically "skip" over irrelevant subgraphs, drastically reducing processing time.
Experimental Evaluation
The algorithms were tested on two large-scale real-world datasets:
- Patents (PT): A citation graph with 3 million nodes and 14 million edges.
- YouTube (YT): A social network graph with 4.6 million nodes and 43 million edges.
Streams were simulated using both random permutation and sliding window models to test the algorithms' performance in fully-dynamic scenarios.
Results and Discussion
The proposed Subgraph Reservoir (SR) and its Optimized version (OSR) demonstrate superior performance compared to the Edge Reservoir (ER) baseline across all metrics.
As shown in the figure above, SR and OSR consistently achieve lower Average Relative Error (RE) than the edge-based approach. In terms of Precision and Recall, the subgraph-based methods maintain near-perfect scores, particularly on the YouTube dataset, where the edge-based baseline's precision degrades as the frequency threshold increases.
Furthermore, OSR provides a significant speed advantage, processing updates in microseconds on the Patents dataset. While slightly slower than edge-based sampling due to the additional work of neighborhood exploration, OSR offers a far more favorable trade-off between accuracy and computational cost.
Conclusion and Future Work
This work establishes a new state-of-the-art for approximate FSM in dynamic graphs. By prioritizing subgraphs over edges and leveraging skip optimization, the authors provide a robust framework for real-time pattern mining. Future research will focus on scaling the neighborhood exploration for larger subgraphs ($k > 3$) and improving the accuracy of sketches in highly diverse labeled graphs.
Summary updated