Note: On compact representations of All-Pairs-Shortest-Path-Distance matrices

  • Authors:
  • Paolo Ferragina;Igor Nitto;Rossano Venturini

  • Affiliations:
  • Dipartimento di Informatica, University of Pisa, Italy;Dipartimento di Informatica, University of Pisa, Italy;Dipartimento di Informatica, University of Pisa, Italy

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2010

Quantified Score

Hi-index 5.23

Visualization

Abstract

Let G be an unweighted and undirected graph of n nodes, and let D be the nxn 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/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 log"23~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. This approach can be easily and optimally extended to graphs whose edge weights are positive integers bounded by a constant value.