Min-2-DSP: Two Disjoint Shortest Paths
- Min-2-DSP is a graph problem that seeks two vertex-disjoint shortest paths while optimizing metrics like total weight or intersection based on distinct formulations.
- The approach employs algebraic techniques—including permanent and hafnian computations—alongside dynamic programming and geometric methods to achieve polynomial-time solutions in undirected settings.
- Advanced strategies leverage planarity, parallelism, and fixed-parameter methods to manage the complexity and nuances of directed graphs and varying disjointness constraints.
Searching arXiv for relevant papers on Min-2-DSP and closely related 2-DSP variants. Minimum 2-Disjoint Shortest Paths (Min-2-DSP) denotes a small family of closely related graph problems centered on two terminal pairs and shortest-path structure. In one common optimization form, the input is an undirected graph with nonnegative integer edge-weights and two disjoint ordered terminal pairs and ; the task is to find vertex-disjoint paths from and from minimizing (Hirai et al., 2016). In a second, equally common formulation, often written 2-DSP, each must itself be a shortest 0-1 path, and the algorithmic task is to decide, count, or construct a disjoint pair (Gottschau et al., 2018). More recent work also uses the name Min-2-DSP for minimizing 2 over shortest-path choices 3, 4 (Choudhary et al., 18 Sep 2025). The literature therefore combines algebraic reductions to matchings and cycle covers, dynamic programming on shortest-path substructures, planar Pfaffian techniques, geometric decompositions, and highly parallel modulo-5 computation.
1. Formulations and complexity landscape
The three main formulations differ in objective and in the role of shortestness. The total-length optimization form minimizes the sum of two disjoint path lengths for prescribed terminal pairs. The feasibility form requires each path to be individually shortest for its own pair and asks whether such a disjoint pair exists. The minimum-intersection form fixes shortestness first and minimizes the number of shared vertices.
| Formulation | Core requirement | Representative results |
|---|---|---|
| Total-length optimization | Minimize 6 over disjoint 7 | Randomized polynomial time in undirected graphs (Hirai et al., 2016) |
| 2-DSP feasibility | Each 8 is a shortest 9-0 path and 1 are disjoint | Polynomial time for 2, then for any fixed 3 in undirected graphs (Gottschau et al., 2018, Lochet, 2019) |
| Minimum intersection of shortest paths | Minimize 4 over shortest-path choices | 5 in directed graphs with positive edge weights; 6 in DAGs and undirected graphs (Choudhary et al., 18 Sep 2025) |
For the feasibility formulation, the 7-Disjoint Shortest Paths problem is NP-complete if 8 is part of the input, while the case 9 is polynomially solvable on undirected graphs with strictly positive lengths and remains polynomial when zero edge lengths are allowed (Gottschau et al., 2018). Lochet later showed that for any fixed 0, the undirected disjoint shortest paths problem admits a polynomial-time algorithm, and for any fixed 1 the algorithm extends to the case where each path connecting 2 has length at most 3 (Lochet, 2019). By contrast, directed generalizations are substantially harder: directed graphs with zero lengths already yield NP-hardness for 4, and in the total-length optimization setting the problem is NP-hard in directed graphs even for two pairs (Gottschau et al., 2018, Datta et al., 2021).
This multiplicity of definitions is a recurrent source of confusion. In some papers, “shortest two disjoint paths” means minimizing total length of a disjoint pair; in others it means disjointness among individually shortest paths; and in recent directed work “Min-2-DSP” may denote minimum intersection among shortest paths (Hirai et al., 2016, Choudhary et al., 18 Sep 2025). The distinction matters because the available techniques, tractability frontiers, and output guarantees differ sharply across the three settings.
2. Algebraic optimization via permanents, hafnians, and isolation
A central line of work treats the total-length optimization problem by encoding disjoint path packings as matchings. Björklund and Husfeldt gave the first randomized polynomial-time algorithm for Min-2-DSP by reducing the problem to computing a permanent modulo 5 and applying the Mulmuley–Vazirani–Vazirani Isolation Lemma. The framework uses Gallai’s reduction to transform two vertex-disjoint 6- and 7-paths into a perfect matching in an auxiliary graph 8 of size 9, assigns formal edge-weights 0, and reads the minimum total weight from the lowest-degree surviving monomial after random perturbation makes the optimum unique with probability at least 1 (Hirai et al., 2016).
Hirai and Namba generalized this framework from two terminal pairs to the shortest perfect 2-path packing problem. Their key replacement is hafnian computation modulo powers of two. For a symmetric 3 matrix 4, the hafnian is
5
so in the 6-7 adjacency case it counts perfect matchings. Using Gallai’s reduction, they build a symmetric matrix 8 with entries 9 on auxiliary edges, obtaining
0
which enumerates disjoint 1-path packings. Their theorem states that for fixed 2, hafnians modulo 3 of polynomial-entry symmetric matrices can be computed in polynomial time, with a recursion that lifts 4 computation—where the hafnian equals the Pfaffian—to higher powers of two (Hirai et al., 2016).
For Min-2-DSP, this yields a randomized polynomial-time algorithm with 5. One builds the Gallai graph 6, perturbs each original edge weight by a random offset 7, forms the symmetric matrix 8, computes 9, extracts the smallest exponent 0 with nonzero coefficient, and then recovers the actual optimal paths by deleting edges one by one and recomputing the minimum degree. The running time remains polynomial because 1 is constant. The same method extends to shortest perfect 2-path packing when 3 is constant, with running time 4, but ceases to be polynomial when 5 grows with 6; indeed, the general 7-path packing problem is NP-hard when 8 is unbounded (Hirai et al., 2016).
The significance of this line is twofold. First, it established that the total-length two-pair problem in undirected graphs is not only reducible to matching structure, but reducible in a way compatible with low-modulus algebra. Second, it exposed a precise limitation: the approach is effective when the number of terminal endpoints participating in the path-packing pattern is fixed, but not when that parameter scales.
3. Dynamic programming and structural algorithms for disjoint shortestness
For the feasibility version in undirected graphs with nonnegative lengths, Gottschau and coauthors developed a polynomial-time dynamic program that explicitly accommodates zero-length edges. The algorithm computes distance labels 9, defines shortest-path networks
0
orients each 1 from smaller to larger 2-value, leaves zero-length edges undirected, and replaces edges that lie in both 3 and 4 with opposite preferred directions by a gadget of four vertices and three arcs. In the resulting mixed graph 5, the weakly connected components of 6 are processed in nondecreasing order of 7, while a binary relation 8 is updated by
9
The total procedure is polynomial, with an implementation bound stated as 0 or better for 1 (Gottschau et al., 2018).
Lochet’s later fixed-2 algorithm introduced a different structural view. For 3, it begins by constructing a 2-shortest graph 4 via two BFS layerings from 5 and 6, discarding edges that do not connect consecutive levels in at least one layering. Each remaining edge is of colour 7, colour 8, or both; orienting each colour class yields acyclic digraphs 9 and 0. The bi-coloured edges decompose into connected components with strong contiguity and conflict properties: if 1 is a colour-2 path and 3 is a bi-coloured component, then 4 is a single contiguous subpath, and if two paths conflict on such a component then that component is the only place they can meet. The notion of a blind pair—neither path “sees” the other through an internal suffix intersection—permits a reduction to a product-state digraph. For 5, Lemma 12 gives partitions into at most 6 subpaths per original path, and the resulting state graph has size 7, yielding polynomial time (Lochet, 2019).
A third viewpoint, due to the geometric-lens framework, specializes to the unit-length undirected case and improves the 8 running time to 9. Each vertex 00 is mapped to
01
Shortest-path geometry is then studied through diamonds 02, coloured monotonicity, and the continuous drawings 03 of shortest paths. Two paths are handled by a three-case split: disjoint drawings, a non-integer crossing, or an integer-coordinate crossing. In the crossing cases, a constant number of “marble” vertices—04—divide the paths into monotone pieces lying in disjoint diamonds, and each guessed configuration reduces to disjoint paths in a DAG. The total cost is 05 on unit-length graphs (Bentert et al., 2020).
Taken together, these results show that the 2-DSP feasibility problem admits several radically different decompositions: mixed-graph component sweeps for nonnegative weights including zeros, shortest-layer product states for fixed 06, and coordinate geometry for unweighted graphs. The common theme is that shortestness severely constrains admissible path interactions, and those constraints can be turned into dynamic-programming state reductions.
4. Planar, Pfaffian, and fixed-parameter methods
Planarity enables a separate family of techniques based on perfect matching counting and topological structure. In cubic planar graphs with two terminal pairs, Björklund and Husfeldt showed that there are NC algorithms, uniform circuits of polynomial size and polylogarithmic depth, that compute the shortest two disjoint paths problem and also output the number of optimum solutions. The reduction replaces each nonterminal vertex by a triangle gadget, each terminal by a 3-star gadget, and for each even subset 07 forms a planar subgraph 08. With an indeterminate 09, external edges receive weight 10, internal gadget edges weight 11, and Kasteleyn orientations give skew-symmetric matrices 12 satisfying
13
An alternating-sum polynomial 14 cancels all unwanted pairings, and when 15 its degree is 16, so interpolation needs only five evaluations (Björklund et al., 2018).
A closely related determinant-based cancellation framework applies to planar graphs whose four terminals lie on a single face. There, three outerplanar pairings 17 are considered, and the signed combination
18
cancels all monomials not corresponding to the designated pairing 19. This yields a randomized or deterministic sequential algorithm of 20 time for the decision problem, 21 for counting, and NC22 algorithms for decision and counting; the search version lies in RNC23 after isolation is used to force uniqueness (Datta et al., 2018).
Recent planar parameterized work replaces determinant cancellation by topological enumeration. For planar disjoint shortest paths with positive edge weights, the input graph is embedded in the plane, all terminals lie on the outer face, and the algorithm constructs a geodesic Steiner tree spanning the terminals, computes an exhaustive set of maximal DAG-rings around that tree, proves 24 bounds on non-trivial crossings when 25, and enumerates only 26 homology classes before reducing each case to Schrijver’s polynomial-time Homology Feasibility problem. The general running time is 27, so substituting 28 yields polynomial time (Pilipczuk et al., 6 May 2025).
These planar results are not merely faster implementations of general methods. They rely on structure unavailable outside planar embeddings: Kasteleyn orientations, Pfaffian counting, dual cycles bounding rings, and homology classes of linkages. They also illustrate that terminal placement assumptions are consequential. Some algorithms require cubic planarity, others one-face placement, and the fixed-parameter result assumes all terminals on the outer face (Björklund et al., 2018, Datta et al., 2018, Pilipczuk et al., 6 May 2025).
5. Parallelism, linear-time detection, and directed-graph advances
Parallel complexity entered the subject through modulo-29 permanent computation. A 2021 result showed that for fixed 30, the permanent modulo 31 of a matrix of univariate integer polynomials lies in ParityL, hence in NC32. The paper reformulates shortest 2-disjoint paths as a special case of finding disjoint cycles through designated pattern edges. After adding dummy vertices 33, loops of weight 34, and opposite arcs labeled 35, a small family of pattern graphs 36 yields a polynomial
37
whose lowest nonzero monomial identifies the optimum after random isolation. This places the general undirected problem into a highly parallel randomized setting, and with advice into ParityL/poly (Datta et al., 2021).
A different algebraic development produced optimal linear-time detection for the 2-DSP feasibility problem on weighted undirected graphs and DAGs. The key object is a polynomial
38
where 39 ranges over pairs of shortest-path candidates in the shortest-path DAGs and 40 is the product of edge variables along both paths. Over a field of characteristic two, the polynomial is decomposed as 41, and a sequence of subpath-swapping involutions cancels all intersecting contributions in linear time. In DAGs, the cancellation is indexed by the first meeting vertex 42; in undirected graphs, intersecting pairs are partitioned into agreeing and disagreeing types. Random evaluation over 43 then yields an 44-time algorithm for detection, but not for search. The paper states that one can obtain a search algorithm in 45 time via Baur–Strassen and edge-peeling (Akmal et al., 2024).
Directed graphs remained more difficult. A 2025 result gave an 46-time algorithm for 2-DSP in weighted directed graphs without negative or zero weight cycles, improving a previously known 47 bound. The same paper defines Min-2-DSP as minimizing the number of vertex intersections between a shortest 48-49 path and a shortest 50-51 path, and gives the first efficient algorithms for that objective: 52 time in directed graphs with positive edge weights and 53 time in DAGs and undirected graphs, with 54 reporting in the directed case and 55 reporting in DAGs and undirected graphs once the optimum is known (Choudhary et al., 18 Sep 2025).
These results refine the algorithmic map in two directions. First, they show that parallelism is compatible with the older algebraic isolation-based methods. Second, they separate detection from construction: linear-time algebraic cancellation currently decides 2-DSP in undirected graphs and DAGs, but does not by itself yield equally fast path output (Datta et al., 2021, Akmal et al., 2024).
6. Related variants, boundary cases, and persistent limitations
Several nearby problems illuminate what is special about Min-2-DSP. The classical directed single-source, single-target version with two edge-disjoint paths of minimum total cost is solved by the Suurballe–Tarjan method in 56 time: one shortest-path tree is reweighted by reduced costs, residual tree edges are reversed at zero cost, a second Dijkstra run finds an augmenting walk, and cancellation of antiparallel pairs yields two minimum-cost disjoint paths. The same construction gives a single-source 2-multipath preserver with exactly 57 edges (Bilò et al., 2021). This problem is often used as a baseline, but it differs substantially from the two-pair disjoint shortest-path formulations.
Weights are another sharp boundary. In the undirected 2-DSP feasibility problem, zero edge lengths can be handled polynomially by the mixed-graph dynamic program described above, but in directed graphs zero lengths lead to NP-hardness for 58 (Gottschau et al., 2018). For a same-terminal-pair total-weight problem with conservative weights, negative edges already cause NP-hardness in general, yet if the negative-weight edges form only a constant number 59 of trees, an 60-time algorithm exists. That algorithm combines minimum-cost flow for separable solutions, recursion on the number of negative trees, and dynamic programming on a single negative tree (Schlotter, 2023).
Parameter dependence remains delicate. The fixed-61 undirected polynomial algorithm for disjoint shortest paths shows that constant 62 is tractable in full generality (Lochet, 2019), but the geometric-lens paper also proves that 63-DSP is W[1]-hard with respect to 64 (Bentert et al., 2020). Planarity changes that picture: planar disjoint shortest paths with positive edge weights becomes fixed-parameter tractable with running time 65 (Pilipczuk et al., 6 May 2025). On the algebraic optimization side, the hafnian framework for shortest perfect 66-path packing is polynomial only when 67 is fixed; when the terminal set is unbounded, the problem is NP-hard (Hirai et al., 2016).
A final recurrent distinction is between edge-disjointness and vertex-disjointness. Some papers work directly with edge-disjoint shortest paths, others with vertex-disjoint paths, and several note that a minor variant handles vertex-disjointness by splitting vertices in advance, or that edge-disjoint variants are completely analogous (Gottschau et al., 2018, Datta et al., 2021). This does not make the two notions interchangeable, but it explains why techniques developed for one model often migrate quickly to the other.
Across these variants, the subject has developed from isolated polynomial-time results for 68 into a landscape with exact algebraic counting, component-wise dynamic programming, planar NC computation, fixed-parameter topological methods, and linear-time randomized detection. The enduring difficulties are equally clear: directed graphs remain harder than undirected ones, search is harder than detection, and the notational label “Min-2-DSP” itself has not stabilized across the literature.