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.
Similar content being viewed by others
References
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)
Barabasi A.-L., Albert R.: Emergence of scaling in random networks. Science. 286, 509–512 (1999)
Baswana S., Sen S.: Approximate distance oracles for unweighted graphs in expected o(n2) time. ACM Trans. Algorithms 2(4), 557–577 (2006)
Bodlaender H.L., Koster A.M.C.A: Treewidth computations I. Upper bounds. Inf. Comput. 208(3), 259–275 (2010)
Chaudhuri S., Zaroliagis C.D.: Shortest paths in digraphs of small treewidth. Part I: Sequential algorithms. Algorithmica. 27(3), 212–226 (2000)
Cheng, J., Yu, J.X.: On-line exact shortest distance query processing. In: Proceedings of EDBT’09, pp. 481–492 (2009)
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)
Cormen T.H., Stein C., Rivest R.L., Leiserson C.E.: Introduction to Algorithms. McGraw-Hill Higher Education, USA (2001)
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)
Fan W., Ma S., Tang N., Wu Y., Wu Y.: Graph pattern matching: from intractable to polynomial time. PVLDB 3(1), 264–275 (2010)
Gavoille, C., Peleg, D., Perennes, S., Raz, R.: Distance labeling in graphs. In: Proceedings of SODA’01, pp. 210–219 (2001)
Geisberger, R., Sanders, P., Schultes, D., Delling, D.: Contraction hierarchies: Faster and simpler hierarchical routing in road networks. In: WEA, pp. 319–333. (2008)
Gou, G., Chirkova, R.: Efficient algorithms for exact ranked twig-pattern matching over graphs. In: Proceedings of SIGMOD’08, pp. 581–594 (2008)
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)
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)
Katz, M., Katz, N.A., Peleg, D.: Distance labeling schemes for well-separated graph classes. In: Proceedings of STACS’00, pp. 516–528 (2000)
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)
Liu, L., Wong, R.C.-W.: Finding shortest path on land surface. In: Proceedings of SIGMOD’11, pp. 433–444 (2011)
Peleg D.: Proximity-preserving labeling schemes. J. Graph Theory 33(3), 167–176 (2000)
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)
Rice M., Tsotras V.J.: Graph indexing of road networks for shortest path queries with label restrictions. PVLDB 4(2), 69–80 (2010)
Robertson N., Seymour P.D.: Graph minors. iii. Planar tree-width. J. Comb. Theory Ser. B 36(1), 49–64 (1984)
Sankaranarayanan J., Samet H.: Roads belong in databases. IEEE Data Eng. Bull. 33(2), 4–11 (2010)
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)
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)
Sommer, C., Verbin, E., Yu, W.: Distance oracles for sparse graphs. In: Proceedings of FOCS’09, pp. 703–712 (2009)
Thorup, M., Zwick, U.: Approximate distance oracles. In: Proceedings of STOC’01, pp. 183–192 (2001)
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)
Wei, F.: TEDI: efficient shortest path query answering on graphs. In: Proceedings of SIGMOD’10, pp. 99–110 (2010)
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)
Yildirim H., Chaoji V., Zaki M.J.: Grail: scalable reachability index for large graphs. PVLDB 3(1), 276–284 (2010)
Yu, J.X., Qin, L., Chang, L.: Keyword Search in Databases. Morgan & Claypool Publishers, San Francisco (2010)
Author information
Authors and Affiliations
Corresponding author
Rights 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
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00778-012-0274-x