Abstract
Monitoring massive, fast-moving graph streams—such as social media interactions or protein-to-protein networks—for complex patterns is a significant computational challenge. This paper presents TRIC (TRIe-based Clustering), an algorithm designed to handle thousands of simultaneous continuous subgraph queries. By indexing query patterns in a trie structure to identify shared sub-structures, TRIC eliminates redundant work and achieves up to a 100x speedup over existing state-of-the-art systems.
Introduction
In modern data ecosystems, graphs are rarely static; they are dynamic streams of updates. Platforms like Facebook process millions of interactions per minute, while cybersecurity systems monitor network traffic for evolving attack signatures. To extract value from these streams, users deploy continuous subgraph queries, which alert the system the moment a specific pattern emerges.
However, finding these patterns (subgraph isomorphism) is an NP-complete problem. When thousands of users submit overlapping queries, processing each independently leads to massive computational redundancy. This paper addresses the Continuous Multi-Query Processing (CMQP) challenge: efficiently evaluating a vast query set against a high-velocity stream of graph updates.
Methodology: The TRIC Algorithm
The authors propose TRIC, which treats query patterns as a collection of shareable paths rather than isolated objects.
- Path Decomposition: Complex query graphs are broken down into a minimal set of "covering paths" that represent all edges and vertices.
- Trie-Based Indexing: These paths are stored in a trie (prefix tree). Queries sharing common initial sequences (e.g., "User A shares Post B") share nodes in the trie, naturally clustering them by structural similarity.
- Materialized Views & Incremental Joins: Each trie edge maintains a "materialized view" of matches. As new updates arrive, TRIC performs incremental joins rather than full re-evaluations.
- Pruning: If a partial match fails, TRIC immediately prunes that branch, skipping evaluation for all dependent queries.
- TRIC+: An enhanced version incorporating caching for intermediate join results to further minimize repetitive calculations.
Experimental Evaluation
The researchers tested TRIC across three diverse datasets:
- SNB (Social Network Benchmark): Simulates two years of social network evolution.
- NYC Taxi: Models 160 million taxi rides as location-based movement events.
- BioGRID: A biological dataset of protein interactions, serving as a stress test due to its low variety of edge/vertex types, which increases query relevance per update.
Key Insights
- Structural Overlap: Identifying a "backbone" shared by multiple queries allows the system to compute the shared component once and amortize the cost.
- Tries for Graphs: Adapting tries for graph paths enables rapid filtering to determine which queries are affected by a specific edge update.
- Incrementalism: Storing partial matches transforms a search problem into efficient, small-scale table joins.
Results and Scalability
TRIC and TRIC+ demonstrated significant performance gains:
- Performance: Outperformed baselines (including Neo4j and optimized Inverted Index approaches) by two orders of magnitude.
- Scalability: While baseline processing times grew exponentially with the number of queries (up to 5,000), TRIC’s performance remained relatively stable.
- Efficiency: TRIC+ consistently led in scenarios with high query overlap, highlighting the value of intermediate result caching.
Limitations and Future Directions
Current limitations include the handling of edge deletions, which requires more complex view maintenance. Future work aims to extend TRIC to property graphs with rich metadata and support more complex query types like shortest-path analysis. Additionally, managing the memory footprint of materialized views in extremely large-scale deployments remains an area for optimization.
Summary updated