Introduction
In the Semantic Web and Resource Description Framework (RDF) ecosystems, data is typically modeled as massive, edge-labeled graphs. A fundamental operation on these graphs is determining reachability: whether a path exists from node $x$ to node $y$. However, real-world applications often require more than simple connectivity; they demand Label-Order-Constrained Reachability (LOCR). For instance, in metabolic pathways, a query might ask if two compounds are connected via a specific sequence of enzymatic reactions in a precise order.
The Challenge of LOCR Queries
Traditional reachability indexing methods struggle with LOCR because the number of distinct paths in a graph with millions of nodes can be astronomical (e.g., $10^{25}$ paths in a DBLP dataset). Standard search algorithms like Depth-First Search (DFS) or Breadth-First Search (BFS) are often too slow for real-time queries on such a massive scale. BitPath addresses this by shifting the focus from indexing paths to indexing edges using compressed bit-vectors.
The BitPath Solution
BitPath introduces a lightweight indexing scheme and a divide-and-conquer algorithm to solve LOCR queries efficiently.
1. BitPath Indexing
The system constructs four primary index types to represent graph connectivity and label information:
- EID (Edge-to-ID): Maps every edge to a unique integer ID.
- N-SUCC-E (Successor Edges): A bit-vector for each node marking all edges reachable in its downstream subgraph.
- N-PRED-E (Predecessor Edges): A bit-vector for each node marking all edges that can reach it (upstream).
- EL-ID (Label Edges): A bit-vector for each unique label marking all edges carrying that label.
To maintain a manageable index size, these bit-vectors are compressed using run-length encoding (RLE), allowing bitwise operations to be performed directly on the compressed data.
2. Divide-and-Conquer Querying
When processing a query with a label sequence $(a, b, c, \dots)$, BitPath employs a greedy pruning strategy rather than a standard graph traversal:
- Intersection: It calculates the intersection of the source's successor edges, the destination's predecessor edges, and the edges associated with each label in the query.
- Selectivity: It identifies the "most selective" label—the one appearing on the fewest potential edges between the source and destination.
- Recursion: The query is split at this selective label into two smaller sub-queries, which are then evaluated recursively.
Experimental Evaluation
BitPath was evaluated on three massive datasets: UniProt (22.5M edges), SwetoDBLP (13.3M edges), and R-Mat (14.9M edges). The results demonstrate significant performance gains:
- Query Speed: BitPath is 50 to 1000 times faster than optimized DFS/BFS for positive queries. For negative queries (where no path exists), it is 1000 to 100,000 times faster, as bit-vector intersections often prove unreachability almost instantly.
- Scalability: The indexing technique successfully handled graphs with over 22 million edges, a scale previously infeasible for path-indexing methods.
- Storage Efficiency: Compressed bit-vectors reduced the index size by a factor of 7 to 1000 compared to naive methods.
Conclusion
BitPath demonstrates that treating reachability as a set intersection problem over compressed bit-vectors is highly effective for large-scale labeled graphs. By prioritizing label selectivity, the algorithm avoids unnecessary graph traversals. Future work will focus on extending this approach to handle complex regular expressions and path enumeration.
Summary updated