skip to main content
research-article

Replacement paths and k simple shortest paths in unweighted directed graphs

Published: 04 October 2012 Publication History

Abstract

Let G = (V,E) be a directed graph and let P be a shortest path from s to t in G. In the replacement paths problem, we are required to find, for every edge e on P, a shortest path from s to t in G that avoids e. The only known algorithm for solving the problem, even for unweighted directed graphs, is the trivial algorithm in which each edge on the path, in its turn, is excluded from the graph and a shortest paths tree is computed from s. The running time is O(mn + n2 log n).
The replacement paths problem is strongly motivated by two different applications:
(1) The fastest algorithm to compute the k simple shortest paths between s and t in directed graphs [Yen 1971; Lawler 1972] computes the replacement paths between s and t. Its running time is Õ(mnk).
(2) The replacement paths problem is used to compute the Vickrey pricing of edges in a distributed network. It was raised as an open problem by Nisan and Ronen [2001] whether it is possible to compute the Vickrey pricing faster than n computations of a shortest paths tree.
In this article we present the first nontrivial algorithm for computing replacement paths in unweighted directed graphs (and in graphs with small integer weights). Our algorithm is Monte-Carlo and its running time is Õ(mn). This result immediately improves the running time of the two applications mentioned above in a factor of √n.
We also show how to reduce the problem of computing k simple shortest paths between s and t to O(k) computations of a second simple shortest path from s to t each time in a different subgraph of G. The importance of this result is that computing a second simple shortest path may turn out to be an easier problem than computing the replacement paths, thus, we can focus our efforts to improve the k simple shortest paths algorithm in obtaining a faster algorithm for the second shortest path problem.

References

[1]
Baswana, S., Hariharan, R., and Sen, S. 2002. Improved decremental algorithms for transitive closure and all-pairs shortest paths. In Proceedings of the 34th Symposium on Theory of Computing. 117--123.
[2]
Baswana, S., Hariharan, R., and Sen, S. 2003. Maintaining all-pairs approximate shortest paths under deletion of edges. In Proceedings of the 14th Symposium on Discrete Algorithms. 394--403.
[3]
Bernstein, A. 2010. A nearly optimal algorithm for approximating replacement paths and k shortest simple paths in general graphs. In Proceedings of the 21st Symposium on Discrete Algorithms.
[4]
Demetrescu, C. and Thorup, M. 2002. Oracles for distances avoiding a link-failure. In Proceedings of the 13th Symposium on Discrete Algorithms. 838--843.
[5]
Demetrescu, C., Thorup, M., Chowdhury, R. A., and Ramachandran, V. 2008. Oracles for distances avoiding a failed node or link. SIAM J. Comput. 37, 5, 1299--1318.
[6]
Eppstein, D. 1998. Finding the k shortest paths. SIAM J. Comput. 28, 2, 652--673.
[7]
Henzinger, M. and King, V. 1995. Fully dynamic biconnectivity and transitive closure. In Proceedings of the 36th Symposium on Foundation of Computer Science. 664--672.
[8]
Hershberger, J. and Suri, S. 2001. Vickrey prices and shortest paths: what is an edge worth? In Proceedings of the of 42nd Symposium on Foundation of Computer Science. 252--259.
[9]
Hershberger, J. and Suri, S. 2002. Erratum to “Vickrey pricing and shortest paths: What is an edge worth?”. In Proceedings of the 43rd Symposium on Foundation of Computer Science. 809.
[10]
Hershberger, J., Suri, S., and Bhosle, A. 2003. On the difficulty of some shortest path problems. In Proceedings of the 20th Symposium on Theoretical Aspects of Computer Science (STACS). 343--354.
[11]
Karger, D., Koller, D., and Phillips, S. 1993. Finding the hidden path: Time bounds for all-pairs shortest paths. SIAM J. Comput. 22, 1199--1217.
[12]
Katoh, N., Ibaraki, T., and Mine, H. 1982. An efficient algorithm for K shortest simple paths. Networks 12, 4, 411--427.
[13]
Lawler, E. 1972. A procedure for computing the K best solutions to discrete optimization problems and its application to the shortest path problem. Manage. Sci. 18, 401--405.
[14]
Malik, K., Mittal, A. K., and Gupta, S. K. 1989. The k most vital arcs in the shortest path problem. Oper. Res. Lett. 8, 4, 223--227.
[15]
Nardelli, E., Proietti, G., and Widmayer, P. 2001. A faster computation of the most vital edge of a shortest path. Inf. Proc. Lett. 79, 2, 81--85.
[16]
Nisan, N. and Ronen, A. 2001. Algorithmic mechanism design. Games Econom. Beh. 35, 166--196.
[17]
Roditty, L. 2007. On the k-simple shortest paths problem in weighted directed graphs. In Proceedings of the 18th Symposium on Discrete Algorithms. 920--928.
[18]
Roditty, L. and Zwick, U. 2004a. Dynamic approximate all-pairs shortest paths in undirected graphs. In Proceedings of the 45th Symposium on Foundation of Computer Science. 499-508.
[19]
Roditty, L. and Zwick, U. 2004b. On dynamic shortest paths problems. In Proceedings of the ESA Annual Meeting. 580--591.
[20]
Thorup, M. 1999. Undirected single-source shortest paths with positive integer weights in linear time. ACM 46, 362--394.
[21]
Ullman, J. and Yannakakis, M. 1991. High-probability parallel transitive-closure algorithms. SIAM J. Comput. 20, 100--125.
[22]
Yen, J. 1971. Finding the K shortest loopless paths in a network. Manage. Sci. 17, 712--716.
[23]
Zwick, U. 2002. All-pairs shortest paths using bridging sets and rectangular matrix multiplication. J. ACM 49, 289--317.

