arXiv:2610.24817cs.DSOct 2026

Manuscript Offprint

arXiv:2610.24817

Simplified and Faster Algorithms for the Directed Single/Dual-Failure Replacement Paths via Modulo-Layer Hitting Sets

Kaito Harada, Tatsuya Terao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We study the replacement paths problem in unweighted directed graphs with n vertices and m edges under one or two edge failures. We give simpler and faster algorithms for both settings. Both algorithms are based on a new technique, which we call modulo-layer hitting sets.

For the single-failure setting, we obtain a simple deterministic combinatorial algorithm running in O(mn)O(m\sqrt{n}) time, which is nearly optimal under the combinatorial Boolean Matrix Multiplication (BMM) conjecture. In addition to removing the logarithmic overhead of the deterministic O~(mn)\tilde{O}(m\sqrt{n})-time †^{\dagger} algorithm of Alon, Chechik, and Cohen [ICALP'19], our algorithm admits a much simpler implementation and analysis.

For the dual-failure setting, we obtain a randomized combinatorial algorithm running in O~(n3−1/4)\tilde{O}(n^{3-1/4}) time. This improves upon the previous O~(n3−1/18)\tilde{O}(n^{3-1/18})-time combinatorial algorithm of Chechik and Zhang [ICALP'24].

1 Introduction

In the replacement paths problem, we study how shortest paths change under edge failure. Specifically, given an unweighted directed graph G=(V,E)G = (V, E) with nn vertices and mm edges and two vertices s,t∈Vs, t \in V, the classical replacement paths (RP) problem asks to compute, for every edge e∈Ee \in E, a shortest ss-t path that avoids ee. Its natural two-failure extension, the dual-failure replacement paths (2-FRP) problem, asks to compute, for every pair of edges e,e′∈Ee, e' \in E, a shortest ss-t path that avoids both ee and e′e'.

The replacement paths problem has been extensively studied in the literature [MMG89, NPW01, HSB07, GL09, EPR10, WN10, Ber10, EN11, Wil11, RZ12, WY13, LL14, GW19, CN20, VWX22, CZ24a, MR24, CCD +^{+}25, NV26, HI26], motivated in part by its role as a basic model for fault-tolerant routing. In real-world networks, links may become unavailable due to failures, and it is desirable to quickly find alternative routes while preserving shortest-path guarantees. Replacement paths naturally capture this task by computing shortest routes that remain available after such failures. Beyond this networking motivation, replacement paths are also closely connected to several fundamental problems. In particular, replacement paths arise in computing Vickrey pricing for shortest paths in algorithmic mechanism design (see [NR99, HS01]). They are also closely related to the k shortest paths problem, which is itself a classical and well-studied problem [Law72, Epp98].

*The author ordering was randomized using https://www.aeaweb.org/journals/policies/random-author-order/generator.

†^{\dagger}The O~(⋅)\tilde{O}(\cdot) notation hides polylogarithmic factors, i.e., O~(f(n))=O(f(n)polylog(n))\tilde{O}(f(n)) = O(f(n)\text{polylog}(n)).

For the classical RP problem, the complexity differs significantly between undirected and directed graphs. Note that the output size of RP is only Θ(n)\Theta(n), since it suffices to consider failures of edges on a fixed shortest s−ts-t path. For undirected graphs, RP can be solved essentially as efficiently as single-source shortest paths [MMG89, LL14]. In contrast, RP on directed graphs appears substantially harder. For unweighted directed graphs, Roditty and Zwick [RZ12] gave a randomized combinatorial algorithm running in O~(mn)\tilde{O}(m\sqrt{n}) time. Obtaining a deterministic algorithm with a comparable running time remained open for more than a decade, until Alon, Chechik, and Cohen [ACC19] gave a deterministic O~(mn)\tilde{O}(m\sqrt{n})-time combinatorial algorithm. This running time is optimal up to no(1)n^{o(1)} factor among combinatorial algorithms, assuming the combinatorial Boolean Matrix Multiplication (BMM) conjecture [WW18]. For weighted directed graphs, RP is subcubic-equivalent to APSP [WW18]. ‡^{\ddagger} For algebraic algorithms, Vassilevska Williams [Wil11] gave a randomized O~(Mnω)\tilde{O}(Mn^{\omega})-time algorithm §^{\S} for edge weights in {−M,…,M}\{-M,\ldots,M\}.

Although the notion of a “combinatorial algorithm” is not formally defined, here and throughout we use the term informally to refer to algorithms that do not rely on fast matrix multiplication, such as Strassen-like methods. Such algorithms are often viewed as more efficient in practice, since fast matrix multiplication algorithms typically involve large hidden constants. We refer the reader to [AFK +^{+}24, Section 1.1] for a more extensive discussion of the motivations for seeking combinatorial algorithms, as well as for possible operational definitions of this notion.

The 2-FRP problem is considerably less understood. Vassilevska Williams, Woldeghebriel, and Xu [VWX22] gave a O~(n3)\tilde{O}(n^3)-time algorithm for weighted directed graphs and an n8/3−o(1)n^{8/3-o(1)} conditional lower bound for combinatorial algorithms on unweighted directed graphs. Chechik and Zhang [CZ24a] subsequently gave the first truly subcubic combinatorial algorithm for unweighted directed graphs, with running time O~(n3−1/18)\tilde{O}(n^{3-1/18}). For algebraic algorithms, they also obtained a O~(Mn2.8716)\tilde{O}(Mn^{2.8716})-time algorithm for edge weights in {−M,…,M}\{-M,\ldots,M\}. Thus, for combinatorial algorithms on unweighted directed graphs, there remains a substantial gap between the known upper and lower bounds. In contrast, for undirected graphs, Nogler and Vassilevska Williams [NV26] recently reduced 2-FRP to single source replacement paths, yielding a O~(mn+n2)\tilde{O}(m\sqrt{n}+n^2)-time algorithm for unweighted graphs. They left open whether a similar reduction, possibly in a weaker form, can be obtained for directed graphs. We note that, although 2-FRP considers all pairs of failed edges, its output size is only Θ(n2)\Theta(n^2); see Section 2.2 for details.

References (45)