← All papers
First page of Directed $k$ Disjoint Shortest Paths Is Polynomial for Every Fixed $k$

Directed $k$ Disjoint Shortest Paths Is Polynomial for Every Fixed $k$

Saeed Amiri

cs.DS Nov 26, 2026 · v1 cs.DM
All main theorems, including the n^{O(k^2)} algorithm's correctness and table-work bound, are formalized in Lean 4 with Mathlib, written with AI assistance.
The $k$ disjoint shortest paths problem ($k$-DSPP) asks for pairwise disjoint paths between $k$ terminal pairs, each a shortest path between its own terminals; the paths are required to be vertex-disjoint or, in the edge-disjoint version, edge-disjoint. Eilam-Tzoreff introduced the problem in 1998 and left its complexity for a fixed number of pairs open. For general graphs with arbitrary positive lengths, the case of three or more pairs remained open for many years. Earlier algorithms for general undirected graphs with unit lengths had running-time exponents doubly exponential or factorial in $k$. We show that for every fixed $k$ both versions of $k$-DSPP are solvable in time $n^{O(k^2)}$ on directed graphs with arbitrary positive lengths, and hence on undirected graphs. The dependence of the exponent on $k$ cannot be removed unless FPT = W[1].

The k disjoint shortest paths problem asks for pairwise disjoint paths between k terminal pairs, each individually a shortest path. Its complexity for fixed k at least 3 on general graphs with arbitrary positive lengths, and for directed graphs, had remained open.

Potentials map each vertex to a point in (k-1)-dimensional space, where each path moves monotonically forward in its own set of directions. The space is cut recursively into boxes, as in a kd-tree, so that each cut is crossed only a few times by the solution paths. A dynamic program over the tree of boxes then combines partial solutions, using pebbling inside single point classes. The results were formalized in Lean 4 with Mathlib, and the ideas were found with AI-agent assistance.

Vertex- and edge-disjoint k-DSPP are solvable in time n^{O(k^2)} on directed graphs with positive lengths, and therefore also on undirected graphs. Removing the dependence of the exponent on k would imply FPT = W[1]. The Lean formalization has no unproved statements; preprocessing time is not formalized.