Abstract
Determining if a node is reachable from another within a specific number of hops, known as the $k$-hop reachability problem, is a fundamental task in graph analysis. This paper introduces k-reach, an efficient indexing scheme that leverages vertex covers to answer these queries. By pre-computing reachability between nodes in a vertex cover backbone and employing a 2-bit distance encoding trick, k-reach achieves query speeds orders of magnitude faster than breadth-first search and outperforms existing reachability indexes. Experimental results on 15 real-world datasets demonstrate the scalability and efficiency of the proposed method.
1. Introduction
Reachability queries in large graphs typically ask if a path exists between two nodes. However, in many practical applications like social networks or biological systems, the distance of the path is as important as its existence. The $k$-hop reachability problem asks: Is node $t$ reachable from node $s$ within $k$ hops?
Existing approaches often fail this task. Classic reachability indexes collapse graphs into Directed Acyclic Graphs (DAGs), losing distance information. Shortest path indexes are too computationally expensive for simple reachability checks. Naive Breadth-First Search (BFS) suffers from "search explosion" when encountering high-degree "celebrity" nodes that cover large portions of the graph in few steps.
2. The k-Reach Indexing Framework
The core of the k-reach approach is the use of a Vertex Cover (VC) as a backbone for the index. A vertex cover is a set of vertices such that every edge in the graph is incident to at least one vertex in the set.
2.1 Vertex Cover Backbone
Since every edge touches the VC, any path with length $> 1$ must pass through at least one node in the VC. This property allows the index to summarize the connectivity of the entire graph by focusing on reachability between VC nodes.
By pre-computing distances between these backbone nodes, the system can quickly determine if a $k$-hop path exists. For example, in Figure 1, a path from $a$ to $j$ can be decomposed into a 1-hop check to the VC node $b$, a pre-computed distance from $b$ to $i$ in the index, and a final 1-hop check from $i$ to $j$.
2.2 The 2-Bit Trick and Index Construction
To minimize storage, k-reach does not store exact distances. Instead, it only needs to know if a path is $\le k$, $\le k-1$, or $\le k-2$. This allows the index to encode the weight of index edges using just 2 bits.
High-degree nodes are prioritized for inclusion in the VC, ensuring that the most "expensive" nodes to search at query time are already pre-computed. For massive graphs, an $h$-hop vertex cover (covering all paths of length $h$) can be used to further optimize index size.
3. Experimental Evaluation
The authors evaluated k-reach on 15 real-world datasets, including biological networks (e.g., Kegg, Human), citation networks (ArXiv), and social graphs (Gene Ontology). These datasets varied in size and diameter, providing a comprehensive testbed for reachability performance.
3.1 Performance Results
- Construction Speed: k-reach constructed its index 7.9x faster on average than PTree, a leading competitor.
- Query Efficiency: The index consistently outperformed state-of-the-art methods like GRAIL and PWAH. In many scenarios, it was orders of magnitude faster than standard BFS.
- Storage and Stability: Despite storing distance-sensitive information, the index size remained comparable to classic reachability indexes (typically < 4MB). Furthermore, query times remained stable regardless of the value of $k$.
4. Conclusion and Future Work
k-reach provides a robust solution for distance-constrained reachability queries by exploiting the "small world" properties of real-world graphs. While currently optimized for static graphs, future research will address the challenges of dynamic graph updates and scaling to modern "Big Data" volumes.
Summary updated