All pairs shortest paths in undirected graphs with integer weights
A. Shoshan, Uri Zwick · 2003
We show that the all pairs shortest paths (APSP) problem for undirected graphs with integer edge weights taken from the range {1, 2, ..., M} can be solved using only a logarithmic number of distance products of matrices with elements in the range (1, 2, ..., M). As a result, we get an algorithm for the APSP problem in such graphs that runs in O~(Mn/sup /spl omega//) time, where n is the number of vertices in the input graph, M is the largest edge weight in the graph, and /spl omega/<2.376 is the exponent of matrix multiplication. This improves, and also simplifies, an O~(M/sup (/spl omega/+1)/2/n/sup /spl omega//) time algorithm of Galil and Margalit (1997).