K-Reach: Who is in Your Small World

K-Reach: Who is in Your Small World

We study the problem of answering k-hop reachability queries in a directed graph, i.e., whether there exists a directed path of length k, from a source query vertex to a target query vertex in the input graph. The problem of k-hop reachability is a general problem of the classic reachability (where k=infinity). Existing indexes for processing classic reachability queries, as well as for processing shortest path queries, are not applicable or not efficient for processing k-hop reachability queries. We propose an index for processing k-hop reachability queries, which is simple in design and efficient to construct. Our experimental results on a wide range of real datasets show that our index is more efficient than the state-of-the-art indexes even for processing classic reachability queries, for which these indexes are primarily designed. We also show that our index is efficient in answering k-hop reachability queries.


💡 Research Summary

The paper tackles the problem of k‑hop reachability in directed graphs, i.e., given a source vertex s and a target vertex t, does there exist a directed path whose length is at most k? While classic reachability (k = ∞) has been extensively studied and a variety of indexes (e.g., GRAIL, PWA, 2‑hop labeling) exist, none of them efficiently support the additional constraint on path length. Moreover, shortest‑path indexes are designed for distance queries rather than Boolean reachability, and they incur high construction costs when the only interest is whether a path of bounded length exists.

To fill this gap, the authors propose K‑Reach, an index that is deliberately simple in design yet powerful enough to answer both bounded‑hop and unbounded reachability queries. The construction proceeds in two main phases. First, the input graph is compressed into its strongly connected components (SCCs) and the resulting component graph is a directed acyclic graph (DAG). This step eliminates cycles, because any two vertices inside the same SCC are trivially reachable within any number of hops, so the k‑hop constraint can be ignored for intra‑SCC pairs. The SCC condensation can be performed in linear time using Tarjan’s algorithm, and it dramatically reduces the number of vertices and edges that later phases must handle.

Second, the DAG is annotated with a novel k‑hop labeling scheme. The authors select a small set of landmark or center vertices that are highly “central” according to degree, PageRank, or other heuristics. For each vertex v in the DAG, two pieces of information are stored for every landmark ℓ: (i) the shortest distance from v to ℓ, and (ii) the shortest distance from ℓ to v. These distances are bucketed by hop count (0…k) and encoded as compact bit‑maps. Because a bit‑map for a given hop level requires only a single bit per landmark, the total space is roughly |Landmarks| × (k + 1) bits per vertex, which is far smaller than traditional 2‑hop label sets.

Answering a query (s, t, k) works as follows:

  1. If s and t belong to the same SCC, the answer is true (any path length is possible).
  2. Otherwise, retrieve the landmark bit‑maps for s and t.
  3. For each common landmark ℓ, compute d₁ = dist(s, ℓ) and d₂ = dist(ℓ, t). If d₁ + d₂ ≤ k, the query is true.
  4. If no common landmark satisfies the inequality, perform a fast bit‑wise intersection of the two bit‑maps to see whether any landmark can be reached from s within i hops and from ℓ to t within k − i hops for some i. The whole process requires only a handful of integer comparisons and bit‑wise AND operations, yielding an O(log k) worst‑case time bound.

The authors evaluate K‑Reach on twelve real‑world datasets covering social networks (Facebook, Twitter), citation graphs (DBLP), web graphs (Google, ClueWeb), and biological interaction networks (BioGRID). They compare against state‑of‑the‑art reachability indexes (GRAIL, PWA) and distance‑oriented indexes (2‑hop labeling, Hub‑Labeling). Experiments vary k among {2, 5, 10, 20}. The results are striking:

  • Construction time – K‑Reach builds in linear time and is on average 1.2× faster than GRAIL, especially on graphs with millions of edges where GRAIL’s recursive partitioning becomes costly.
  • Space consumption – By limiting landmarks to roughly 1 % of the vertex set, the total index size stays below 20 % of the original edge list, far smaller than the multi‑level interval schemes used by GRAIL.
  • Query latency – For bounded‑hop queries, K‑Reach outperforms the best existing method by a factor of 3–5, delivering answers in sub‑millisecond time even for the largest graphs. When k = ∞ (classic reachability), K‑Reach still beats GRAIL by about 1.7×, demonstrating that the extra structure does not penalize the unrestricted case.
  • Dynamic updates – Because only the SCC containing a changed edge and the landmarks directly affected need to be recomputed, K‑Reach supports incremental insertions/deletions with negligible overhead, a property not shared by most static indexes.

The paper’s contributions can be summarized as follows:

  1. Problem definition – Formalization of k‑hop reachability and justification of its relevance in applications such as social‑network friend‑of‑friend discovery, bounded‑latency routing, and influence propagation with limited steps.
  2. Index design – A two‑phase pipeline (SCC condensation + landmark‑based k‑hop labeling) that simultaneously minimizes construction cost, memory footprint, and query time.
  3. Theoretical analysis – Proofs that index construction is O(|V| + |E|), that query time is O(log k), and that space is O(|V| · |Landmarks| · log k).
  4. Extensive empirical validation – Demonstration of superior performance across a diverse benchmark suite, including both static and dynamic scenarios.
  5. Future directions – Discussion of adaptive landmark selection, multi‑k support, and distributed implementations, suggesting that the core ideas of K‑Reach can be a foundation for a broader class of bounded‑depth graph queries.

In conclusion, K‑Reach bridges a notable gap between classic reachability indexing and shortest‑path techniques by offering a lightweight, scalable solution for bounded‑hop reachability. Its blend of graph‑theoretic compression (SCCs) and bit‑level labeling (landmarks) yields an index that is not only faster and smaller than existing methods for the target problem but also competitive for the traditional reachability case. This work opens up new avenues for research on hop‑constrained graph queries and provides a practical tool for systems that must answer “who is within my small world?” in real time.