# All-Pairs Shortest Paths in $O(n^2)$ time with high probability

Preprint · Yuval Peres, Dimitry Sotnikov, Benny Sudakov, Uri Zwick

- Archive id: arxiv:1105.3770
- Published: 2011-05-19
- arXiv: https://arxiv.org/abs/1105.3770
- Citations: 4
- Source URL: https://arxiv.org/abs/1105.3770
- PDF: https://arxiv.org/pdf/1105.3770
- Provenance: arxiv

## Abstract

We present an all-pairs shortest path algorithm whose running time on a complete directed graph on $n$ vertices whose edge weights are chosen independently and uniformly at random from $\[0,1\]$ is $O(n^2)$, in expectation and with high probability. This resolves a long standing open problem. The algorithm is a variant of the dynamic all-pairs shortest paths algorithm of Demetrescu and Italiano. The analysis relies on a proof that the number of \\emph{locally shortest paths} in such randomly weighted graphs is $O(n^2)$, in expectation and with high probability. We also present a dynamic version of the algorithm that recomputes all shortest paths after a random edge update in $O(\\log^{2}n)$ expected time.

_Abstract reproduced under CC0-1.0 (arXiv descriptive metadata)._

Topics: [Algorithms & Complexity Breakthroughs](https://space-kitty.com/topics/algorithms-complexity)

---
Space Kitty Archive · https://space-kitty.com · API: https://space-kitty.com/api/v1 · MCP: https://space-kitty.com/mcp · Premium: $0.20/request via x402 (Base Sepolia (testnet)). Metadata: arXiv (CC0), OpenAlex (CC0), Europe PMC (CC BY/CC0 works), ClinicalTrials.gov.
