Papers
Topics
Authors
Recent
Search
2000 character limit reached

Warm-Starting All-Pairs Shortest Paths with Predictions

Published 1 Jul 2026 in cs.DS | (2607.00857v1)

Abstract: One of the three key hypotheses of fine-grained complexity asserts that computing All-Pairs Shortest Paths (APSP) requires cubic time, up to subpolynomial factors, in the worst case. We initiate the study of APSP in the paradigm of algorithms with predictions, also known as learning-augmented algorithms. We propose an APSP algorithm that takes as additional input a \emph{prediction} (e.g., given by a model learned from similar instances seen in the past) consisting of sets of vertices causing the shortest \emph{detour} for each pair of vertices. The algorithm runs in time O(n<sup>2.83</sup>+ηn)\mathcal{O}(n<sup>{2.83}</sup> + ηn), where ηη denotes the \emph{prediction error} defined as the number of pairs of vertices for which, informally speaking, the prediction was not sufficient to compute and certify optimality of the shortest path length. This is already subcubic when the prediction error is (polynomially) smaller than its maximum possible values n<sup>2n<sup>2, i.e., whenever the prediction is at least slightly better than terrible. We build on the co-nondeterministic algorithm for the Exact Triangle problem by Chan, Vassilevska Williams, and Xu (STOC 2023), essentially enabling this algorithm to detect mistakes in the nondeterministic certificate and recover from them. Our result constitutes the first necessary step towards designing learning-augmented algorithms for problems with known fine-grained lower bounds conditioned on the APSP Hypothesis.

Authors (2)

Summary

  • The paper introduces a learning-augmented APSP algorithm that achieves provable subcubic speedups by leveraging predictive certificates.
  • It employs a three-stage approach—distance estimation, co-nondeterministic verification, and error correction—with complexity improvements contingent on prediction quality.
  • Empirical results on dense latency graphs indicate significant practical speedups and robust correctness, validating the framework's applicability.

Learning-Augmented All-Pairs Shortest Paths: Framework, Algorithm, and Complexity

Introduction

The paper "Warm-Starting All-Pairs Shortest Paths with Predictions" (2607.00857) analyzes the All-Pairs Shortest Paths (APSP) problem under the relatively new paradigm of learning-augmented or prediction-empowered algorithms. Within the context of fine-grained complexity, where the APSP Hypothesis posits that truly subcubic algorithms for APSP are impossible (up to subpolynomial factors), this work seeks to assess whether problem instance similarity, harnessed through learned predictions, can offer rigorous, provable computational speedups without loss of solution correctness.

Distinct from prior work in the prediction-augmented algorithmics—where fastest known worst-case algorithms often already run in nearly linear or subquadratic time and where the complexity gap for correctness-robust improvement is marginal—the APSP problem is a canonical case with strongly established cubic lower bounds. Therefore, developing a framework in which meaningful subcubic speedups are possible contingent on the prediction quality, yet the algorithm remains unconditionally correct, constitutes a substantive theoretical and technical challenge.

Algorithmic Framework and Main Result

The authors’ framework extends co-nondeterministic algorithmic techniques to allow predictions (certificates) which encode, for each vertex pair, a small subset of "key detour vertices." These subsets are intended to capture the essential combinatorial structure underlying shortest paths. The central technical innovation is an APSP algorithm whose running time is O(n2.83+n⋅n(G,C,p))O(n^{2.83} + n\cdot n(G,C,p)), where n(G,C,p)n(G,C,p) is a prediction error quantifying the number of pairs for which the prediction is insufficient to certify correctness or directly compute the optimal distance.

Certificate Structure and Error Definition

Each prediction, or "certificate," is a matrix CC where C[u,v]C[u, v] is a set of qq vertices deemed as promising intermediates on a shortest path from uu to vv. Given CC, the algorithm constructs a distance estimate matrix by restricting relaxation operations to only those intermediary vertices prescribed by CC. The error n(G,C,p)n(G,C,p) is defined as the number of pairs where (a) the estimated distance does not match the true shortest path, or (b) the certificate does not provide enough information to verify optimality via co-nondeterministic verification (i.e., there exists a better detour vertex outside n(G,C,p)n(G,C,p)0 among the top-n(G,C,p)n(G,C,p)1 options).

