TL;DR
This paper introduces BatchEnum, the first framework designed to process multiple hop-constrained $s$-$t$ simple path queries simultaneously rather than one by one. By identifying and caching common sub-structures across a batch of queries, the authors achieve up to a 7.7x speedup over state-of-the-art methods, making path enumeration feasible on billion-scale graphs.
What Problem Does This Paper Address?
Finding all "simple paths" (paths with no repeated vertices) between a source $s$ and a target $t$ within a maximum number of hops $k$ is a core task in graph analysis. It is used for fraud detection in e-commerce, identifying biological pathways, and completing knowledge graphs.
While efficient algorithms exist for a single query, real-world systems often face a "batch" of queries (e.g., thousands of transactions flagged for fraud at once). Existing methods treat these queries as isolated tasks, leading to massive redundant computation. For example, if two queries start near each other in a graph, they likely explore the same intermediate paths. The challenge lies in the fact that finding an optimal way to share this computation is NP-hard.
Methods
The authors propose BatchEnum, which shifts the focus from optimizing a single query to Multiple Query Optimization (MQO). The approach consists of three main stages:
- Query Clustering: Since it’s too expensive to compare every query against every other, the algorithm first groups queries that are likely to share paths. It uses a novel similarity metric based on "hop-constrained neighbors"—the set of vertices reachable within $k$ hops from the query's source and target.
- Common HC-s Path Query Detection: Within each cluster, the algorithm identifies "dominating" single-source path queries. It builds a Query Sharing Graph ($\Psi$), a directed acyclic graph that maps out which queries can reuse the results of others.
- Shared Enumeration with Caching: During the actual search, the results of common sub-queries are materialized and stored in a cache ($R$). When a new query encounters a vertex and hop-count that has already been processed, it simply retrieves the paths from the cache instead of re-exploring the graph.
This approach builds upon PathEnum, the previous state-of-the-art for single queries, but extends it with a two-phase detection and a shared execution engine.
Datasets
The authors evaluated their algorithms on 12 real-world datasets of varying sizes and densities:
- Small/Medium: Epinions, Slashdot, Baidu-baike, WikiTalk, BerkStan, Skitter.
- Large: Web-uk-2005, Rec-dating, Pokec, LiveJournal.
- Billion-scale: Twitter-2010 (1.46 Billion edges) and Friendster (1.81 Billion edges).
These datasets represent diverse domains, including social networks, web crawls, and communication logs.
Key Insights and Ideas
- The "Materialization Gap": A key observation (Fig 3c) showed that simply scanning pre-computed paths is nearly three orders of magnitude faster than computing them on the fly. This justifies the overhead of caching and sharing.
- Dominance Relationship: The paper introduces the concept of "HC-s path query dominance." If query A has a larger hop budget or a more "upstream" source than query B, the results of A can often fully contain the results needed for B.
- Lightweight Overhead: The authors designed the clustering and detection phases to be extremely fast (using BFS traversals), ensuring that the time saved by sharing computation far outweighs the time spent finding sharing opportunities.
Key Results
- Significant Speedup: BatchEnum achieved a maximum speedup of 7.7x and an average of 6.4x compared to sequential processing when query similarity was high (90%).
- Scalability: On the billion-edge Twitter and Friendster graphs, traditional baseline algorithms often failed or timed out as the query batch size grew. BatchEnum remained efficient and scalable.
- Efficiency vs. KSP: Compared to adapted $k$-shortest path (KSP) algorithms like DkSP and OnePass, BatchEnum was over two orders of magnitude faster because it utilizes pruning techniques specific to simple paths and hop constraints.
- Linear Improvement: As the similarity between queries in a batch increases, the execution time of BatchEnum reduces almost linearly.
Limitations and Future Work
- Memory Constraints: While caching paths saves time, it consumes memory. On extremely dense graphs with very large $k$ values, the number of paths could explode, potentially challenging the cache capacity.
- Static Graphs: The current work assumes a static graph. In environments like real-time financial transactions, the graph structure changes constantly. Extending batch processing to dynamic graphs is a logical next step.
- Unweighted Focus: The paper focuses on unweighted directed graphs. Future iterations could explore how to incorporate edge weights (e.g., transaction amounts or biological interaction strengths) into the batch processing framework.
Summary updated