Skip to main content
Log in

Efficient processing of \(k\)-hop reachability queries

  • Special Issue Paper
  • Published:
The VLDB Journal Aims and scope Submit manuscript

Abstract

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=\infty \)). Existing indexes for processing classic reachability queries, as well as for processing shortest path distance queries, are not applicable or not efficient for processing \(k\)-hop reachability queries. We propose an efficient index for processing \(k\)-hop reachability queries. Our experimental results on a wide range of real datasets show that our method is efficient and scalable in terms of both index construction and query processing.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Notes

  1. Note that 3-hop is only the name of the index [27] for processing classic reachability queries, and does not imply 3-hop reachability.

References

  1. Abraham, I., Fiat, A., Goldberg, A.V., Werneck, R.F.F.: Highway dimension, shortest paths, and provably efficient algorithms. In SODA, pp. 782–793 (2010)

  2. Agrawal, R., Borgida, A., Jagadish, H.V.: Efficient management of transitive relationships in large data and knowledge bases. In SIGMOD Conference, pp. 253–262 (1989)

  3. Akiba, T., Iwata, Y., Yoshida, Y.: Fast exact shortest-path distance queries on large networks by pruned landmark labeling. To appear in SIGMOD Conference (2013)

  4. Boldi, P., Rosa, M., Vigna, S.: Hyperanf: approximating the neighbourhood function of very large graphs on a budget. In WWW, pp. 625–634 (2011)

  5. Bramandia, R., Choi, B., Ng, W.K.: On incremental maintenance of 2-hop labeling of graphs. In WWW, pp. 845–854 (2008)

  6. Chen, L., Gupta, A., Kurul, M.E.: Stack-based algorithms for pattern matching on DAGs. In VLDB, pp. 493–504 (2005)

  7. Chen, Y., Chen, Y.: An efficient algorithm for answering graph reachability queries. In ICDE, pp. 893–902 (2008)

  8. Chen, Y., Chen, Y.: Decomposing DAGs into spanning trees: A new way to compress transitive closures. In ICDE, pp. 1007–1018 (2011)

  9. Cheng, J., Ke, Y., Chu, S., Cheng, C.: Efficient processing of distance queries in large graphs: A vertex cover approach. In SIGMOD Conference, pp. 457–468 (2012)

  10. Cheng, J., Ke, Y., Fu, A.W.-C., Yu, J.X., Zhu, L.: Finding maximal cliques in massive networks by h*-graph. In SIGMOD Conference, pp. 447–458 (2010)

  11. Cheng, J., Shang, Z., Cheng, H., Wang, H., Yu, J.X.: K-reach: Who is in your small world. PVLDB 5(11), 1292–1303 (2012)

    Google Scholar 

  12. Cheng, J., Yu, J.X.: On-line exact shortest distance query processing. In EDBT, pp. 481–492 (2009)

  13. Cheng, J., Yu, J.X., Lin, X., Wang, H., Yu, P.S.: Fast computation of reachability labeling for large graphs. In EDBT, pp. 961–979 (2006)

  14. Cheng, J., Yu, J.X., Lin, X., Wang, H., Yu, P.S.: Fast computing reachability labelings for large graphs with high compression rate. In EDBT, pp. 193–204 (2008)

  15. Cheng, J., Yu, J.X., Tang, N.: Fast reachability query processing. In DASFAA, pp. 674–688 (2006)

  16. Cohen, E., Halperin, E., Kaplan, H., Zwick, U.: Reachability and distance queries via 2-hop labels. In SODA, pp. 937–946 (2002)

  17. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. The MIT Press,Cambridge, MA (2009)

    MATH  Google Scholar 

  18. Dorogovtsev, S.N., Mendes, J.F.F., Samukhin, A.N.: Structure of growing networks with preferential linking. Phys. Rev. Lett. 85(21), 4633–4636 (2000)

    Article  Google Scholar 

  19. Faloutsos, M., Faloutsos, P., Faloutsos, C.: On power-law relationships of the internet topology. In SIGCOMM, pp. 251–262 (1999)

  20. Feige, U.: A threshold of ln n for approximating set cover. J. ACM 45(4), 634–652 (1998)

    Article  MATH  MathSciNet  Google Scholar 

  21. Hochbaum, D.S.: Approximation Algorithms for NP-hard Problems. PWS Publishing Co., Boston, MA, USA (1997)

    Google Scholar 

  22. Jagadish, H.V.: A compression technique to materialize transitive closure. ACM Trans. Database Syst. 15(4), 558–598 (1990)

    Article  MathSciNet  Google Scholar 

  23. Jin, R., Hong, H., Wang, H., Ruan, N., Xiang, Y.: Computing label-constraint reachability in graph databases. In SIGMOD Conference, pp. 123–134 (2010)

  24. Jin, R., Liu, L., Ding, B., Wang, H.: Distance-constraint reachability computation in uncertain graphs. PVLDB 4(9), 551–562 (2011)

    Google Scholar 

  25. Jin, R., Ruan, N., Xiang, Y., Lee, V.E.: A highway-centric labeling approach for answering distance queries on large sparse graphs. In SIGMOD Conference, pp. 445–456 (2012)

  26. Jin, R., Ruan, N., Xiang, Y., Wang, H.: Path-tree: An efficient reachability indexing scheme for large directed graphs. ACM Trans. Database Syst. 36(1), 7 (2011)

    Article  Google Scholar 

  27. Jin, R., Xiang, Y., Ruan, N., Fuhry, D.: 3-hop: a high-compression indexing scheme for reachability query. In SIGMOD Conference, pp. 813–826 (2009)

  28. Jin, R., Xiang, Y., Ruan, N., Wang, H.: Efficiently answering reachability queries on very large directed graphs. In SIGMOD Conference, pp. 595–608 (2008)

  29. Newman, M.E.J.: The structure and function of complex networks. SIAM Rev. 45(2), 167–256 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  30. Simon, K.: An improved algorithm for transitive closure on acyclic digraphs. Theor. Comput. Sci. 58(1–3), 325–346 (1988)

    Article  MATH  Google Scholar 

  31. Stann, F., Heidemann, J.: Rmst: Reliable data transport in sensor networks. In 1st IEEE International Workshop on Sensor Net Protocols and Applications, pp. 102–112 (2003)

  32. Trißl, S., Leser, U.: Fast and practical indexing and querying of very large graphs. In SIGMOD Conference, pp. 845–856 (2007)

  33. van Schaik, S.J., de Moor, O.: A memory efficient reachability data structure through bit vector compression. In SIGMOD Conference, pp. 913–924 (2011)

  34. Wang, H., He, H., Yang, J., Yu, P.S., Yu, J.X.: Dual labeling: Answering graph reachability queries in constant time. In ICDE, p. 75 (2006)

  35. Wei, F.: TEDI: Efficient shortest path query answering on graphs. In SIGMOD Conference, pp. 99–110 (2010)

  36. Xiao, Y., Wu, W., Pei, J., Wang, W., He, Z.: Efficiently indexing shortest paths by exploiting symmetry in graphs. In EDBT, pp. 493–504 (2009)

  37. Yildirim, H., Chaoji, V., Zaki, M.J.: Grail: Scalable reachability index for large graphs. PVLDB 3(1), 276–284 (2010)

    Google Scholar 

  38. Zhu, L., Choi, B., He, B., Yu, J.X., Ng, W.K.: A uniform framework for ad-hoc indexes to answer reachability queries on large graphs. In DASFAA, pp. 138–152 (2009)

Download references

Acknowledgments

The authors would like to thank the reviewers for their constructive comments. This research is supported in part by CUHK direct grant 4055017, and grants from the Research Grants Council of the Hong Kong SAR (CUHK 411211 and CUHK 418512).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to James Cheng.

Appendix

Appendix

Algorithm 6 presents an extension of Algorithm 4 to return the exact shortest path distance from \(s\) to \(t\) if \(s\) can reach \(t\) in \(k\) hops. The main difference is that in Algorithm 4, we can terminate the process as soon as we find that \(s\) can reach \(t\) in \(k\) hops in \(D_1\) or \(D_2\) or \(D_3\), while in Algorithm 6 we need to continue with the intersection and join in order to find the minimum distance. However, the complexity of Algorithm 6 is the same as that of Algorithm 4 given in Sect. 5.5, since we give the worst case complexity in Sect. 5.5.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Cheng, J., Shang, Z., Cheng, H. et al. Efficient processing of \(k\)-hop reachability queries. The VLDB Journal 23, 227–252 (2014). https://doi.org/10.1007/s00778-013-0346-6

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00778-013-0346-6

Keywords

Navigation