Finding k Simple Shortest Paths and Cycles
Vijaya Ramachandran University of Texas at Austin, USA
(Joint work with Udit Agarwal) (http://arxiv.org/pdf/1512.02157v1.pdf)
1 / 27
Finding k Simple Shortest Paths and Cycles Vijaya Ramachandran - - PowerPoint PPT Presentation
Finding k Simple Shortest Paths and Cycles Vijaya Ramachandran University of Texas at Austin, USA (Joint work with Udit Agarwal) (http://arxiv.org/pdf/1512.02157v1.pdf) 1 / 27 k Simple Shortest Paths Given : Directed graph G = ( V , E ) with
1 / 27
2 / 27
3 / 27
◮ Solves 2-APSiSP in ˜
◮ Solves k-All-SiSP in O(m) time for the first path and
4 / 27
5 / 27
6 / 27
7 / 27
◮ Input is G, with source s and sink t. ◮ Form G ′ by adding a new vertex u′ and zero-weight edges
◮ k-th simple s-t path in G is k-th simple cycle in G ′ though u′.
◮ Split v into vi and vo. ◮ All incoming edges to v become incoming to vi. ◮ All outgoing edges from v become outgoing from vo. ◮ A simple cycle through vertex v in G is transformed into a
◮ So k-SiSC ≤(m,n) k-SiSP. 8 / 27
◮ All incoming edges to v become incoming to vi. ◮ All outgoing edges from v become outgoing from vo.
9 / 27
1o 1i 2o 2i 3o 3i p0 p1 p2 p3 G′ 3W 2W W W 2W 3W
10 / 27
11 / 27
◮ Uses path extensions that may not be detours.
◮ Uses recursion, but inefficient for larger k.
◮ Uses a different type of path extension. 12 / 27
13 / 27
◮ 2-SiSP is computed by the same algorithm plus O(n)
◮ The output can potentially have size Ω(n3), simply for the
◮ Instead use compact distance sensitivity oracles (DSO)
◮ Any specific replacement path can be found from DSO in
◮ Current fastest algorithm for DSO runs in
◮ BUT: 2-APSiSP from DSO takes n3 time.
14 / 27
15 / 27
16 / 27
◮ Compute the first path in all Q2 sets with an APSP
◮ Compute the second path in each Q2 set in O(1) time using
◮ Compute 2-APSiSP from the Q2 sets.
17 / 27
k (x, y) is the set of k simple shortest paths from x to y in G.
◮ if all paths in P∗
k−1(x, y) share the same first edge (x, a), then
k−1(x, y), together with the
◮ Otherwise, Qk(x, y) = P∗
k (x, y).
◮ If the k − 1 shortest paths in Qk(x, y) all start with the same
◮ Otherwise, Qk(x, y) = P∗
k (x, y).
18 / 27
k (x, y).)
k (x, y) start with the same first edge (x, a)
k (a, y) consists of the right subpaths of the paths in P∗ k (x, y).
19 / 27
k (x, y) start with the same first edge (x, a)
20 / 27
◮ So, if the k − 1 shortest paths in Qk(x, y)) all start with (x, a)
◮ Compute-APSiSP performs these path extensions and may
21 / 27
k (x, y) ← Qk(x, y)
k (x, y) have the same first edge, say (x, a) then
k (x, y) be π′
k (x, y)| = k − 1 then add π to P∗ k (x, y) and set update flag
k (x, y) and set update flag
22 / 27
k (x, y) ∀x, y ∈ V .
◮ Corollary 1. Using DSO, 2-APSiSP can be computed by an
◮ Corollary 2. 2-APSiSP can be computed in O(mn + n2 log n)
23 / 27
◮ Compute the Q3 sets by recursively calling 2-APSiSP on G,
◮ Call Compute-APSiSP with the Q3 sets.
24 / 27
25 / 27
◮ New algorithm, using path extensions, for 2-APSiSP with the
◮ Reductions between sparse graphs for most versions of finding
◮ Very fast algorithm for k-All-SiSP, again with path extensions.
◮ Can we compute the Qk sets more efficiently? ◮ Space usage is high in our all-pairs algorithms.
◮ Hardness relative to Sparse Min-Wt-Cycle. ◮ Can we show equivalence to APSP in sparse graphs? ◮ More generally, can we further extend the class of problems
26 / 27
27 / 27