Abstract
Frequent Subgraph Mining (FSM) is a fundamental task in network analysis, yet it faces significant computational hurdles when applied to massive, high-velocity streaming graphs. Traditional snapshot-based approaches are often too slow to keep pace with real-time data and fail to capture the continuous evolution of the network. This paper presents StreamFSM, an algorithm that transforms the global mining problem into a local transaction-based task. By sampling neighborhoods around newly arriving edges and treating them as discrete transactions, StreamFSM achieves near real-time performance on large-scale datasets like Twitter and HETREC. Our results demonstrate that StreamFSM significantly outperforms existing state-of-the-art tools in both processing speed and the discovery of complex structural patterns.
1. Introduction
The proliferation of dynamic networks—ranging from social media interactions to citation indices—has necessitated the development of efficient Frequent Subgraph Mining (FSM) techniques. FSM aims to identify recurring structural patterns (motifs) that appear with a frequency above a predefined threshold. In a static context, this is already an NP-complete problem due to the subgraph isomorphism challenge. In a streaming context, the challenge is compounded by the "firehose" nature of data, where nodes and edges are added continuously.
Existing methods typically rely on "snapshots," treating the stream as a sequence of static graphs. This approach is inherently redundant, as it re-processes large portions of the graph that have not changed. Furthermore, maintaining mathematical consistency in frequency counts across a single large graph requires complex non-overlapping instance calculations. StreamFSM addresses these issues by shifting the focus from the global graph to local updates.
2. Methodology: The StreamFSM Framework
StreamFSM introduces a paradigm shift by converting a single-large-graph problem into a many-small-transactions problem. The algorithm operates through several key stages:
2.1 Batch Processing and Neighborhood Sampling
Data arrives in batches of new nodes and edges. For every new edge introduced in a batch, StreamFSM treats it as an "anchor." The algorithm then samples a 1-hop neighborhood around the endpoints of this anchor edge. This locality-based approach is founded on the principle that a new edge only affects the frequency of subgraphs in its immediate vicinity.
2.2 Transaction Conversion
The sampled neighborhoods are treated as individual graph transactions. This conversion is the core innovation of StreamFSM. By treating local samples as independent transactions, the algorithm can leverage highly optimized transaction-based miners, such as gSpan. This bypasses the need for global subgraph isomorphism checks across the entire massive graph.
2.3 Heuristic Pruning and Extraction
To manage the combinatorial explosion often caused by "hubs" (nodes with very high degrees), StreamFSM employs heuristic pruning. A parameter $M$ limits the number of neighbors sampled per node, ensuring that star-shaped patterns do not overwhelm the computation. Additionally, to prevent overcounting within a single batch, edges are marked as "extracted" once they have been included in a sample.
2.4 Incremental Counting
As subgraphs are identified within the local transactions, their canonical labels are stored in a global dictionary. Their frequency counts are incremented incrementally as new batches are processed. This allows the algorithm to capture subgraphs that may be rare in a single batch but become frequent over the lifetime of the stream.
3. Experimental Evaluation
The researchers evaluated StreamFSM using a combination of synthetic and real-world datasets:
- Twitter: A dataset of ~46k nodes and ~58k edges related to narcotics keywords. This dataset is particularly challenging due to low label diversity, which typically increases the search space for miners.
- HETREC 2011: A movie-actor-director graph containing ~108k nodes and ~242k edges, representing nearly a century of cinematic data.
- DBLP: A citation network with ~43k nodes and 100k edges.
- Synthetic Graphs: Two artificial graphs of 10k nodes each were used to test the discovery of specific cyclical and star-shaped patterns.
4. Results and Discussion
StreamFSM demonstrated superior performance across all metrics compared to state-of-the-art tools like GERM and SUBDUE.
4.1 Computational Efficiency
StreamFSM processed the Twitter dataset in 4,817 seconds (~1.3 hours) and the HETREC dataset in 12,939 seconds (~3.6 hours). In contrast, the popular miner GERM failed to complete the Twitter analysis within an 8-hour window. While SUBDUE finished quickly, it was only able to identify two very simple patterns, whereas StreamFSM discovered 23 frequent subgraphs.
4.2 Qualitative Findings
The algorithm successfully identified meaningful real-world patterns. In the Twitter data, it captured motifs where a single user mentioned 11 others. In the HETREC data, it identified recurring collaborations between specific groups of actors and directors, demonstrating the algorithm's ability to find relevant structural information in attributed data.
5. Limitations and Future Work
While StreamFSM offers a significant leap in performance, it has certain limitations. The algorithm is sensitive to the parameters $M$ (neighbor limit) and $f_t$ (local frequency threshold), which currently require manual tuning. Furthermore, the current implementation assumes the graph can be stored in memory and only supports edge/node additions. Future iterations aim to include windowing mechanisms for infinite streams and support for edge deletions or attribute updates.
6. Conclusion
StreamFSM provides a robust and scalable solution for frequent subgraph mining in streaming environments. By leveraging local sampling and transaction-based mining, it overcomes the bottlenecks of traditional snapshot methods, enabling the discovery of complex patterns in near real-time.
Summary updated