Dynamic Shortest Paths Camil Demetrescu University of Rome “La Sapienza” Giuseppe F. Italiano University of Rome “Tor Vergata”

Slides:



Advertisements
Similar presentations
Iterative Rounding and Iterative Relaxation
Advertisements

Single Source Shortest Paths
all-pairs shortest paths in undirected graphs
Polygon Triangulation
Chapter 8 Topics in Graph Theory
Dynamic Graph Algorithms - I
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
October 31, Algorithms and Data Structures Lecture XIII Simonas Šaltenis Nykredit Center for Database Research Aalborg University
CS138A Single Source Shortest Paths Peter Schröder.
Shortest-paths. p2. Shortest-paths problems : G=(V,E) : weighted, directed graph w : E  R : weight function P=
Single-Source Shortest- paths. p2. Shortest-paths problems : G=(V,E) : weighted, directed graph w : E  R : weight function P=
1 Theory I Algorithm Design and Analysis (10 - Shortest paths in graphs) T. Lauer.
Fully Dynamic Transitive Closure: Breaking Through the O(n 2 ) Barrier Camil Demetrescu University of Rome “La Sapienza” Giuseppe F. Italiano University.
CSE 101- Winter ‘15 Discussion Section January 26th 2015.
Introduction to Algorithms 6.046J/18.401J/SMA5503
Dynamic All Pairs Shortest Paths Based on the following resources: Camil Demetrescu and Giuseppe F. Italiano (2004) A New Approach to Dynamic All Pairs.
Combinatorial Algorithms
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Chapter 23 Minimum Spanning Trees
Applied Discrete Mathematics Week 12: Trees
Shortest Paths Definitions Single Source Algorithms –Bellman Ford –DAG shortest path algorithm –Dijkstra All Pairs Algorithms –Using Single Source Algorithms.
1 On Dynamic Shortest Paths Problems Liam Roditty Uri Zwick Tel Aviv University ESA 2004.
1 8-ShortestPaths Shortest Paths in a Graph Fundamental Algorithms.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Augmenting Paths, Witnesses and Improved Approximations for Bounded Degree MSTs K. Chaudhuri, S. Rao, S. Riesenfeld, K. Talwar UC Berkeley.
Graph Algorithms: Shortest Path We are given a weighted, directed graph G = (V, E), with weight function w: E R mapping.
Shortest Paths Definitions Single Source Algorithms
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
4/17/2017 Section 8.5 Euler & Hamilton Paths ch8.5.
Shortest Paths1 C B A E D F
SINGLE-SOURCE SHORTEST PATHS. Shortest Path Problems Directed weighted graph. Path length is sum of weights of edges on path. The vertex at which the.
Theory of Computing Lecture 7 MAS 714 Hartmut Klauck.
Dijkstra's algorithm.
Graphs – Shortest Path (Weighted Graph) ORD DFW SFO LAX
Dynamic Single-source Shortest Paths Camil Demetrescu University of Rome “La Sapienza”
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
9/10/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 8 Greedy Graph.
David Luebke 1 9/13/2015 CS 332: Algorithms S-S Shortest Path: Dijkstra’s Algorithm Disjoint-Set Union Amortized Analysis.
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
7.1 and 7.2: Spanning Trees. A network is a graph that is connected –The network must be a sub-graph of the original graph (its edges must come from the.
Edge-disjoint induced subgraphs with given minimum degree Raphael Yuster 2012.
Distance sensitivity oracles in weighted directed graphs Raphael Yuster University of Haifa Joint work with Oren Weimann Weizmann inst.
Introduction to Algorithms Jiafen Liu Sept
CSE 2331 / 5331 Topic 12: Shortest Path Basics Dijkstra Algorithm Relaxation Bellman-Ford Alg.
Engineering shortest path algorithms (a round trip between theory and experiments) Camil Demetrescu University of Rome “La Sapienza” Giuseppe F. Italiano.
Introduction to Graph Theory
Introduction to Graph Theory
Iterative Rounding in Graph Connectivity Problems Kamal Jain ex- Georgia Techie Microsoft Research Some slides borrowed from Lap Chi Lau.
Single Source Shortest Paths Chapter 24 CSc 4520/6520 Fall 2013 Slides adapted from George Bebis, University of Reno, Nevada.
(CSC 102) Lecture 30 Discrete Structures. Graphs.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
CSE 373: Data Structures and Algorithms Lecture 21: Graphs V 1.
Trees.
CSC317 Shortest path algorithms
Algorithms and Data Structures Lecture XIII
Yuval Peres Dmitry Sotnikov Benny Sudakov Uri Zwick (武熠)
Enumerating Distances Using Spanners of Bounded Degree
CS 583 Analysis of Algorithms
Lecture 13 Algorithm Analysis
Lecture 13 Algorithm Analysis
Improved dynamic reachability algorithms for directed graphs
Minimum Spanning Tree Algorithms
Lecture 13 Algorithm Analysis
Lecture 13 Algorithm Analysis
Algorithms (2IL15) – Lecture 7
Dynamic Graph Algorithms
CSE 373 Data Structures and Algorithms
Graph Algorithms: Shortest Path
CS 3013: DS & Algorithms Shortest Paths.
Presentation transcript:

Dynamic Shortest Paths Camil Demetrescu University of Rome “La Sapienza” Giuseppe F. Italiano University of Rome “Tor Vergata”

Dynamic (All Pairs) Shortest Paths Given a weighted directed graph G=(V,E,w), perform any intermixed sequence of the following operations: return distance from x to y (or shortest path from x to y) Query (x,y): update weight of edge (u,v) to w Update (u,v,w):

Previous work on dynamic APSP # papers

Previous work on fully dynamic APSP generalreals? < o(n 3 )O(1) QueryUpdateGraphWeight Update recomputing from scratch general reals O(1) O(n 3 ) ~ O(n C ) ~ [0,C] King 99general[0,C]O(n 2.5 (C log n) 0.5 )O(1)O(n 9/7 log(nC))Henzinger et al. 97planar[0,C] O(n 9/5 log 13/5 n) Fackcharoemphol, Rao 01 planarreals D, Italiano 01generalS realsO(n 2.5 (S log 3 n) 0.5 )O(1)

A new approach New combinatorial properties of graphs: Uniform paths

A new fully dynamic algorithm QueryUpdateGraphWeight King 99general[0,C]O(n 2.5 (C log n) 0.5 )O(1) O(n 9/7 log(nC))Henzinger et al. 97planar[0,C] O(n 9/5 log 13/5 n) Fackcharoemphol, Rao 01 planarreals D, Italiano 01generalS realsO(n 2.5 (S log 3 n) 0.5 )O(1) D, Italiano 02generalrealsO(n 2 log n)O(1)

 (n 2 ) changes per update  (n) +1 +1

Main ingredients of previous results Maintaining breadth-first trees under edge deletions [Even, Shiloach 85] Dynamic reevaluation of products of matrices [D, Italiano 00] Long paths property [Greene, Knuth 82] (all fully dynamic algorithms on general graphs) (results for general graphs with integer weights in [0,C]) (results for general graphs with S real weights per edge)

Uniform paths A path is uniform if all of its subpaths are shortest paths xy π xy xy UNIFORM NOT UNIFORM Shortest path Not a shortest path Shortest path

Uniform paths Properties of Uniform paths Theorem I Shortest paths  Uniform paths Shortest paths

Properties of Uniform paths Theorem II A path is uniform  for any internal vertex, the sum of the distances to the path endpoints is equal to the weight of the path ======= xy π xy

Properties of Uniform paths For the sake of simplicity, we assume that no two paths in the graph have the same weight. (Ties can be broken by adding a tiny fraction to the weight of each edge) Theorem II Uniform paths π xy are internally vertex-disjoint xy π1π1 π3π3 π2π2

Properties of Uniform paths Theorem III There are at most n-1 uniform paths connecting x,y xy This is a consequence of vertex-disjointess…

Dynamic graphs We call dynamic graph a sequence of graphs such that, for any t, G t-1 and G t differ in the weight of exactly one edge

Uniform paths in dynamic graphs A uniform path in G t is appearing if it is not uniform in G t-1

Uniform paths in dynamic graphs A uniform path in G t is disappearing if it is not uniform in G t+1 G t+1 GtGt xy xy

Uniform paths in dynamic graphs Theorem IV At most n uniform paths can appear after an increase At most 1 uniform path can disappear after an increase Corollary The amortized number of appearing uniform paths per update in an increase-only sequence is O(1)

Uniform paths in dynamic graphs The weights of uniform paths that disappear and then reappear do not change… xy xy What about fully dynamic sequences?

Uniform paths in dynamic graphs Theorem V For any pair (x,y), the amortized number of uniform paths π xy appearing with a new weight per update in a fully dynamic sequence is O(log n) We conjecture that the bound is O(1)…

Sketch of proof of Theorem VI (1/3) Construct the graph of uniform paths H defined as: Vertices of H are operations  t in the dynamic graphEach edge (  1,  2 ) in H corresponds to a path π xy in the dynamic graph such that: π xy contains both edges updated by  1 and  2 1 π xy is uniform at least once between  1 and  2 2 π xy is not touched between  1 and  2 3

Sketch of proof of Theorem VI (2/3) This implies that the graph of uniform paths H has average degree log(k), where k is the number of vertices of H H cannot contain the following forbidden subgraph: 11 22 33 44 Where:  1 <  2 <  3 <  4

Sketch of proof of Theorem VI (3/3) Map each edge (  1,  2 ) of H into a point p=(  1,  2 ) in the square k  k Instance with highest density

Shortest paths and edge weight updates How does a shortest path change after an update? The shortest path is the same, but has different weight: xy  The shortest path is different (update = decrease): xy -- EASY

Shortest paths and edge weight updates The shortest path is different (update = increase): xy ++ HARD ab If we look closer, we realize that the new shortest path from a to b was already uniform before the update!

A new approach to dynamic APSP Are we done? Main idea: For each pair x,y, maintain in a data structure uniform paths connecting x to y The combinatorial properties of uniform paths imply that only a small piece of information needs to be updated at each time… NO

xy How to pay only once? xy xy This path stays the same while flipping between uniform and non-uniform: We would like to have an update algorithm that pays only once for it over the whole sequence...

xy Looking at the substructure xy …but if we removed the edge it would get a shortest path again! may resurrect! This path remains a shortest path after the insertion This path is no longer a shortest path after the insertion…

Zombies A path is a zombie if it used to be a shortest path, and its edges have not been updated since then

Potentially uniform paths shortest path x y π xy Uniform path shortest path or zombie x y π xy Potentially uniform path Relaxed notion of uniformity: Subpaths do not need to be shortest at the same time

Potentially uniform paths Properties of potentially uniform paths Theorem I Uniform paths  Potentially uniform paths Uniform paths Shortest paths

Properties of potentially uniform paths Theorem II O(zn 2 ) zombies at any time O(zn 2 ) new potentially uniform paths per update

 (n) 100 How many zombies can we have? A lot! We can construct a dynamic graph with  (n 3 ) zombies at any time, amortized # zombies =  (n 2 )+  (n 2 )  (n 2 ) =  (n 3 )  (n)

Reducing # of zombies: Smoothing At each update we pick an edge with the maximum number of zombies passing through it, and we remove and reinsert it  (n) 100 # zombies =  (n 2 )  (n 2 )  (n 2 ) (in general, O(n 2 ))

A new approach to dynamic APSP (II) Main idea: For each pair x,y, maintain in a data structure the potentially uniform paths connecting x to y The combinatorial properties of potentially uniform paths imply that, if we do smoothing, we have only O(n 2 ) new potentially uniform paths per update, amortized… There exists and update algorithm that spends O(log n) time per potentially uniform path

Handling the hard case The shortest path is different (update = increase): xy ++ If we maintain potentially uniform paths using priority queues, we can find this path in O(1) time! EASY

The update algorithm Remove from the data structure all potentially uniform paths containing the updated edge 1 Use remaining potentially uniform paths to find an upper bound to the distances after the update 2 Propagate changes in waves from the updated edge, finding the new potentially uniform paths and the new distances 3

Conclusions Uniform paths are the heart of dynamic shortest pathsCombinatorially well-behaved in dynamic graphsNew approach based on maintaining potentially uniform paths Applications to Railway Optimization Problems?Solves the problem in its full generality