1 / 37

On the Difficulty of Some Shortest Paths Problems

On the Difficulty of Some Shortest Paths Problems. Amit Bhosle Department of Computer Science University of California, Santa Barbara. Overview : What We Will Discuss Today. Introduction – Replacement Paths : the central problem Motivation Upper bounds :

vangie
Download Presentation

On the Difficulty of Some Shortest Paths Problems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. On the Difficulty of Some Shortest Paths Problems Amit Bhosle Department of Computer Science University of California, Santa Barbara

  2. Overview : What We Will Discuss Today • Introduction – Replacement Paths : the central problem • Motivation • Upper bounds : • Undirected : O(1) single source shortest paths computation [HS01] • Directed : O(1) all pair shortest paths computation • Lower bounds : • All pair shortest paths (APSP) [KKP] • N-pairs shortest paths (NPSP) • Replacement paths problem • Related problems • Conclusion

  3. The Replacement Paths Problem • Given a weighted graph G(V,E), two nodes s and t, and a shortest • path P = {s=v0 , v1 , v2 ,…,vk=t}from s to t. • Find the shortest path from s to t in the graphs : • Edge version : G - {ei}for all 0  i  k whereei = {vi ,vi+1} • Node version : G - {vi}for all 0 < i < k . • G assumed to be 2-connected. • G may be directed or undirected. • We focus on the edge version (lower bounds hold for node version).

  4. Why Study the Replacement Paths Problem ? Applications : • Computational mechanism design (VCG auctions). payment(e) = d (s,t ; G \ e) – d (s,t ; G |w(e)=0 ) Weight of the replacement path for e Needs constant time per edge after an initial single source shortest path computation Payments need to be computed for all edges of the ( s, t ) shortest path.

  5. Why Study the Replacement Paths Problem ? (Contd.) Applications : • Network routing for single link failure recovery. • Directly yields the Most Vital Edge in the shortest path domain. • Sub-problem in other problems e.g. K - Shortest paths.

  6. Naïve Algorithm • Recompute : Compute the s - t shortest paths separately in each of the k graphs. G - {ei }for all 1  i < k. • Time Complexity : Since k = O(n)in worst case, the naïve algorithm may require O( n (m+nlog n) )time. • Simple, but inefficient (at least) for undirected graphs.

  7. Upper Bounds • Undirected edgeversion solved recently by Hershberger and Suri [HS01] in O(m + n log n)time. • Nardelli, et al. [NPW01] solved the node version in the same time bounds. • Directed version can be solved in O(APSP) time. • In some models, the All Pairs Shortest Paths problem can be solved in sub-cubic time whereas the naïve algorithm may still be cubic in the worst case.

  8. Undirected Version Upper Bound [Hershberger-Suri] p Vs|e Vt|e q e s t Lemma : If p  Vt|e , path(p,t)cannot contain e

  9. Undirected Version Upper Bound (Contd.) Ee v u Vs|e Vt|e e s t Weight of the path using edge (u,v) is : d (s,u) + w (u,v) + d (v,t)

  10. Undirected Version Upper Bound (Contd.) • Assign cost to each edge (u,v)  E(Vs|e ,Vt|e) as : cost (u,v) = d(s,u) + w(u,v) + d(v,t) • Immediately suggests an algorithm : (weight of) the replacement path for the edge e is MIN(u,v): u Vs|e, v Vt|e{ cost(u,v) } • But, arbitrarily computing these values could yield no improvement – there can be  (m) edges in each cut !

  11. Undirected Version Upper Bound (Contd.) • From Ei , delete edges ending at vi+1and add edges starting at vi+1to get Ei+1 : we need O ( deg(vi+1)) heap operations. • Standard heap implementation yields an O(m log n) algorithm. A slightly modified algorithm using F-Heaps runs in O(m+n log n) time. s t vi vi+1 ei ei+1

  12. Difficulty in Directed Version v Vs|e Vt|e s t e The basic lemma does not hold for digraphs : Even though v  Vt|e , path(v,t)contains edge e .

  13. Directed Replacement Paths : O(APSP) • The naïve algorithm requires O( k (m+n log n )), where k is the number of edges on the shortest path. • We present an algorithm which runs in O(k.n) time after an initial APSP computation. • APSP has the trivial lower bound of  (n 2) and k is at most n-1. Thus, the running time remains dominated by the APSP computation.

  14. Directed Replacement Paths : O(APSP) (Contd.) We start by computing the All Pairs Shortest Paths in G \ P(s,t) where P = {e0 , e2 ,…, ek-1 } is the shortest path from s to t . v ei t=vk s=v0 vj vj+1 Vs|i

  15. Directed Replacement Paths : O(APSP) (Contd.) • For any edge ei , Vs|i can be constructed in O(n) time. • The best path through a node v Viis : pathv (s,t | i ) = MIN kj = i+1 { d(s,v ) + d(v,vj) + d(vj ,t ) }. We shall see later that this can be done in constant time per node. • The replacement path for the edge ei is : MIN v  V s|i { pathv (s,t | i ) }. This requires O(n)time per edge on P, since | Vi | is O (n).

  16. Directed Replacement Paths : O(APSP) (Contd.) We compute the replacement paths for ei before ej for i > j. pathv (s,t | i ) = MIN { pathv (s,t | i+1 ) , d(s,v ) + d(v ,vi+1) + d(vi+1 ,t ) } v ei t=vk ei+1 s=v0 vi+1

  17. Directed Replacement Paths : O(APSP) (Contd.) • Time required remains dominated by the initial APSP computation. (All other steps together require O (n2) ) • Implies an O(k.APSP) time algorithm for the k-shortest paths. • O ( APSP ) : • Fast matrix multiplication : O(n3 (log log n / log n)) ; O(C0.681 n2.575 ). • Comparison based: O ( n ( m + n log n) )

  18. All Pairs Shortest Paths Lower Bound [Karger-Koller-Phillips] n m / n n Any algorithm must compare all the mnpaths. Otherwise, some modification of edges enables us to fool the algorithm.

  19. N-Pairs Shortest Paths (NPSP) m /  n n n Any algorithm must investigate all the  (mn ) triples where m = O (nn) We shall reduce an NPSP instance to a Replacement Paths problem instance, thus applying the lower bound of the former to the latter.

  20. Replacement Paths Lower Bound • The lower bound is based on the n-pairs shortest paths lower bound. • Some restrictions need to be imposed since the NPSP lower bound is not sufficiently robust. But still includes all known algorithms. • Reduction basically says that an O (T (m,n)) algorithm for the replacement paths implies an O (T (m,n)) algorithm for NPSP.

  21. Replacement Paths Lower Bound (Contd.) tj H sj W = nemax emax H (i+1).W (n-i).W (n-k).W p.W 0 0 0 0 0 0 0 s t vi vi+1

  22. Replacement Paths Lower Bound (Contd.) • Crucial property : Replacement path for edge ei = {vi ,vi+1}leaves the spine P at vi , enters H at sj , leaves H at tjand joins back at vi+1. • That is, each replacement path in G computes an(sj ,tj ) distance in H. • The reduction is linear time and does not increase the input complexity. • NPSP has a (weak) lower bound of  (m n). With some restrictions, we apply the lower bound to the replacement paths problem.

  23. Lower Bounds on Related Problems Similar bounds on some problems closely related to the replacement paths problem : • K-shortest paths : (m n) per output path. • <Length>  <hop count> metric :  (m n). • Subpaths deletions :  (m k) for k subpaths deleted. • Replacement SP trees :  (mn).

  24. K-Shortest Paths • Given a digraph G, and two nodes s and t , and an integer k, one needs to find k shortest paths from s to t in order of increasing weights. • All known algorithms for k-SP use replacement paths as a subroutine : note that the shortest replacement path is the second shortest path from s to t. • Basic idea : ith shortest path differs from all the i -1 shorter paths in atleast one edge. Thus, new candidates are generated by finding the replacement paths for these shorter paths.

  25. K-Shortest Paths (Contd.) • Typically, all the algorithms for the k-SPs invoke one replacement paths subroutine per output path. • Thus, the lower bound of (m n) applies to all algorithms for the k-SPs which use replacement paths as a subroutine. • Is it possible to determine the shortest replacement path without computing all the replacement paths for a given shortest path ? • The non-simple k-SPs can be computed in O(m + n log n + k) time using a technique not based on replacement paths.

  26. <length>  <hop count> • Ties among shortest paths are sometimes broken in favor of the one with fewer edges. • Archer & Tardos suggested the <length>  <hop count> metric for replacement paths. This metric also favors paths with fewer edges. • A slight modification in the basic construction allows us to establish a lower bound of  (m n) for computing replacement paths with this metric.

  27. <length>  <hop count> (Contd.) tj H sj W = nemax (i+1)W (n-i)W 0 0 0 0 0 0 0 s vi vi+1 vn v3n=t

  28. <length>  <hop count> (Contd.) Weight of a path with d detours with detour r skipping kr edges of P is exactly equal to : (3n + 4d -  kr )  {(dn + kr )W +  lr } Weight of the path No. of edges Thus, the metric is minimized when d = 1. If this detour skips k edges, the weight of the path becomes (3n + 4 - k )  {(n+k)W + l } Thus, k = 1 for optimal replacement path and again, each replacement path computes an (si ,tj ) distance in H.

  29. Replacement Shortest Paths Trees • Given a digraph G, a node s, and the shortest paths tree Ts = {e1 ,e2 ,…, en-1} of s in G, compute the shortest path tree of s in each of the n-1 graphs G \ ei . • Naïve algorithm : Recompute - compute the shortest path tree of s in each of the. Graphs G \ eifor all1  i  n-1. • Time complexity : O (mn + n2log n). • We prove a lower bound of  (mn) for this problem.

  30. Replacement Shortest Paths Trees (Contd.) H Sn Sk Si W = n.emax 0 (n-k).W (n-i).W 0 0 0 0 0 0 0 0 s = v0 vk vi t = vn

  31. Replacement Shortest Paths Trees (Contd.) • Crucial properties : • The shortest path tree in G of s = v0contains the shortest path tree of snin H as a subtree. • The shortest path tree in G \ {ei = (vi , vi+1)} contains the shortest path tree of si+1in H as a subtree. • Thus, all the replacement shortest paths trees in G essentially yield the all-pair-shortest-paths in H. • Using the lower bound of  (mn) for the APSP, we arrive at the same lower bound for the problem at hand.

  32. Subpaths Deletions • Given a digraph G, two nodes s and t, the shortest path P from s to t and a set Q = {q1 , q2 ,…, qk} of sub-paths of P. One needs to compute the shortest path from s to t in the graphs G \ qi1 i  k. • Naïve algorithm. • Recompute : compute the s - t shortest path in the graphs G \ qifor all1  i  k. • Time complexity : O (k (m+n log n)). • We prove a lower bound of  (m k) and an upper bound of O(APSP + k.n ) for the problem at hand.

  33. Subpaths Deletions (Contd.) H W = nemax Si Dj (n-j)W (n-i)W 0 0 0 0 0 0 0 0 0 si sn dn dj t=d0 s = s0

  34. Subpaths Deletions (Contd.) • Crucial property : The replacement path from s to t in the graph. G \ { pi = (si , dj )} follows P till si , enters H at Si , leaves H at Dj , joins P back at dj and follows P till t. • Thus, the replacement path for each deleted sub-path computes an (si , dj ) distance in H. • Using the lower bound of the k-pair shortest paths we arrive at a lower bound of  (m k) for this problem where the number of sub-paths to be deleted is O(k).

  35. Subpaths Deletions : Upper Bound • The k replacement pathscan be computed in O(APSP + k.n). • Exactly similar to the O(APSP) algorithm for the replacement paths problem : We first sort the sub-paths by their right end points and then continue in the same fashion as earlier. • Worst case optimal : (mk) and both m and k could be as large as O(n 2), but considerable gap between the upper and lower bounds for smaller values of k and/or m.

  36. Concluding Remarks • These are the first super-linear lower bounds for the problem (s). • Still a significant gap between the lower bound of  (m n) and the trivial upper bound of O(mn + n 2 log n). • K-shortest paths : Can one solve the problem without using the replacement paths as a subroutine ? • Faster APSP algorithms can improve the trivial upper bound (these would have to be non path-comparison based).

  37. Thank You

More Related