Simple O(n²) Algorithm Delivers First Optimal APSP Solution for Sparse Graphs

IgorCarron · x · 2026-12-05

Researchers Ken-ichi Kawarabayashi and Yu Kohara present the Report-and-Run (R&R) algorithm on arXiv: a simple deterministic algorithm in the comparison-addition model that either detects a negative-weight cycle or solves All-Pairs Shortest Paths in O(n²) time on n-vertex, O(n)-edge directed graphs with arbitrary real weights — matching the Ω(n²) output-size lower bound and giving the first optimal sparse APSP algorithm in this model.

Variants include O(nk)-time k-nearest-vertex computation (via lazy initialization or hash tables) for bounded-degree graphs with non-negative weights, plus blocking and edge-caching heuristics that cut comparisons and additions versus Dijkstra on sparse random graphs.

Original post →

More from Research

Research channel →