## Abstract

In the distributed all-pairs shortest paths problem, every node in the weighted undirected distributed network (the CONGEST model) needs to know the distance from every other node using least number of communication rounds (typically called time complexity). The problem admits a (1 + o(1))-approximation Θ(n)-time algorithm and a nearly tight Ω(n) lower bound [D. Nanongkai, STOC'14, ACM, New York, 2014, pp. 565-573; C. Lenzen and B. Patt-Shamir, PODC'15, ACM, New York, 2015, pp. 153-162]. (Θ, Oand Ωhide polylogarithmic factors. Note that the lower bounds also hold even in the unweighted case and in the weighted case with polynomial approximation ratios (C. Lenzen and D. Peleg, PODC, ACM, New York, 2013, pp. 375-382; S. Holzer and R. Wattenofer, PODC, ACM, New York, 2012, pp. 355-364; D. Peleg, L. Roditty, and E. Tal, ICALP, Springer, Berlin, 2012, pp. 660-672; D. Nanongkai, STOC, ACM, New York, 2014, pp. 565-573-672). For the exact case, Elkin [STOC'17, ACM, New York, 2017, pp. 757-790] presented an O(n^{5/3} log^{2/3} n) time bound, which was later improved to O(n^{5/4}) [C.-C. Huang, D. Nanongkai, T. Saranurak, FOCS'17, IEEE Computer Society, Los Alamitos, CA, 2017, pp. 168-179]. It was shown that any superlinear lower bound (in n) requires a new technique [K. Censor-Hillel, S. Khoury, A. Paz, DISC'17, LIPIcs Leibniz Int. Proc. Inform., Vol. 91, Schloss-Dagstuhl, Wadern, Germany, 2017, 10], but otherwise it remained widely open whether there exists a O(n)-time algorithm for the exact case, which would match the best possible approximation algorithm. This paper resolves this question positively: we present a randomized (Las Vegas) O(n)-time algorithm, matching the lower bound up to polylogarithmic factors. Like the previous O(n^{5/4}) bound, our result works for directed graphs with zero (and even negative) edge weights. In addition to the improved running time, our algorithm works in a more general setting than that required by the previous O(n^{5/4}) bound; in our setting (i) the communication is only along edge directions (as opposed to bidirectional), and (ii) edge weights are arbitrary (as opposed to integers in {1, 2, . . ., poly(n)}). As far as we know, ours is the first o(n^{2}) algorithm that only requires unidirectional communication. For arbitrary weights, the previous state-of-the-art required O(n^{4/3}) time [U. Agarwal and V. Ramachandran, IPDPS 2019, IEEE Computer Society, Los Alamitos, CA, 2019, and SPAA 2020, ACM, New York, 2020, pp. 11-21]. Our algorithm is extremely simple and relies on a new technique called random filtered broadcast. Given any sets of nodes A, B ⊆ V and assuming that every b ∊ B knows all distances from nodes in A, and every node v ∊ V knows all distances from nodes in B, we want every v ∊ V to know DistThrough_{B}(a, v) = min_{b}∊_{B} dist(a, b) + dist(b, v) for every a ∊ A. Previous works typically solve this problem by broadcasting all knowledge of every b ∊ B, causing superlinear edge congestion and time. We show a randomized algorithm that can reduce edge congestions and thus solve this problem in O(n) expected time.

Original language | English (US) |
---|---|

Pages (from-to) | 112-127 |

Number of pages | 16 |

Journal | SIAM Journal on Computing |

Volume | 52 |

Issue number | 2 |

DOIs | |

State | Published - Apr 2023 |

## Keywords

- all-pairs shortest paths
- CONGEST
- distributed algorithms
- graph algorithms

## ASJC Scopus subject areas

- General Computer Science
- General Mathematics