Faster Fundamental Graph Algorithms via Learned Predictions

Justin Y Chen, Sandeep Silwal, Ali Vakilian, Fred Zhang · OpenReview

Abstract

We consider the question of speeding up classic graph algorithms with machine-learned predictions. In this model, algorithms are furnished with extra advice learned from past or similar instances. Given the additional information, we aim to improve upon the traditional worst-case run-time guarantees. Our contributions include a faster algorithm for minimum-weight bipartite matching via learned duals; an extension of this approach to the single-source shortest path (SSSP) problem with negative edge lengths, achieving almost linear runtime; and a general reduction-based framework for learning-based graph algorithms. Finally, we provide general learnability theorems showing that the predictions required by our algorithms can be efficiently learned in a PAC (Probably Approximately Correct) fashion.

Introduction

Traditional graph algorithms are designed for worst-case scenarios, assuming every problem instance is potentially the most difficult. However, in many real-world applications—such as logistics optimization or financial market analysis—algorithms are repeatedly applied to similar problem instances. This paper explores the field of learning-augmented algorithms, which leverages machine-learned "hints" to bypass pessimistic theoretical limits and achieve significant speedups on practical data.

Methodology

The core of our approach lies in the Primal-Dual framework. By predicting the optimal dual variables of a problem, we can significantly simplify the search for the primal solution.

Learned Duals and the $L_0$ Advantage

For minimum-weight bipartite matching, we utilize ML to predict optimal dual variables. A key theoretical insight is that the algorithm's runtime depends on the $L_0$ norm of the prediction error (the number of incorrect predictions) rather than the magnitude ($L_1$ norm). This shift allows for tighter runtime bounds: if most predictions are correct, a single call to a maximum cardinality matching algorithm can resolve the remaining discrepancies.

Rounding and Reductions

For SSSP with negative edge weights, we introduce a novel rounding algorithm that transforms potentially infeasible ML predictions into valid "warm starts" for Dijkstra’s algorithm. Furthermore, we provide a general reduction framework, demonstrating how complex problems like min-cost 0-1 flow and degree-constrained subgraphs can be reduced to the optimized matching and shortest-path problems we have developed.

Empirical Evaluation

We evaluated our algorithms using a case study of Foreign Exchange (FX) Markets, where nodes represent countries and edges represent exchange rates. The task was to find optimal currency conversion sequences, modeled as a shortest-path problem on graphs with approximately 500 vertices and 50,000 edges.

Comparison of iterations required for classic vs. learned algorithms over time.

As shown in Figure 1, the learning-augmented approach (both batch and online versions) consistently required significantly fewer iterations than the classical Hungarian algorithm. In many instances, we observed an order-of-magnitude reduction in computational effort.

Saved Hungarian iterations as a function of excess dual objective.

Figure 2 illustrates the relationship between prediction quality and performance. While higher accuracy (lower excess dual objective) generally leads to more saved iterations, the algorithm remains robust and provides substantial savings even when predictions are not perfect.

Conclusion and Future Work

Our work demonstrates that learned duals can provide provable and empirical speedups for fundamental graph problems. By bridging the gap between heuristic machine learning and rigorous algorithm design, we achieve near-linear runtimes for problems that previously required more intensive computation.

Future research will focus on handling dynamic graph topologies where nodes and edges change over time, and integrating these algorithms into standard machine learning pipelines as differentiable layers. While rounding overhead remains a potential bottleneck for very poor predictions, the PAC learnability of these dual variables suggests that reliable "warm starts" are practically achievable for many real-world distributions.

Summary updated

BibTeX
@misc{chen2022faster,
  author = {Justin Y Chen and Sandeep Silwal and Ali Vakilian and Fred Zhang},
  title = {{Faster Fundamental Graph Algorithms via Learned Predictions}},
  year = {2022},
  eprint = {2204.12055},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.12055},
}
Figure