Shortest Paths in Nearly Conservative Digraphs
We introduce the following notion: a digraph $D=(V,A)$ with arc weights $c: A\rightarrow \R$ is called nearly conservative if every negative cycle consists of two arcs. Computing shortest paths in nearly conservative digraphs is NP-hard, and even deciding whether a digraph is nearly conservative is coNP-complete. We show that the “All Pairs Shortest Path” problem is fixed parameter tractable with various parameters for nearly conservative digraphs. The results also apply for the special case of conservative mixed graphs.
💡 Research Summary
The paper introduces the notion of a “nearly conservative” weighted digraph: a directed graph D = (V, A) with a real‑valued weight function c is called nearly conservative if every negative cycle consists of exactly two arcs that are opposite to each other. This restriction lies between the classical conservative case (no negative cycles) and the general case where negative cycles may be arbitrarily long. The authors study the All‑Pairs Shortest Path (APSP) problem under this model.
First, they show that deciding whether a given digraph is nearly conservative is co‑NP‑complete, and that computing APSP when the graph is nearly conservative is NP‑hard. To obtain tractable algorithms they exploit structural properties of the graph. For each pair of vertices u ≠ v that are connected by arcs in both directions, they consider the sum c(uv)+c(vu). If this sum is negative, the unordered pair {u,v} becomes an edge of an auxiliary undirected graph F. A negative cycle of length three or more in D would correspond to a cycle in F; therefore, if F is not a forest, D cannot be nearly conservative. Hence the first preprocessing step is to build F and abort if it contains a cycle.
When F is a forest, each non‑trivial tree of F is called a “negative tree”. The number of such trees is denoted k₀. Further parameters are defined: k₁ is the maximum number of negative trees that appear in any strongly connected component of D, and k₂ is the maximum number of negative trees that appear in any weakly 2‑connected block of any strongly connected component. Clearly k₀ ≥ k₁ ≥ k₂.
The authors then transform D by adding “loose arcs”. For every special arc uv (i.e., both uv and vu exist and c(uv)+c(vu)<0) they add a new arc a from v to u with weight –c(uv). These added arcs are always lighter than the opposite original arc, and they are called loose arcs. The resulting digraph, still denoted D, has its arc set partitioned into special arcs A_s and ordinary arcs A_o (original plus loose arcs). The crucial observation (Lemma 1) is that D is nearly conservative if and only if there is no negative special‑simple closed walk (a closed walk that never repeats a special arc nor uses both directions of the same special pair).
Lemma 2 shows that any special‑simple s‑t walk can be replaced by an s‑t path that uses only arcs from the walk and is no longer. Lemma 3 proves that if a shortest s‑t path visits a negative tree T, then the sub‑path inside T must consist solely of the special arcs belonging to T; consequently, distances between vertices of the same tree equal the unique tree distance d_T(s,t). Lemma 4 gives a necessary and sufficient condition for extending a nearly conservative weight function from D \ A(T) to D: for every pair u,v in the vertex set of T we must have d′(u,v) ≥ –d_T(v,u), where d′ is the distance function in D \ A(T).
Based on these lemmas the authors design several algorithms.
-
Single spanning negative tree (k₀ = 1, V(T)=V).
They check the condition c(uv) ≥ –d_T(v,u) for every ordinary arc uv. If it holds, the graph is nearly conservative and the distance between any two vertices equals the tree distance d_T(s,t). Computing all tree distances can be done in O(n²) time by a simple bottom‑up traversal. -
Single non‑spanning negative tree (k₀ = 1, V(T)⊂V).
The graph is split into the tree part and the rest. Distances from vertices outside the tree to the tree are computed by dynamic programming, and distances inside the tree are given by d_T. The overall running time is O(n³). -
Arbitrary number of negative trees (parameter k₀).
The algorithm enumerates all subsets of the k₀ trees that are “active” (i.e., whose special arcs are used). For each subset it verifies the inequality of Lemma 4 for every tree in the subset, which takes O(n²) time. If the inequalities hold, distances are assembled from tree distances and ordinary distances (computed on the graph with the selected trees removed). The enumeration yields a factor 2^{k₀}, leading to an O(2^{k₀}·n⁴) algorithm. -
Refinement using k₂.
By observing that the constraints of Lemma 4 are local to weakly 2‑connected blocks, the authors replace the global enumeration by an enumeration over at most 2^{k₂} configurations, where k₂ is the maximum number of negative trees in any such block. This yields the main result: an O(2^{k₂}·n⁴) fixed‑parameter tractable algorithm for APSP in nearly conservative digraphs.
The paper also explains how to reconstruct the actual shortest paths, not only their lengths. After the distance computation, one can run a standard shortest‑path algorithm (e.g., Dijkstra for non‑negative ordinary arcs, Bellman‑Ford for the whole graph) on the modified digraph, while using pre‑computed tree paths for segments that lie inside negative trees.
Finally, the authors discuss the implications for mixed graphs (graphs containing both undirected edges and directed arcs). By replacing each undirected edge with a pair of opposite arcs of equal weight, a mixed graph becomes a digraph whose weight function is nearly conservative exactly when the original mixed graph is conservative. Consequently, all the FPT results transfer to the APSP problem on conservative mixed graphs, a setting previously known only to be NP‑hard in the general case.
In summary, the paper defines a new graph class that restricts negative cycles to two‑arc structures, proves that APSP remains hard in general, but becomes fixed‑parameter tractable when parameterized by structural measures of the negative‑tree forest. The work bridges a gap between classical conservative shortest‑path theory and the more challenging mixed‑graph setting, offering both theoretical insights and concrete algorithms with polynomial‑time performance for many practically relevant instances.
Comments & Academic Discussion
Loading comments...
Leave a Comment