34,798 research outputs found

    A Sidetrack-Based Algorithm for Finding the k Shortest Simple Paths in a Directed Graph

    Get PDF
    We present an algorithm for the k shortest simple path problem on weighted directed graphs (kSSP) that is based on Eppstein's algorithm for a similar problem in which paths are allowed to contain cycles. In contrast to most other algorithms for kSSP, ours is not based on Yen's algorithm and does not solve replacement path problems. Its worst-case running time is on par with state-of-the-art algorithms for kSSP. Using our algorithm, one may find O(m) simple paths with a single shortest path tree computation and O(n + m) additional time per path in well-behaved cases, where n is the number of nodes and m is the number of edges. Our computational results show that on random graphs and large road networks, these well-behaved cases are quite common and our algorithm is faster than existing algorithms by an order of magnitude. Further, the running time is far better predictable due to very small dispersion

    Deterministic Combinatorial Replacement Paths and Distance Sensitivity Oracles

    Get PDF
    In this work we derandomize two central results in graph algorithms, replacement paths and distance sensitivity oracles (DSOs) matching in both cases the running time of the randomized algorithms. For the replacement paths problem, let G = (V,E) be a directed unweighted graph with n vertices and m edges and let P be a shortest path from s to t in G. The replacement paths problem is to find for every edge e in P the shortest path from s to t avoiding e. Roditty and Zwick [ICALP 2005] obtained a randomized algorithm with running time of O~(m sqrt{n}). Here we provide the first deterministic algorithm for this problem, with the same O~(m sqrt{n}) time. Due to matching conditional lower bounds of Williams et al. [FOCS 2010], our deterministic combinatorial algorithm for the replacement paths problem is optimal up to polylogarithmic factors (unless the long standing bound of O~(mn) for the combinatorial boolean matrix multiplication can be improved). This also implies a deterministic algorithm for the second simple shortest path problem in O~(m sqrt{n}) time, and a deterministic algorithm for the k-simple shortest paths problem in O~(k m sqrt{n}) time (for any integer constant k > 0). For the problem of distance sensitivity oracles, let G = (V,E) be a directed graph with real-edge weights. An f-Sensitivity Distance Oracle (f-DSO) gets as input the graph G=(V,E) and a parameter f, preprocesses it into a data-structure, such that given a query (s,t,F) with s,t in V and F subseteq E cup V, |F| <=f being a set of at most f edges or vertices (failures), the query algorithm efficiently computes the distance from s to t in the graph G F (i.e., the distance from s to t in the graph G after removing from it the failing edges and vertices F). For weighted graphs with real edge weights, Weimann and Yuster [FOCS 2010] presented several randomized f-DSOs. In particular, they presented a combinatorial f-DSO with O~(mn^{4-alpha}) preprocessing time and subquadratic O~(n^{2-2(1-alpha)/f}) query time, giving a tradeoff between preprocessing and query time for every value of 0 < alpha < 1. We derandomize this result and present a combinatorial deterministic f-DSO with the same asymptotic preprocessing and query time

    Simplifying and Unifying Replacement Paths Algorithms in Weighted Directed Graphs

    Get PDF
    In the replacement paths (RP) problem we are given a graph G and a shortest path P between two nodes s and t . The goal is to find for every edge e ? P, a shortest path from s to t that avoids e. The first result of this paper is a simple reduction from the RP problem to the problem of computing shortest cycles for all nodes on a shortest path. Using this simple reduction we unify and extremely simplify two state of the art solutions for two different well-studied variants of the RP problem. In the first variant (algebraic) we show that by using at most n queries to the Yuster-Zwick distance oracle [FOCS 2005], one can solve the the RP problem for a given directed graph with integer edge weights in the range [-M,M] in O?(M n^?) time . This improves the running time of the state of the art algorithm of Vassilevska Williams [SODA 2011] by a factor of log?n. In the second variant (planar) we show that by using the algorithm of Klein for the multiple-source shortest paths problem (MSSP) [SODA 2005] one can solve the RP problem for directed planar graph with non negative edge weights in O (n log n) time. This matches the state of the art algorithm of Wulff-Nilsen [SODA 2010], but with arguably much simpler algorithm and analysis

    Replacement Paths via Row Minima of Concise Matrices

    Full text link
    Matrix MM is {\em kk-concise} if the finite entries of each column of MM consist of kk or less intervals of identical numbers. We give an O(n+m)O(n+m)-time algorithm to compute the row minima of any O(1)O(1)-concise n×mn\times m matrix. Our algorithm yields the first O(n+m)O(n+m)-time reductions from the replacement-paths problem on an nn-node mm-edge undirected graph (respectively, directed acyclic graph) to the single-source shortest-paths problem on an O(n)O(n)-node O(m)O(m)-edge undirected graph (respectively, directed acyclic graph). That is, we prove that the replacement-paths problem is no harder than the single-source shortest-paths problem on undirected graphs and directed acyclic graphs. Moreover, our linear-time reductions lead to the first O(n+m)O(n+m)-time algorithms for the replacement-paths problem on the following classes of nn-node mm-edge graphs (1) undirected graphs in the word-RAM model of computation, (2) undirected planar graphs, (3) undirected minor-closed graphs, and (4) directed acyclic graphs.Comment: 23 pages, 1 table, 9 figures, accepted to SIAM Journal on Discrete Mathematic

    Efficiently listing bounded length st-paths

    Full text link
    The problem of listing the KK shortest simple (loopless) stst-paths in a graph has been studied since the early 1960s. For a non-negatively weighted graph with nn vertices and mm edges, the most efficient solution is an O(K(mn+n2log⁥n))O(K(mn + n^2 \log n)) algorithm for directed graphs by Yen and Lawler [Management Science, 1971 and 1972], and an O(K(m+nlog⁥n))O(K(m+n \log n)) algorithm for the undirected version by Katoh et al. [Networks, 1982], both using O(Kn+m)O(Kn + m) space. In this work, we consider a different parameterization for this problem: instead of bounding the number of stst-paths output, we bound their length. For the bounded length parameterization, we propose new non-trivial algorithms matching the time complexity of the classic algorithms but using only O(m+n)O(m+n) space. Moreover, we provide a unified framework such that the solutions to both parameterizations -- the classic KK-shortest and the new length-bounded paths -- can be seen as two different traversals of a same tree, a Dijkstra-like and a DFS-like traversal, respectively.Comment: 12 pages, accepted to IWOCA 201

    Sparse Fault-Tolerant BFS Trees

    Full text link
    This paper addresses the problem of designing a sparse {\em fault-tolerant} BFS tree, or {\em FT-BFS tree} for short, namely, a sparse subgraph TT of the given network GG such that subsequent to the failure of a single edge or vertex, the surviving part Tâ€ČT' of TT still contains a BFS spanning tree for (the surviving part of) GG. Our main results are as follows. We present an algorithm that for every nn-vertex graph GG and source node ss constructs a (single edge failure) FT-BFS tree rooted at ss with O(n \cdot \min\{\Depth(s), \sqrt{n}\}) edges, where \Depth(s) is the depth of the BFS tree rooted at ss. This result is complemented by a matching lower bound, showing that there exist nn-vertex graphs with a source node ss for which any edge (or vertex) FT-BFS tree rooted at ss has Ω(n3/2)\Omega(n^{3/2}) edges. We then consider {\em fault-tolerant multi-source BFS trees}, or {\em FT-MBFS trees} for short, aiming to provide (following a failure) a BFS tree rooted at each source s∈Ss\in S for some subset of sources S⊆VS\subseteq V. Again, tight bounds are provided, showing that there exists a poly-time algorithm that for every nn-vertex graph and source set S⊆VS \subseteq V of size σ\sigma constructs a (single failure) FT-MBFS tree T∗(S)T^*(S) from each source si∈Ss_i \in S, with O(σ⋅n3/2)O(\sqrt{\sigma} \cdot n^{3/2}) edges, and on the other hand there exist nn-vertex graphs with source sets S⊆VS \subseteq V of cardinality σ\sigma, on which any FT-MBFS tree from SS has Ω(σ⋅n3/2)\Omega(\sqrt{\sigma}\cdot n^{3/2}) edges. Finally, we propose an O(log⁥n)O(\log n) approximation algorithm for constructing FT-BFS and FT-MBFS structures. The latter is complemented by a hardness result stating that there exists no Ω(log⁥n)\Omega(\log n) approximation algorithm for these problems under standard complexity assumptions
    • 

    corecore