On Compact Representations of All-Pairs-Shortest-Path-Distance Matrices

  • Igor Nitto
  • Rossano Venturini
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5029)


Let G be an unweighted and undirected graph of n nodes, and let D be the n ×n matrix storing the All-Pairs-Shortest-Path distances in G. Since D contains integers in [n] ∪ + ∞, its plain storage takes n 2log(n + 1) bits. However, a simple counting argument shows that (n 2 − n)/2 bits are necessary to store D. In this paper we investigate the question of finding a succinct representation of D that requires O(n 2) bits of storage and still supports constant-time access to each of its entries. This is asymptotically optimal in the worst case, and far from the information-theoretic lower-bound by a multiplicative factor log2 3 ≃ 1.585. As a result O(1) bits per pairs of nodes in G are enough to retain constant-time access to their shortest-path distance. We achieve this result by reducing the storage of D to the succinct storage of labeled trees and ternary sequences, for which we properly adapt and orchestrate the use of known compressed data structures.


Compact Representation Unary Path Label Tree Wavelet Tree Succinct Representation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Barbay, J., He, M., Munro, J.I., Srinivasa Rao, S.: Succinct indexes for string, bynary relations and multi-labeled trees. In: Proc. 18th ACM-SIAM Symposium on Discrete Algorithms (SODA) (2007)Google Scholar
  2. 2.
    Bender, M.A., Farach-Colton, M.: The lca problem revisited. In: Gonnet, G.H., Viola, A. (eds.) LATIN 2000. LNCS, vol. 1776, pp. 88–94. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  3. 3.
    Benoit, D., Demaine, E., Munro, I., Raman, R., Raman, V., Rao, S.: Representing trees of higher degree. Algorithmica 43, 275–292 (2005)zbMATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Brodnik, A., Munro, I.: Membership in constant time and almost-minimum space. SIAM Journal on Computing 28(5), 1627–1640 (1999)zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Ferragina, P., Luccio, F., Manzini, G., Muthukrishnan, S.: Structuring labeled trees for optimal succinctness, and beyond. In: Proc. 46th IEEE Symposium on Foundations of Computer Science (FOCS), pp. 184–193 (2005)Google Scholar
  6. 6.
    Ferragina, P., Venturini, R.: A simple storage scheme for strings achieving entropy bounds. Theor. Comput. Sci. 372(1), 115–121 (2007)zbMATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Grossi, R., Gupta, A., Vitter, J.: High-order entropy-compressed text indexes. In: Proc. 14th ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 841–850 (2003)Google Scholar
  8. 8.
    Gupta, A., Hon, W.K., Shah, R., Vitter, J.S.: Dynamic rank/select dictionaries with applications to XML indexing. Technical Report Purdue University (2006)Google Scholar
  9. 9.
    Jacobson, G.: Space-efficient static trees and graphs. In: Proc. 30th IEEE Symposium on Foundations of Computer Science (FOCS), pp. 549–554 (1989)Google Scholar
  10. 10.
    Mäkinen, V., Navarro, G.: Rank and select revisited and extended. Theor. Comput. Sci. 387(3) (2007)Google Scholar
  11. 11.
    Jansson, J., Sadakane, K., Sung, W.K.: Ultra-succinct representation of ordered trees. In: Proc. 18th ACM-SIAM Symposium on Discrete Algorithms (SODA) (2007)Google Scholar
  12. 12.
    Munro, I., Raman, V.: Succinct representation of balanced parentheses, static trees and planar graphs. In: Proc. of the 38th IEEE Symposium on Foundations of Computer Science (FOCS), pp. 118–126 (1997)Google Scholar
  13. 13.
    Munro, I., Raman, V.: Succinct representation of balanced parentheses and static trees. SIAM J. Computing 31, 762–776 (2001)zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    Navarro, G., Mäkinen, V.: Compressed full-text indexes. ACM Comput. Surv. 39(1) (2007)Google Scholar
  15. 15.
    Working Group on Algorithms for Multidimensional Scaling. Algorithms for multidimensional scaling. DIMACS Web Page,
  16. 16.
    Pagh, R.: Low redundancy in static dictionaries with constant query time. SIAM Journal on Computing 31(2), 353–363 (2001)zbMATHCrossRefMathSciNetGoogle Scholar
  17. 17.
    Raman, R., Raman, V., Srinivasa Rao, S.: Succinct indexable dictionaries with applications to encoding k-ary trees and multisets. In: Proc. 13th ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 233–242 (2002)Google Scholar
  18. 18.
    Thorup, M.: Compact oracles for reachability and approximate distances in planar digraphs. J. ACM 51(6), 993–1024 (2004)zbMATHCrossRefMathSciNetGoogle Scholar
  19. 19.
    Thorup, M., Zwick, U.: Approximate distance oracles. In: STOC, pp. 183–192 (2001)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Igor Nitto
    • 1
  • Rossano Venturini
    • 1
  1. 1.Department of Computer ScienceUniversity of Pisa 

Personalised recommendations