Evaluating Hybrid Graph Pattern Queries Using Runtime Index Graphs

Michael Lan, Xiaoying Wu, Dimitri Theodoratos

Abstract

This paper introduces a novel framework for efficiently matching "hybrid" graph patterns—queries that mix direct edges with reachability edges. By building a lightweight, query-specific Runtime Index Graph (RIG) on the fly and using a "double simulation" filtering technique, the authors achieve performance gains of up to three orders of magnitude over traditional graph matching methods.

Introduction

Graph pattern matching is a cornerstone of data science, used in everything from social network analysis to bioinformatics. However, most existing tools force a choice: you either search for exact structures (edge-to-edge) or reachability paths (edge-to-path). "Hybrid" patterns, which combine both, are highly expressive but notoriously difficult to compute.

Examples of hybrid graph patterns $Q_1$ to $Q_5$ combining direct and reachability constraints.

The primary challenge is the "intermediate result explosion." Traditional join-based approaches break a query into small pieces, find matches for those pieces, and then try to stitch them together. This often generates a massive number of partial matches that never actually lead to a full solution, consuming all available memory or timing out on large data graphs.

Methods: The GM Framework

The authors propose a two-phase framework called GM (Graph Matcher):

1. Summarization Phase (The RIG)

Instead of searching the raw data graph immediately, the system builds a Runtime Index Graph (RIG). This is a compact, query-dependent summary that encodes all possible matches.

  • Double Simulation: To keep the RIG small, they use a novel filtering technique called "double simulation." Unlike standard filtering that only looks at a node's label or its children, double simulation prunes nodes by looking at both incoming and outgoing structural constraints simultaneously.
  • DAG Decomposition: They optimize the construction of this index by decomposing complex queries into Directed Acyclic Graphs (DAGs) to speed up the pruning process.
Overview of the matching process: from graph pattern $Q$ and data graph $G$ to the construction of the Runtime Index Graph (RIG).

2. Enumeration Phase (MJoin)

Once the RIG is built, the system uses a multi-way join algorithm called MJoin. Rather than joining edges one by one (binary joins), MJoin processes one query node at a time, intersecting adjacency lists in the RIG. This approach is "worst-case optimal," meaning it avoids the intermediate result explosion that plagues standard SQL-style joins. The implementation leverages RoaringBitmaps for high-performance bitwise operations.

Experimental Evaluation

The researchers evaluated their approach using nine real-world datasets from the Stanford Large Network Dataset Collection, covering various domains such as biology (Yeast, Human, HPRD), social networks (Epinions, DBLP), and web/communication graphs (Google, Amazon). These datasets range from small (3.1K nodes) to large (876K nodes and 5.1M edges).

Key Results

  • Massive Speedups: The proposed GM algorithm outperformed traditional join-based and tree-based methods by 2 to 3 orders of magnitude in many cases.
  • Superior Scalability: While other methods crashed or timed out on queries with more than 10-16 nodes, GM successfully evaluated queries with up to 32 nodes.
  • Beating the Engines: GM significantly outperformed established graph systems, being up to 388x faster than Neo4j and consistently beating specialized engines like GraphflowDB and RapidMatch.
  • Efficiency: The RIG index is incredibly compact, typically representing less than 1% of the size of the original data graph.

Key Insights

  • Index On-The-Fly: You don't need a massive, persistent disk-based index to query graphs efficiently. A lightweight index built specifically for the query at runtime is often more effective.
  • The Power of Two Directions: Pruning nodes based on both parents and children (double simulation) is significantly more powerful than one-way simulation.
  • Node-at-a-time Joins: Joining nodes via multi-way intersections is the key to avoiding the memory-crushing explosion of partial results.

Conclusion and Future Work

The GM framework demonstrates that hybrid graph pattern matching can be made highly efficient through runtime indexing and optimized join strategies. Future work includes extending the framework to dynamic streaming graphs, further optimizing for isomorphism constraints, and utilizing hardware acceleration like SIMD for bitmap operations.

Summary updated

BibTeX
@inproceedings{lan2023evaluating,
  author = {Michael Lan and Xiaoying Wu and Dimitri Theodoratos},
  title = {{Evaluating Hybrid Graph Pattern Queries Using Runtime Index Graphs}},
  booktitle = {EDBT},
  year = {2023},
  doi = {10.48786/edbt.2023.59},
}
Figure