Improved Randomized Algorithms for Path Problems in Graphs Surender Baswana Postdoctoral Researcher Max Planck Institute for Computer Science
Path Problems in Graph Given a graph, report a path with certain characteristics
Path Problems in Graph Given a graph, report a path with certain characteristics Transitive closure
Path Problems in Graph Given a graph, report a path with certain characteristics Transitive closure All-pairs shortest paths
Query paradigm of a path problem Given a graph G=(V,E)
Query paradigm of a path problem Given a graph G=(V,E) A sequence of path queries
Query paradigm of a path problem Given a graph G=(V,E) A sequence of path queries Answer each path query online
Path Problems in static settings Preprocess a given graph G=(V,E) to form a data-structure that can answer a path query in optimal time.
Path Problems in dynamic settings A graph G=(V,E) ,
Path Problems in dynamic settings A graph G=(V,E) , q, q, u , u , q , u , u , u , u , q , q , u , …
Path Problems in dynamic settings AIM : Maintain a data-structure
Path Problems in dynamic settings AIM : Maintain a data-structure Answer each query in optimal time
Path Problems in dynamic settings AIM : Maintain a data-structure Answer each query in optimal time Requires less update time
Organization of the talk Static algorithms All-pairs approximate shortest paths Graph Spanners Dynamic algorithms Transitive closure All-pairs shortest paths Open Problems
Organization of the talk Static algorithms All-pairs approximate shortest paths Graph Spanners Dynamic algorithms Transitive closure All-pairs shortest paths Open Problems
All-pairs approximate shortest paths
All-Pairs Shortest Paths Given a graph G=(V,E), preprocess it to compute shortest-path for every pair of vertices u,v ЄV. |V|=n, |E|=m δ(u,v) : distance from u to v One of the most fundamental algorithmic graph problem
Existing algorithms for APSP Floyd and Warshal O(n3) Pettie [ICALP 2002, TCS 2004] O(mn+n2 log log n) Zwick [ISAAC 2004] O(n3 (log log n)1/2/log n)
Sub-cubic algorithms for APSP G=(V,E) Distance matrix Fast Matrix Multiplication Subroutine
Are there simple and efficient algorithms for APSP with sub-cubic preprocessing time ? sub-quadratic space data-structure ?
At the cost of approximation Are there simple and efficient algorithms for APSP with sub-cubic preprocessing time ? sub-quadratic space data-structure ? At the cost of approximation
All-pairs approximate shortest Paths Some error ε in the distance δ* Additive error ε = k δ(u,v) ≤ δ*(u,v) ≤ δ(u,v) + k Multiplicative error ε = t δ(u,v) ≤ δ*(u,v) ≤ t δ(u,v)
Existing algorithms for APASP in undirected graph Algorithms with additive error Aingworth et al. [SODA 1996, SICOMP 1999] Dor et al. [FOCS 1996, SICOMP 1999] Algorithms with multiplicative error Cohen [SICOMP 1998] Cohen & Zwick [SODA 1997, J. Algo. 2001] Thorup & Zwick [STOC 2001] Algorithms with additive and multiplicative error Elkin [PODC 2001]
Approximate Distance Oracle [Thorup & Zwick, STOC 2001] Given a positive integer k Preprocessing time O(kmn1/k) Data-structure of size O(kn1+1/k) Answer any approximate distance query in O(k) time δ(u,v) ≤ δ*(u,v) ≤ (2k-1) δ(u,v)
Approximate Distance Oracle [Thorup & Zwick, STOC 2001] Given a positive integer k Preprocessing time O(kmn1/k) Data-structure of size O(kn1+1/k) Answer any approximate distance query in O(k) time δ(u,v) ≤ δ*(u,v) ≤ (2k-1) δ(u,v) (2k-1)-approx. distance oracle
Approximate Distance Oracle [Thorup & Zwick, STOC 2001] Given a positive integer k Preprocessing time O(kmn1/k) Data-structure of size O(kn1+1/k) : Optimal Answer any approximate distance query in O(k) time δ(u,v) ≤ δ*(u,v) ≤ (2k-1) δ(u,v) (2k-1)-approx. distance oracle
Approximate distance oracles for un-weighted graphs Stretch Size Preprocessing time B, Sen SODA 2004 2k-1 O(kn1+1/k) min(mn1/k, n2 log n)
All-pairs t-approximate shortest paths, for t<3
All-pairs 2-approx. shortest path A : algorithm for (2-ε)-approximate shortest paths B,C : two nΧn boolean matrices
All-pairs 2-approx. shortest path A : algorithm for (2-ε)-approximate shortest paths B,C : two nΧn boolean matrices BΧC GB,C B,C Linear time A
All-pairs 2-approx. shortest path A : algorithm for (2-ε)-approximate shortest paths B,C : two nΧn boolean matrices BΧC GB,C B,C Linear time A All-pairs (2- ε)-approx. paths is as difficult as Boolean matrix multiplication
All-pairs 2-approx. shortest path [Cohen & Zwick, SICOMP 2000] G=(V,E) : Undirected weighted graph Preprocessing time : O(m1/2n3/2) Space : O(n2)
All-pairs 2-approx. shortest paths 2.5 Upper bound ω 2.376 2.0 Lower bound
All-pairs 2-approx. shortest paths 2.5 Upper bound ω 2.376 Algorithm 1 Õ(m2/3n + n2) δ(u,v) ≤ δ*(u,v) ≤ 2δ(u,v) + 1 2.0 Lower bound
All-pairs 2-approx. shortest paths 2.5 Upper bound ω 2.376 Algorithm 1 Õ(m2/3n + n2) δ(u,v) ≤ δ*(u,v) ≤ 2δ(u,v) + 1 2.0 Algorithm 2 Õ(n2) δ(u,v) ≤ δ*(u,v) ≤ 2δ(u,v) + 3 Lower bound
Graph Spanners
Graph Spanners Definition : Given a graph G=(V,E), a sub-graph G=(V,Es) that is sparse and yet preserves approximate distances pair-wise.
Graph Spanners Definition : Given a graph G=(V,E), a sub-graph G=(V,Es) that is sparse and yet preserves approximate distances pair-wise. Multiplicative t-spanner : δ(u,v) ≤ δs(u,v) ≤ t δ(u,v)
δ(u,v) ≤ δs(u,v) ≤ δ(u,v) + t Graph Spanners Definition : Given a graph G=(V,E), a sub-graph G=(V,Es) that is sparse and yet preserves approximate distances pair-wise. Multiplicative t-spanner : δ(u,v) ≤ δs(u,v) ≤ t δ(u,v) Additive t-spanner : δ(u,v) ≤ δs(u,v) ≤ δ(u,v) + t
Applications of Graph Spanner Distributed Computing Design of Synchronizers Compact routing tables Computational Biology Reconstruction of Phylogenetic trees All-pairs Approximate Shortest Paths
Multiplicative Spanners
Multiplicative Spanner size versus approximation
Multiplicative Spanner size versus approximation
Multiplicative Spanner size versus approximation girth = t stretch ≥ t-1
Multiplicative Spanner size versus approximation girth = t stretch ≥ t-1 Erdös[1960], Bondy & Simonovits [1974], Bollobas [1978] : For all k≥1, there are graphs with Ω(n1+1/k) edges and girth >2k
Multiplicative Spanner size versus approximation For k ≥1, a (2k-1)-spanner may have Ω(n1+1/k) edges
Multiplicative Spanner : Results Stretch ConstructionTime Size Althofer, Das, Dobkin,Joseph, Soares DCG,1993 2k-1 O(mn1+1/k) O(n1+1/k) Thorup, Zwick STOC,2001 O(mn1/k) O(kn1+1/k)
Multiplicative Spanner : Results Stretch ConstructionTime Size Althofer, Das, Dobkin,Joseph, Soares DCG,1993 2k-1 O(mn1+1/k) O(n1+1/k) Thorup, Zwick STOC,2001 O(mn1/k) O(kn1+1/k) Can we Compute (2k-1)-spanners in linear time ?
Multiplicative Spanner : Results Stretch ConstructionTime Size Althofer, Das, Dobkin,Joseph, Soares DCG,1993 2k-1 O(mn1+1/k) O(n1+1/k) Thorup, Zwick STOC,2001 O(mn1/k) O(kn1+1/k) B, Sen ICALP,2003 O(m)
Local approach u v Edge in Spanner Edge not in Spanner
Local approach 2 ≤w ≤w 1 i-1 ≤w ≤w w u v Pi : For each edge not in Es , there is a path connecting its endpoints with at-most i edges none heavier than the edge
New Algorithms for (2k-1)-spanner External-memory : Integer sorting Parallel algorithm O(t) for t > log*n Distributed Algorithm O(1) rounds, linear communication complexity
Algorithm for 3-spanner
Algorithm for 3-spanner Easy case : fewer than n½ edges
Algorithm for 3-spanner Difficult case : much more than n½ edges
Algorithm for 3-spanner Difficult case : much more than n½ edges Which n½ edges to select ?
Algorithm for 3-spanner Phase 1 : Clustering Phase 2 : Adding edges between vertices and clusters
Algorithm for 3-spanner Phase 1 : Clustering Phase 2 : Adding edges between vertices and clusters center
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center Process each v Є V \S as follows
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center Process each v Є V \S as follows If v is not adjacent to any sampled vertex
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center Process each v Є V \S as follows If v is not adjacent to any sampled vertex. v
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center Process each v Є V \S as follows If v is not adjacent to any sampled vertex. v
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center Process each v Є V \S as follows If v is adjacent to some sampled vertex
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center Process each v Є V \S as follows If v is adjacent to some sampled vertex. v x weights
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center Process each v Є V \S as follows If v is adjacent to some sampled vertex. v x weights
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center Process each v Є V \S as follows If v is adjacent to some sampled vertex. v x weights
Algorithm for 3-spanner Phase 1 : Clustering Select each vertex r.i. with probability p to be a cluster center Process each v Є V \S as follows If v is adjacent to some sampled vertex. v x weights
Algorithm for 3-spanner Phase 1 : Clustering G=(V,E) G=(V1,E1) Phase 1
Algorithm for 3-spanner Phase 1 : Clustering G=(V,E) G=(V1,E1) Every v Є V1 is clustered Phase 1 v o
Algorithm for 3-spanner Phase 1 : Clustering G=(V,E) G=(V1,E1) Every v Є V1 is clustered For each w-v Є E1 Phase 1 w v o
Algorithm for 3-spanner Difficult case : much more than n½ edges Which n½ edges to select ?
Algorithm for 3-spanner Difficult case : much more than n½ edges v
Algorithm for 3-spanner Phase 2 : adding edges between vertices and clusters
Analysis of the algorithm Correctness ?? Size of the spanner Running time
Analysis of the algorithm Correctness ?? Size of the spanner Edges added during Phase 1 + Edges added during Phase 2 Running time
Analysis of the algorithm Correctness ?? Size of the spanner n/p + Edges added during Phase 2 Running time
Analysis of the algorithm Correctness ?? Size of the spanner n/p + n2p Running time
Analysis of the algorithm Correctness ?? Size of the spanner n3/2 Running time
Analysis of the algorithm Correctness ?? Size of the spanner n3/2 Running time Modified Radix sort on the label of the edges
Spanner has stretch 3 x y
Both x and y are clustered Spanner has stretch 3 x y Both x and y are clustered
Spanner has stretch 3 x y x y
Spanner has stretch 3 x y x y
Spanner has stretch 3 x y o x y x y
Spanner has stretch 3 x y z α o x ß y x y
Spanner has stretch 3 x y z α o x ß y x y
Algorithm for (2k-1)-spanner
Reviewing 3-spanner algorithm [To build 5-spanner]
Reviewing 3-spanner algorithm [To build 5-spanner] #Vertices #Clusters V0 n
Reviewing 3-spanner algorithm [To build 5-spanner] #Vertices #Clusters n1/2 V1 V0 n
Reviewing 3-spanner algorithm [To build 5-spanner] #Vertices #Clusters Must increase the sampling probability n1/2 V1 V0 n
Reviewing 3-spanner algorithm [To build 5-spanner] #Vertices #Clusters n2/3 V1 V0 n
Computing 5-Spanner #Vertices #Clusters V2 n1/3 n2/3 V1 V0 n
Computing 5-Spanner #Vertices #Clusters V2 n1/3 n2/3 V1 V0 n
Algorithm for (2k-1)-spanner Vk-1 n1/k V1 n1-1/k V0 n
Additive Spanners (un-weighted graphs)
Algorithms for Additive Spanners Aingworth et al. [SODA 1996], Elkin & Peleg [STOC 2001] Additive 2-spanner of size O(n3/2)
Algorithms for Additive Spanners Aingworth et al. [SODA 1996], Elkin & Peleg [STOC 2001] Additive 2-spanner of size O(n3/2) B, Kavitha, Mehlhorn, Pettie [SODA 2005] Additive 6-spanner of size O(n4/3)
(α,β)-Spanner (un-weighted graphs)
Algorithms for (α,β)-spanner δ(u,v) ≤ δs(u,v) ≤ α δ(u,v) + β Elkin & Peleg [STOC 2001] (1+ε, β)-spanner of size O(n1+γ)
Algorithms for (α,β)-spanner δ(u,v) ≤ δs(u,v) ≤ α δ(u,v) + β Elkin & Peleg [STOC 2001] (1+ε, β)-spanner of size O(n1+γ) β depends inverse exponentially on γ super polynomially on ε-1
Algorithms for (α,β)-spanner δ(u,v) ≤ δs(u,v) ≤ α δ(u,v) + β Elkin & Peleg [STOC 2001] (1+ε, β)-spanner of size O(n1+γ) B, Kavitha, Mehlhorn, Pettie [SODA 2005] Linear time algorithm for (k,k-1)-spanner of size O(n1+1/k)
Dynamic Algorithms
Dynamic Algorithms Transitive Closure Query time Update time per edge-del. Leeuwen & Poutre TCS 1991 O(1) O(m) Demetrescu & Italiano FOCS 2000 O(n3/m)
Dynamic Algorithms Transitive Closure Query time Update time per edge-del. Leeuwen & Poutre TCS 1991 O(1) O(m) Demetrescu & Italiano FOCS 2000 O(n3/m) B. & Sen STOC 2002 O(n2/√m)
Dynamic Algorithms Transitive Closure Query time Update time per edge-del. Leeuwen & Poutre TCS 1991 O(1) O(m) Demetrescu & Italiano FOCS 2000 O(n3/m) B. & Sen STOC 2002 O(n2/√m) Roditty & Zwick FOCS 2002 O(n)
Dynamic Algorithms All-pairs approximate shortest paths Stretch Query time Update time per edge-del. B. & Sen SODA 2003 3 O(1) O(n3/2)
Dynamic Algorithms All-pairs approximate shortest paths Stretch Query time Update time per edge-del. B. & Sen SODA 2003 3 O(1) O(n3/2) Roditty & Zwick FOCS 2004 1+ε O(n)
Open Problems
Open Problems Graph spanners Additive spanners of size o(n4/3) ?
Open Problems Graph spanners Additive spanners of size o(n4/3) ? O(n1+1/k) size (2k-1)-spanner for weighted graph inO(m) time?
Open Problems All-pairs approximate shortest paths O(n2+ε) lower bound O(n2 polylog n) time algorithm without additive error
Open Problems All-pairs approximate shortest paths O(n2+ε) lower bound O(n2 polylog n) time algorithm without additive error Approximate Distance Oracles for weighted graphs in (n2) time
Open Problems Dynamic algorithms Fully dynamic all-pairs shortest paths Update time Query time Demetrescu, Italiano STOC 2003 Õ(n2) O(1)
Open Problems Dynamic algorithms Fully dynamic all-pairs shortest paths Update time Query time Demetrescu, Italiano STOC 2003 Õ(n2) O(1) Sub-quadratic update time & O(1) query time at the cost of approximation
Open Problems Dynamic algorithms Fully Dynamic algorithm for (2k-1)-spanner ?
Thank you