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 ˜O(m
√
n). 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.