English

Semi-dynamic shortest-path tree algorithms for directed graphs with arbitrary weights

Data Structures and Algorithms 2019-03-06 v1

Abstract

Given a directed graph GG with arbitrary real-valued weights, the single source shortest-path problem (SSSP) asks for, given a source ss in GG, finding a shortest path from ss to each vertex vv in GG. A classical SSSP algorithm detects a negative cycle of GG or constructs a shortest-path tree (SPT) rooted at ss in O(mn)O(mn) time, where m,nm,n are the numbers of edges and vertices in GG respectively. In many practical applications, new constraints come from time to time and we need to update the SPT frequently. Given an SPT TT of GG, suppose the weight on a certain edge is modified. We show by rigorous proof that the well-known {\sf Ball-String} algorithm for positively weighted graphs can be adapted to solve the dynamic SPT problem for directed graphs with arbitrary weights. Let n0n_0 be the number of vertices that are affected (i.e., vertices that have different distances from ss or different parents in the input and output SPTs) and m0m_0 the number of edges incident to an affected vertex. The adapted algorithms terminate in O(m0+n0logn0)O(m_0+n_0 \log n_0) time, either detecting a negative cycle (only in the decremental case) or constructing a new SPT TT' for the updated graph. We show by an example that the output SPT TT' may have more than necessary edge changes to TT. To remedy this, we give a general method for transforming TT' into an SPT with minimal edge changes in time O(n0)O(n_0) provided that GG has no cycles with zero length.

Keywords

Cite

@article{arxiv.1903.01756,
  title  = {Semi-dynamic shortest-path tree algorithms for directed graphs with arbitrary weights},
  author = {Sanjiang Li and Yongming Li},
  journal= {arXiv preprint arXiv:1903.01756},
  year   = {2019}
}

Comments

27 pages, 3 figures

R2 v1 2026-06-23T07:58:32.326Z