Three-Stage Algorithm

The solution proceeds in three main algorithmic stages:

  1. Distance Matrix Computation: Compute an estimate matrix using only the predicted certificate. A Dijkstra-like approach ensures correctness with complexity n(G,C,p)n(G,C,p)2.
  2. Verification: For each pair, verify via a co-nondeterministic technique based on dominance product whether their estimated distance is certified optimal given the certificate. This uses fast matrix multiplication, leading to n(G,C,p)n(G,C,p)3 complexity for n(G,C,p)n(G,C,p)4-sized hitting sets of detour candidates.
  3. Error Correction: Iteratively fix entries found incorrect/unverified, selectively relaxing distances via a priority queue, exploiting the sparsity of error propagation. The total correction cost is n(G,C,p)n(G,C,p)5.

For parameters n(G,C,p)n(G,C,p)6 and n(G,C,p)n(G,C,p)7, the overall running time is n(G,C,p)n(G,C,p)8. Notably, when n(G,C,p)n(G,C,p)9, this is a strict improvement upon the best-known CC0 approaches.

Theoretical Implications and Hardness Results

This framework provides a concrete path for employing predictions in the context of problems with fine-grained lower bounds. The error notion introduced here does not rely on CC1-distance (as is common in prediction-augmented algorithmics) but rather on support—how many entries are outright incorrect or unverifiable. Correctness is guaranteed even if the prediction is arbitrary, i.e., the algorithm degrades gracefully to worst-case cubic when the prediction is poor.

The authors rigorously establish that the learning problem for constructing minimum-error certificates is NP-hard, even for average-case error minimization over a distribution of instances, and for nearly all natural certificate sizes. This is established via reduction from the clique problem, indicating that (barring breakthroughs in planted clique or densest subgraph approximations) there is a barrier to learned certificates matching optimal error in polynomial time.

Practical Considerations and Empirical Evaluation

Empirical validation on dense real-world latency graphs demonstrates that, for sequences of related instances, the actual number of erroneous/unverifiable pairs CC2 can be significantly subquadratic (CC3 or better). This suggests, for realistic applications such as dynamic network analysis, substantial practical speedups may be achieved when leveraging predictions from historical data.

The practical bottleneck arises from the use of fast matrix multiplication in co-nondeterministic verification, which though theoretically efficient, is often impractical in typical computing environments. Nevertheless, the ubiquity and optimization of matrix multiplication for deep learning offer optimism regarding future efficient implementations.

Open Problems and Future Directions

The paper identifies two principal avenues for further research:

  • Cleaner Error Measures: Can the error measure be further simplified or made less conservative, perhaps by more directly leveraging propagation properties of shortest paths, thus improving practical performance and extending applicability?
  • Learning Guarantees and Approximations: Given NP-hardness for exact certificate minimization, what bicriteria or approximate learning algorithms can produce certificates with prediction error within a small constant factor of optimal? Connections to hypergraph densest subgraph approximations suggest challenging theoretical directions, especially in high-dimensional or highly connected environments.

Another open direction is extending this approach to other fine-grained problems equivalent to APSP, potentially yielding a suite of learning-augmented algorithms for a broader class of fundamental combinatorial settings.

Conclusion

This paper initiates a principled approach to circumventing fine-grained complexity barriers for APSP by leveraging predictions derived from distributions over similar instances. The construction is rigorous, marries co-nondeterministic techniques with learning-augmented algorithmics, and yields the first subcubic, correctness-robust APSP algorithm whose running time smoothly interpolates between worst-case and near-optimal upon the prediction's quality. The result serves as a foundation both for further theoretical analysis of fine-grained parametrization by learning error, and for practical acceleration of graph algorithms in domains characterized by instance similarity.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.