CS6100: Topics in Design and Analysis of Algorithms
All Pairs Shortest Paths John Augustine
CS6100 (Even 2012): All Pairs Shortest Paths
CS6100: Topics in Design and Analysis of Algorithms All Pairs - - PDF document
CS6100: Topics in Design and Analysis of Algorithms All Pairs Shortest Paths John Augustine CS6100 (Even 2012): All Pairs Shortest Paths Problem Definition Input: An undirected and unweighted graph G = ( V, E ) , where V = { 1 , 2 , . . . , n
CS6100 (Even 2012): All Pairs Shortest Paths
CS6100 (Even 2012): All Pairs Shortest Paths 1
ij = 1 iff ∃ path of distance 2 from i to j.
∞
n
1Recently improved to n2.3727 by Virginia Vassilevska Williams CS6100 (Even 2012): All Pairs Shortest Paths 2
1≤k≤n(Aik + Bkj).
CS6100 (Even 2012): All Pairs Shortest Paths 3
CS6100 (Even 2012): All Pairs Shortest Paths 4
CS6100 (Even 2012): All Pairs Shortest Paths 5
ij =
CS6100 (Even 2012): All Pairs Shortest Paths 6
ij.
ij − 1.
ij = 1 ∀i = j then
ij
ij − 1
CS6100 (Even 2012): All Pairs Shortest Paths 7
CS6100 (Even 2012): All Pairs Shortest Paths 8
kj ≥ D′ ij
kj ≤ D′ ij
kj < D′ ij.
ij = ℓ.
CS6100 (Even 2012): All Pairs Shortest Paths 9
kj ≥ Dkj
CS6100 (Even 2012): All Pairs Shortest Paths 10
ij = ℓ.
kj ≤ Dkj+1 2
kj ≤ ℓ.
kj ≤ D′ ij.
kj = ℓ − 1 < ℓ = D′ ij
kj < D′ ij.
CS6100 (Even 2012): All Pairs Shortest Paths 11
kj ≥ d(i) · D′ ij.
kj < d(i) · D′ ij.
kj = n
kj = Sij
CS6100 (Even 2012): All Pairs Shortest Paths 12
ij = 1 ∀i = j then
ij
ijZii
ij − 1
ijZii
CS6100 (Even 2012): All Pairs Shortest Paths 13
CS6100 (Even 2012): All Pairs Shortest Paths 14
CS6100 (Even 2012): All Pairs Shortest Paths 15
ik = kRkAik.
kj = RkBkj.
CS6100 (Even 2012): All Pairs Shortest Paths 16
1: W = −AB. 2: for t = 0, . . . ⌊log n⌋ do 3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14: end for 15: for all (i, j) do 16:
17:
18:
19: end for
CS6100 (Even 2012): All Pairs Shortest Paths 17
CS6100 (Even 2012): All Pairs Shortest Paths 18
kj = 1) ⇐
CS6100 (Even 2012): All Pairs Shortest Paths 19
kj = 1) ⇐
(Dij mod 3) ij
CS6100 (Even 2012): All Pairs Shortest Paths 20