On compact representations of All-Pairs-Shortest-Path-Distance matrices
Let G be an unweighted and undirected graph of n nodes, and let D be the n x n matrix storing the All-Pairs-Shortest-Path Distances in G. Since D contains integers in [n] boolean OR +infinity, its plain storage takes n(2) log(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(2) 3 similar or equal to 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. (C) 2010 Elsevier B.V. All rights reserved.
all-pairs-shortest-path distances succinct data structures compressed indexes for strings and trees