Let G = (V, E) be an unweighted undirected graph on |V | = n vertices and |E| = m edges. Let δ(u, v) denote the distance between vertices u, v ∈ V . An algorithm is said to compute all-pairs t-approximate shortest-paths/distances, for some t ≥ 1, if for each pair of vertices u, v ∈ V , the path/distance reported by the algorithm is not longer/greater than t · δ (u, v). This paper presents two extremely simple randomized algorithms for computing all-pairs nearly 2-approximate distances. The first algorithm requires expected O(m 2/3 n log n + n 2 ) time, and for any u, v ∈ V reports distance no greater than 2δ(u, v) + 1. Our second algorithm requires expected O(n 2 log 3/2 n) time, and for any u, v ∈ V reports distance bounded by 2δ(u, v) + 3.
Baswana et al. REF propose a randomized algorithm for computing all-pairs nearly 2-approximate distances with time complexity of O(n 2 log 3/2 n).
All-Pairs Nearly 2-Approximate Shortest Paths in O ( n 2 polylog n ) Time ∗
Electronic Colloquium on Computational Complexity (ECCC)
Mathematics Computer Science