arXiv:2611.02154cs.DSNov 2026

Manuscript Offprint

arXiv:2611.02154

Faster Algorithms for Disjoint Paths in DAGs and Two Disjoint Shortest Paths

Yang Cao, Haoran Qi, Hanzhi Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

For kk vertex-disjoint paths with prescribed endpoints in a directed acyclic graph (DAG), the O(mnk−1)O(mn^{k-1})-time pebbling algorithm of Fortune, Hopcroft, and Wyllie [TCS 1980] has remained the fastest for every k≥3k \geq 3 for over four decades, even when the paths must be shortest. We break this bound for every k≥3k \geq 3 with randomized algorithms running in expected Ok(m+nk−3+ω+ε)O_k(m + n^{k-3+\omega+\varepsilon}) time for every ε>0\varepsilon > 0, where ω<2.372\omega < 2.372 is the matrix multiplication exponent; this is Ok(m+nk−0.62)O_k(m + n^{k-0.62}). For two disjoint shortest paths, we find the paths as fast as we detect them: in expected linear time on DAGs and on undirected graphs with polynomially bounded integer weights, and in expected O(min⁡{mn,nω+ε})O(\min\{mn, n^{\omega+\varepsilon}\}) time on directed graphs whose cycles have positive weight, which on dense graphs is o(mn)o(mn) even for detection. All algorithms evaluate a polynomial whose monomials are the solutions: a new first-collision circuit speeds up the evaluation in DAGs, and a correlated extraction step at cuts crossed once by every path finds a solution at the cost of a constant number of evaluations.

*yangcao@psu.edu. Pennsylvania State University. †Jilin University. ‡Tsinghua University.

1 Introduction

In the kk vertex-disjoint paths problem (kk-DP), the input is a directed graph with nn vertices and mm edges and kk terminal pairs (si,ti)(s_i, t_i), and the task is to connect every pair by a path so that the paths are pairwise vertex-disjoint. In the kk disjoint shortest paths problem (kk-DSP), every path must in addition be a shortest path between its terminals. Already for two pairs, kk-DP is NP-hard on general directed graphs [FHW80, Lemma 3]. On directed acyclic graphs (DAGs) it is polynomial for every fixed kk [FHW80, Theorem 3], by a pebbling game that extends the two-path algorithm of [PS78]: a configuration records the current vertex of every path, and a move advances the earliest path along an edge. There are O(nk)O(n^k) configurations and Ok(mnk−1)O_k(mn^{k-1}) moves, and this bound, stated explicitly in [BNRZ21, Lemma 34] and [Epp95, Theorems 2 and 4], has remained the fastest for every k≥3k \geq 3, for kk-DP as well as for weighted kk-DSP [AVW24, Section 7].

[AVW24, Section 7, Open Problem 3] asks for an O(nk+1−δ)O(n^{k+1-\delta})-time algorithm for kk-DSP in DAGs, for some fixed k≥3k \geq 3 and some constant δ>0\delta > 0. The question includes kk-DP: giving every edge the difference of the topological positions of its endpoints makes every path between fixed endpoints shortest [AVW24, Proposition 54].

For two pairs, the shortest-path constraint makes the problem tractable beyond DAGs, and the fastest algorithms are algebraic. The circuits of [AVW24] detect two disjoint shortest paths in O(m+n)O(m+n) time on positive-weight DAGs and undirected graphs, and [CKS26] detect them in O(mnlog⁡n)O(mn \log n) time on directed graphs whose cycles have positive weight. Finding the paths has remained a factor of about nn slower: the reporting algorithms of [AVW24] and of [BNRZ21], for unweighted undirected graphs, take O(mn)O(mn) time, and for directed graphs [BK17] gives a polynomial-time algorithm and [CKS26] report in O(mn2log⁡n)O(mn^2 \log n) time. [CKS26] ask whether reporting can match detection and whether directed 2-DSP admits an o(mn)o(mn)-time algorithm [CKS26, Section 6, Open Problems 1 and 2].

We improve both lines of work; Table 1 summarizes the bounds. All our algorithms evaluate a polynomial over a field of characteristic two whose monomials are the solutions, as the detectors of [AVW24] do, and two tools make this approach fast. The first is a circuit that evaluates the polynomial of kk disjoint paths in a DAG by subtracting intersecting tuples at their first collision (Theorem 4.1). The second is a correlated extraction step: at a cut that every path crosses at most once, a nonzero evaluation yields compatible pieces of one solution on both sides of the cut, at the cost of a constant number of evaluations (Lemma 3.4). The first tool breaks the pebbling bound in DAGs with superlinearly many edges; the second makes reporting as fast as detection in each of our models.