GraphZero: Breaking Symmetry for Efficient Graph Mining

Daniel Mawhirter, Sam Reinehr, Connor Holmes, Tongping Liu, Bo WuarXiv 2019

TL;DR

GraphZero is an optimizing compiler for graph mining that leverages group theory to solve the "symmetry problem"—the tendency of algorithms to wastefully count the same structural pattern multiple times. By automatically generating symmetry-breaking restrictions and pruning the search space for execution schedules, it achieves up to a 40x speedup in mining performance and a 197x reduction in compilation overhead compared to state-of-the-art systems like AutoMine.

The Bottlenecks of Modern Graph Mining

Graph mining—the process of finding patterns like triangles, cliques, or complex motifs in massive datasets—is a foundational task in social network analysis, bioinformatics, and cybersecurity. However, it is notoriously computationally expensive. Modern "compilation-based" systems, such as AutoMine, attempt to solve this by generating specialized nested-loop code to find specific patterns. Despite these advancements, two major bottlenecks remain:

  1. Computation Redundancy: Graphs are inherently symmetrical. A single instance of a pattern (an "embedding") can be identified in multiple ways depending on which vertex you start with. For example, a simple 4-vertex square can be mapped in 8 different ways. Without intervention, a mining algorithm will perform the same work eight times for a single result, leading to massive "over-counting."
  2. The "Chicken-and-Egg" Schedule Problem: To find a pattern efficiently, a compiler must choose an optimal "schedule" (the order in which it searches for vertices). Finding this schedule typically requires a brute-force search of all possible permutations. This process is so slow that it prevents "just-in-time" graph mining on dynamic queries, where the user might want to search for a new pattern on the fly.
GraphZero's workflow: The scheduling phase generates efficient code, while the mining phase demonstrates how a single square pattern leads to 8 redundant mappings (multiplicity).

GraphZero: A Group-Theoretic Solution

GraphZero introduces three novel techniques rooted in Group Theory to address these challenges. The core insight is that both slow execution (redundancy) and slow compilation (schedule search) stem from the same mathematical property: the automorphism group of the pattern.

1. Redundancy Optimizer

This component automatically generates a set of "ID restrictions." For instance, it might ensure that Vertex A's internal ID is always greater than Vertex B's ID. By enforcing these rules in the generated code, GraphZero ensures that every unique embedding is found exactly once, completely eliminating over-counting without requiring expensive post-processing.

2. Schedule Explorer

Instead of brute-forcing every possible vertex ordering, GraphZero uses automorphisms (symmetries of the pattern) to partition the search space. It identifies "equivalent" schedules and only explores one representative from each group. By using the "Stabilizer Chain" concept from group theory, the authors prove that this pruning doesn't miss the optimal execution path, drastically speeding up the compiler.

3. Orientation Optimizer

Orientation is a powerful optimization that prunes edges by converting an undirected graph into a directed one (usually based on vertex degree). Historically, this was only applicable to cliques (perfectly symmetrical patterns). GraphZero generalizes this to arbitrary patterns by combining degree-based reindexing with its generated ID restrictions, allowing it to prune edges for complex shapes like "houses" or "pentagons."

Experimental Evaluation

The authors evaluated GraphZero using 7 real-world graph datasets, ranging from small citation networks (CiteSeer) to the massive Twitter social network (1.2 billion edges).

As shown in the data, the redundancy problem (multiplicity) grows exponentially as patterns become more complex. For a 7-vertex motif, the multiplicity can reach over 10,000, meaning an unoptimized system would do 10,000 times more work than necessary.

The multiplicity (redundancy factor) of patterns increases significantly with the number of vertices, highlighting the critical need for symmetry-breaking.

Key Results

  • Performance: GraphZero is up to 40x faster than AutoMine for complex patterns like the "size-7 chordal cycle."
  • Compilation Speed: Schedule generation is up to 197x faster. For a 7-vertex motif, while older systems might take minutes to compile, GraphZero finishes in milliseconds, enabling interactive queries.
  • Orientation Gains: The generalized orientation provides up to an 88.6x speedup on certain patterns compared to unoptimized versions.
  • Scalability: On the massive Twitter dataset, GraphZero completed triangle counting in 3.9 hours, while the baseline took over 31 hours.

Conclusion and Future Directions

GraphZero demonstrates that the "symmetry problem" in graph mining is not just a nuisance but a primary driver of inefficiency. By applying formal group theory to compiler design, the system eliminates redundancy at its source.

While highly effective, future work could improve the system's performance model for non-random graphs and explore its application to dynamic graphs that change rapidly. Furthermore, extending these symmetry-breaking techniques to broader graph analytics, such as Graph Neural Network (GNN) preprocessing, remains a promising avenue for research.

Summary updated

BibTeX
@misc{mawhirter2019graphzero,
  author = {Daniel Mawhirter and Sam Reinehr and Connor Holmes and Tongping Liu and Bo Wu},
  title = {{GraphZero: Breaking Symmetry for Efficient Graph Mining}},
  year = {2019},
  eprint = {1911.12877},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.12877},
}
Figure