Skip to main content
Log in

The exact distance to destination in undirected world

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

Abstract

Shortest distance queries are essential not only in graph analysis and graph mining tasks but also in database applications, when a large graph needs to be dealt with. Such shortest distance queries are frequently issued by end-users or requested as a subroutine in real applications. For intensive queries on large graphs, it is impractical to compute shortest distances on-line from scratch, and impractical to materialize all-pairs shortest distances. In the literature, 2-hop distance labeling is proposed to index the all-pairs shortest distances. It assigns distance labels to vertices in a large graph in a pre-computing step off-line and then answers shortest distance queries on-line by making use of such distance labels, which avoids exhaustively traversing the large graph when answering queries. However, the existing algorithms to generate 2-hop distance labels are not scalable to large graphs. Finding an optimal 2-hop distance labeling is NP-hard, and heuristic algorithms may generate large size distance labels while still needing to pre-compute all-pairs shortest paths. In this paper, we propose a multi-hop distance labeling approach, which generates a subset of the 2-hop distance labels as index off-line. We can compute the multi-hop distance labels efficiently by avoiding pre-computing all-pairs shortest paths. In addition, our multi-hop distance labeling is small in size to be stored. To answer a shortest distance query between two vertices, we first generate the query-specific small set of 2-hop distance labels for the two vertices based on our multi-hop distance labels stored and compute the shortest distance between the two vertices based on the 2-hop distance labels generated on-line. We conducted extensive performance studies on large real graphs and confirmed the efficiency of our multi-hop distance labeling scheme.

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.

Similar content being viewed by others

References

  1. Arnborg S., Corneil D.G., Proskurowski A.: Complexity of finding embeddings in a k-tree. SIAM J. Algebraic Discret Methods 8(2), 277–284 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  2. Barabasi A.-L., Albert R.: Emergence of scaling in random networks. Science. 286, 509–512 (1999)

    Article  MathSciNet  Google Scholar 

  3. Baswana S., Sen S.: Approximate distance oracles for unweighted graphs in expected o(n2) time. ACM Trans. Algorithms 2(4), 557–577 (2006)

    Article  MathSciNet  Google Scholar 

  4. Bodlaender H.L., Koster A.M.C.A: Treewidth computations I. Upper bounds. Inf. Comput. 208(3), 259–275 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  5. Chaudhuri S., Zaroliagis C.D.: Shortest paths in digraphs of small treewidth. Part I: Sequential algorithms. Algorithmica. 27(3), 212–226 (2000)

    MathSciNet  MATH  Google Scholar 

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

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

  8. Cormen T.H., Stein C., Rivest R.L., Leiserson C.E.: Introduction to Algorithms. McGraw-Hill Higher Education, USA (2001)

    MATH  Google Scholar 

  9. Das Sarma, A., Gollapudi, S., Najork, M., Panigrahy, R.: A sketch-based distance oracle for web-scale graphs. In: Proceedings of WSDM’10, pp. 401–410 (2010)

  10. Fan W., Ma S., Tang N., Wu Y., Wu Y.: Graph pattern matching: from intractable to polynomial time. PVLDB 3(1), 264–275 (2010)

    Google Scholar 

  11. Gavoille, C., Peleg, D., Perennes, S., Raz, R.: Distance labeling in graphs. In: Proceedings of SODA’01, pp. 210–219 (2001)

  12. Geisberger, R., Sanders, P., Schultes, D., Delling, D.: Contraction hierarchies: Faster and simpler hierarchical routing in road networks. In: WEA, pp. 319–333. (2008)

  13. Gou, G., Chirkova, R.: Efficient algorithms for exact ranked twig-pattern matching over graphs. In: Proceedings of SIGMOD’08, pp. 581–594 (2008)

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

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

  16. Katz, M., Katz, N.A., Peleg, D.: Distance labeling schemes for well-separated graph classes. In: Proceedings of STACS’00, pp. 516–528 (2000)

  17. Li, F., Cheng, D., Hadjieleftheriou, M., Kollios, G., Teng, S.-H.: On trip planning queries in spatial databases. In: Proceedings of SSTD’05, pp. 273–290 (2005)

  18. Liu, L., Wong, R.C.-W.: Finding shortest path on land surface. In: Proceedings of SIGMOD’11, pp. 433–444 (2011)

  19. Peleg D.: Proximity-preserving labeling schemes. J. Graph Theory 33(3), 167–176 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  20. Rahman S.A., Advani P., Schunk R., Schrader R., Schomburg D.: Metabolic pathway analysis web service (pathway hunter tool at cubic). Bioinformatics 21(7), 1189–1193 (2005)

    Article  Google Scholar 

  21. Rice M., Tsotras V.J.: Graph indexing of road networks for shortest path queries with label restrictions. PVLDB 4(2), 69–80 (2010)

    Google Scholar 

  22. Robertson N., Seymour P.D.: Graph minors. iii. Planar tree-width. J. Comb. Theory Ser. B 36(1), 49–64 (1984)

    Article  MathSciNet  MATH  Google Scholar 

  23. Sankaranarayanan J., Samet H.: Roads belong in databases. IEEE Data Eng. Bull. 33(2), 4–11 (2010)

    Google Scholar 

  24. Schenkel, R., Theobald, A., Weikum, G.: Hopi: an efficient connection index for complex xml document collections. In: Proceedings of EDBT’04, pp. 237–255 (2004)

  25. Schenkel, R., Theobald, A., Weikum, G.: Efficient creation and incremental maintenance of the hopi index for complex xml document collections. In: Proceedings of ICDE’05, pp. 360–371 (2005)

  26. Sommer, C., Verbin, E., Yu, W.: Distance oracles for sparse graphs. In: Proceedings of FOCS’09, pp. 703–712 (2009)

  27. Thorup, M., Zwick, U.: Approximate distance oracles. In: Proceedings of STOC’01, pp. 183–192 (2001)

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

  29. Wei, F.: TEDI: efficient shortest path query answering on graphs. In: Proceedings of SIGMOD’10, pp. 99–110 (2010)

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

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

    Google Scholar 

  32. Yu, J.X., Qin, L., Chang, L.: Keyword Search in Databases. Morgan & Claypool Publishers, San Francisco (2010)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jeffrey Xu Yu.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Chang, L., Yu, J.X., Qin, L. et al. The exact distance to destination in undirected world. The VLDB Journal 21, 869–888 (2012). https://doi.org/10.1007/s00778-012-0274-x

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00778-012-0274-x

Keywords

Navigation