Cited By

View all
  • (2025)K-shortest simple paths using biobjective path searchMathematical Programming Computation10.1007/s12532-025-00276-0Online publication date: 13-Feb-2025
  • (2024)Computing Replacement Paths in the CONGEST ModelStructural Information and Communication Complexity10.1007/978-3-031-60603-8_23(420-437)Online publication date: 27-May-2024
  • (2023)Approximate Distance Sensitivity Oracles in Subquadratic SpaceProceedings of the 55th Annual ACM Symposium on Theory of Computing10.1145/3564246.3585251(1396-1409)Online publication date: 2-Jun-2023
  • Show More Cited By

Index Terms

  1. Replacement paths and k simple shortest paths in unweighted directed graphs

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Transactions on Algorithms
    ACM Transactions on Algorithms  Volume 8, Issue 4
    September 2012
    276 pages
    ISSN:1549-6325
    EISSN:1549-6333
    DOI:10.1145/2344422
    Issue’s Table of Contents
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 04 October 2012
    Accepted: 01 December 2010
    Received: 01 March 2010
    Published in TALG Volume 8, Issue 4

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. k simple shortest paths
    2. Graph algorithms
    3. shortest paths

    Qualifiers

    • Research-article
    • Research
    • Refereed

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)16
    • Downloads (Last 6 weeks)1
    Reflects downloads up to 19 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2025)K-shortest simple paths using biobjective path searchMathematical Programming Computation10.1007/s12532-025-00276-0Online publication date: 13-Feb-2025
    • (2024)Computing Replacement Paths in the CONGEST ModelStructural Information and Communication Complexity10.1007/978-3-031-60603-8_23(420-437)Online publication date: 27-May-2024
    • (2023)Approximate Distance Sensitivity Oracles in Subquadratic SpaceProceedings of the 55th Annual ACM Symposium on Theory of Computing10.1145/3564246.3585251(1396-1409)Online publication date: 2-Jun-2023
    • (2023)Subcubic Equivalences between Graph Centrality Problems, APSP, and DiameterACM Transactions on Algorithms10.1145/356339319:1(1-30)Online publication date: 9-Mar-2023
    • (2023)Top-k Distance Queries on Large Time-Evolving GraphsIEEE Access10.1109/ACCESS.2023.331660211(102228-102242)Online publication date: 2023
    • (2023)Compact Distance Oracles with Large Sensitivity and Low StretchAlgorithms and Data Structures10.1007/978-3-031-38906-1_11(149-163)Online publication date: 28-Jul-2023
    • (2022)Algorithms and Lower Bounds for Replacement Paths under Multiple Edge Failure2022 IEEE 63rd Annual Symposium on Foundations of Computer Science (FOCS)10.1109/FOCS54457.2022.00090(907-918)Online publication date: Oct-2022
    • (2019)Near optimal algorithms for the single source replacement paths problemProceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms10.5555/3310435.3310561(2090-2109)Online publication date: 6-Jan-2019
    • (2018)Tight hardness for shortest cycles and paths in sparse graphsProceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms10.5555/3174304.3175350(1236-1252)Online publication date: 7-Jan-2018
    • (2018)An Empirical Comparison of k-Shortest Simple Path Algorithms on MulticoresProceedings of the 47th International Conference on Parallel Processing10.1145/3225058.3225075(1-12)Online publication date: 13-Aug-2018
    • Show More Cited By

    View Options

    Login options

    Full Access

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media