Abstract
Graph pattern matching is a fundamental problem encountered by many common graph mining tasks and the basic block of several graph mining systems. This paper explores for the first time how to proactively prune graphs to speed up graph pattern matching by leveraging the structure of the query pattern and the input graph. We propose building auxiliary graphs, which are different pruned versions of the graph, during query execution. This requires careful balancing between the upfront cost of building and managing auxiliary graphs and the gains of faster set operations. To this end, we propose GraphMini, a new system that uses query compilation and a new cost model to minimize the cost of building and maintaining auxiliary graphs and maximize gains. Our evaluation shows that using GraphMini can achieve one order of magnitude speedup compared to state-of-the-art subgraph enumeration systems on commonly used benchmarks.
Introduction
Graph pattern matching—the process of finding all instances of a specific small pattern within a massive data graph—is a computationally expensive task essential for social network analysis, bioinformatics, and fraud detection. As datasets grow to include billions of edges, the search space for these patterns expands exponentially. Traditional graph mining systems often treat the input graph as a static entity, relying on nested loops to match vertices. The primary performance bottleneck in this approach is the execution of millions of set operations (intersections and subtractions) on adjacency lists to identify candidate vertices.
GraphMini addresses this bottleneck by fundamentally changing how the "haystack" of graph data is handled during search. Instead of processing static, potentially long adjacency lists, GraphMini introduces Proactive Online Pruning to create compact, query-tailored versions of the data graph known as auxiliary graphs.
Proactive Online Pruning and Auxiliary Graphs
The core innovation of GraphMini is the use of auxiliary graphs. These are pruned versions of adjacency lists created on the fly. If the system determines that a vertex $u$ must be a neighbor of an already-matched vertex $a$, it prunes $u$’s adjacency list to include only neighbors of $a$ before passing that list to deeper nested loops. This reduces the size of the inputs for subsequent set operations, leading to compounding performance gains.
To ensure that the overhead of creating these structures does not outweigh the benefits, GraphMini employs an Online Cost Model. This model uses graph-level statistics to estimate if the upfront cost of building an auxiliary graph will be amortized by faster operations in deeper loops. Furthermore, the system ensures correctness via "Superset Pruning," where pruning is only performed if the filtering set is a guaranteed superset of the final candidate set.
Query Compilation and Execution
GraphMini does not use a generic execution engine; instead, it analyzes the query pattern to generate optimized C++ code. This compilation approach minimizes runtime overhead and allows for static references to auxiliary graphs within the execution plan.
As shown in the execution plan, each loop depth corresponds to a vertex in the query pattern. By integrating auxiliary graphs into this structure, GraphMini can significantly shorten the adjacency lists processed at each depth. Additionally, the system implements nested parallelism to balance workloads across CPU cores, which is particularly effective when dealing with dense regions of the search space.
Evaluation and Results
The researchers evaluated GraphMini using six real-world datasets from the SNAP repository, including social networks like Orkut and Friendster (1.8 billion edges). The system was tested against eight complex query patterns ranging from simple cliques to multi-edged structures.
Key results include:
- Significant Speedups: GraphMini outperformed GraphPi by up to 30.6x and Dryadic by up to 60.7x in edge-induced pattern matching.
- Vertex-Induced Efficiency: In more complex vertex-induced matching tasks, it achieved up to a 35x speedup over Dryadic.
- Low Overhead: Memory overhead for auxiliary graphs remained a small fraction of the original graph size, and the cost model effectively prevented sub-optimal pruning decisions.
Conclusion
GraphMini demonstrates that proactive pruning via auxiliary graphs is a highly effective strategy for accelerating graph pattern matching. While the current system is optimized for single-host environments and unlabeled graphs, it sets a new benchmark for subgraph enumeration efficiency. Future work may involve extending these techniques to distributed environments and integrating label-based pruning signals for even greater performance gains.
Summary updated