1 / 19

Answering distance queries in directed graphs using fast matrix multiplication

Answering distance queries in directed graphs using fast matrix multiplication. Raphael Yuster. University of Haifa. Uri Zwick. Tel Aviv University. Single-Source Shortest Paths. SSSP algorithm. Distance vector. s. n.

nubia
Télécharger la présentation

Answering distance queries in directed graphs using fast matrix multiplication

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. Answering distance queriesin directed graphs using fast matrix multiplication Raphael Yuster University of Haifa Uri Zwick Tel Aviv University

  2. Single-Source Shortest Paths SSSPalgorithm Distance vector s n Input: A weighted directed graph G=(V,E), where |E|=m and |V|=n, and a source vertex s. Output: The distances from s to all other vertices. Can be solved inO(mn)time,[Belman ’58], [Ford ’58]

  3. All-Pairs Shortest Paths APSPalgorithm n by ndistancematrix Input: A weighted directed graph G=(V,E), where |E|=m and |V|=n. Output: An nn distance matrix. Can be solved in:mn + n2 log n [Johnson ’77] (with Fibonacci Heaps)mn + n2log log n [Thorup ’99, Hagerup ’00, Pettie ’02]

  4. Answering distance queries Generalizes both SSSP and APSP Preprocessing: datastructure u,v δ(u,v) Query answering:

  5. Single-source Shortest Pathsin directed graphs with bounded integer edge weights For dense graphs, the running time is O(n2.5) !

  6. Assuming bounded integer edge weights: Can we get an O(n2.5-ε) algorithmfor the SSSP problem? Can we get an O(n3-ε) algorithm for the APSP problem? Yes! If we are using fast matrix multiplication

  7. All-Pairs Shortest Pathsin directed graphs with bounded integer weights Improves results of [Alon-Galil-Margalit ’91] [Takaoka ’98]

  8. New result:Answering distance queries Directed graphs, bounded integer weights. In particular, any n1.38distances can be computed in n2.38time. For dense enough graphs this improves on Goldberg’s SSSP algorithm.n2.38vs.mn0.5

  9. Min-Plus Products

  10. Solving the APSP problem by repeated squaring If W is an n by n matrix containing the edge weightsof a graph. Then Wn is the distance matrix. D W for i 1 to log2n do D  D*D Thus:APSP(n)  MPP(n) log n

  11. Min-Plus Product Algebraic Product O(n2.38)[Strassen ’69] … [Coppersmith-Winograd ’90] The fast algebraic algorithms cannot be used, as the min operation has no inverse

  12. Using matrix multiplicationto compute max-plus products Assume: 0 ≤ aij , bij≤ M n2.38polynomial products Mn2.38operations per max-plus product Moperations per polynomial product  =

  13. Trying to implement the repeated squaring algorithm Consider an easy case: all weights are 1.  *

  14. The preprocessing algorithm • D W ; BV • for i 1 to log3/2n do • { • s  (3/2)i+1 • B  rand(B,(9nlnn)/s) • D[V,B]  min{D[V,B] , D[V,B]*D[B,B] } • D[B,V]  min{D[B,V] , D[B,B]*D[B,V] } • } Choose a subset of Bof size (9n ln n)/s Select the columns of D whose indices are in B Select the rows and columns of D whose indices are in B

  15. |B| n |B| |B| Twice Sampled Distance Products D[V,B]*D[B,B] In the i-th iteration, the set B is of size n ln n / s, where s = (3/2)i n n = The matrices get smaller and smallerbut the elements get larger andlarger

  16. Complexity of preprocessing algorithm The i-th iteration: n ln n / s n ln n / s s=(3/2)i+1 The elements are of absolute value at mosts  n ln n / s blocks n (n/s)2.38  ss ≤ n2.38

  17. v u The query answering algorithm • δ(u,v)  D[{u},V]*D[V,{v}] Query time: O(n)

  18. at most at most The preprocessing algorithm: Correctness Let Bi be the i-th sample. B1 B2 B3 … Invariant: After the i-th iteration, if (uV and vBi)or (vV and uBi)and there is a shortest path from u to v that uses at most(3/2)i edges, then D(u,v)=δ(u,v). Consider a shortest path that uses at most (3/2)i+1 edges

  19. at most at most The query answering algorithm: Correctness Suppose that the shortest path from u to vuses between (3/2)i and (3/2)i+1 edges u v

More Related