Maintaining Shortest Paths in Digraphs with Arbitrary Arc Weights University of Rome “La Sapienza” C. Demetrescu D. Frigioni A. Marchetti-Spaccamela U.

Slides:



Advertisements
Similar presentations
Bellman-Ford algorithm
Advertisements

1 Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 19 Prof. Erik Demaine.
Single Source Shortest Paths
October 31, Algorithms and Data Structures Lecture XIII Simonas Šaltenis Nykredit Center for Database Research Aalborg University
Advanced Algorithm Design and Analysis (Lecture 7) SW5 fall 2004 Simonas Šaltenis E1-215b
CS138A Single Source Shortest Paths Peter Schröder.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: CLRS “Intro.
Design and Analysis of Algorithms Single-source shortest paths, all-pairs shortest paths Haidong Xue Summer 2012, at GSU.
Dynamic All Pairs Shortest Paths Based on the following resources: Camil Demetrescu and Giuseppe F. Italiano (2004) A New Approach to Dynamic All Pairs.
Chapter 25: All-Pairs Shortest-Paths
CPSC 411, Fall 2008: Set 9 1 CPSC 411 Design and Analysis of Algorithms Set 9: More Graph Algorithms Prof. Jennifer Welch Fall 2008.
CS420 lecture twelve Shortest Paths wim bohm cs csu.
CSE 780 Algorithms Advanced Algorithms Shortest path Shortest path tree Relaxation Bellman-Ford Alg.
Lecture 20: Shortest Paths Shang-Hua Teng. Weighted Directed Graphs Weight on edges for distance
Lecture 19: Shortest Paths Shang-Hua Teng. Weighted Directed Graphs Weight on edges for distance
Jim Anderson Comp 122, Fall 2003 Single-source SPs - 1 Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph.
Shortest Paths Definitions Single Source Algorithms –Bellman Ford –DAG shortest path algorithm –Dijkstra All Pairs Algorithms –Using Single Source Algorithms.
1.1 Data Structure and Algorithm Lecture 11 Application of BFS  Shortest Path Topics Reference: Introduction to Algorithm by Cormen Chapter 25: Single-Source.
1 8-ShortestPaths Shortest Paths in a Graph Fundamental Algorithms.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
1 Advanced Algorithms All-pairs SPs DP algorithm Floyd-Warshall alg.
Shortest Path Algorithms
Shortest Paths Definitions Single Source Algorithms
Algorithms and Networks
1 Graph Algorithms Single source shortest paths problem Dana Shapira.
1 Routing Algorithms. 2 Outline zBellaman-Ford Algorithm zDijkstra Algorithm.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
All-Pairs Shortest Paths
Lecture 8 Shortest Path Shortest-path problems
CS 253: Algorithms Chapter 24 Shortest Paths Credit: Dr. George Bebis.
Shortest Paths1 C B A E D F
Tools for Planar Networks Grigorios Prasinos and Christos Zaroliagis CTI/University of Patras 3 rd Amore Research Seminar – Oegstgeest, The Netherlands,
The Shortest Path Problem
CS 473 All Pairs Shortest Paths1 CS473 – Algorithms I All Pairs Shortest Paths.
Graphs – Shortest Path (Weighted Graph) ORD DFW SFO LAX
Dynamic Single-source Shortest Paths Camil Demetrescu University of Rome “La Sapienza”
Using Dijkstra’s Algorithm to Find a Shortest Path from a to z 1.
David Luebke 1 9/13/2015 CS 332: Algorithms S-S Shortest Path: Dijkstra’s Algorithm Disjoint-Set Union Amortized Analysis.
1 Shortest Path Algorithms Andreas Klappenecker [based on slides by Prof. Welch]
Jim Anderson Comp 122, Fall 2003 Single-source SPs - 1 Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph.
5/27/03CSE Shortest Paths CSE Algorithms Shortest Paths Problems.
CS223 Advanced Data Structures and Algorithms 1 The Bellman-Ford Shortest Path Algorithm Neil Tang 03/11/2010.
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
Algorithms: Design and Analysis Summer School 2013 at VIASM: Random Structures and Algorithms Lecture 3: Greedy algorithms Phan Th ị Hà D ươ ng 1.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2012 Lecture 10.
Algorithm Course Dr. Aref Rashad February Algorithms Course..... Dr. Aref Rashad Part: 6 Shortest Path Algorithms.
Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph. Want to compute a shortest path for each possible.
Lecture 16. Shortest Path Algorithms
Introduction to Algorithms Jiafen Liu Sept
The single-source shortest path problem (SSSP) input: a graph G = (V, E) with edge weights, and a specific source node s. goal: find a minimum weight (shortest)
Minimum spanning trees (MST) Def: A spanning tree of a graph G is an acyclic subset of edges of G connecting all vertices in G. A sub-forest of G is an.
CSE 2331 / 5331 Topic 12: Shortest Path Basics Dijkstra Algorithm Relaxation Bellman-Ford Alg.
Shortest Path Algorithms. Definitions Variants  Single-source shortest-paths problem: Given a graph, finding a shortest path from a given source.
Engineering shortest path algorithms (a round trip between theory and experiments) Camil Demetrescu University of Rome “La Sapienza” Giuseppe F. Italiano.
Introduction to Algorithms All-Pairs Shortest Paths My T. UF.
CSCE 411 Design and Analysis of Algorithms Set 9: More Graph Algorithms Prof. Jennifer Welch Spring 2012 CSCE 411, Spring 2012: Set 9 1.
TIRGUL 10 Dijkstra’s algorithm Bellman-Ford Algorithm 1.
Graph Algorithms BFS, DFS, Dijkstra’s.
CSCE 411 Design and Analysis of Algorithms
Lecture 6 Shortest Path Problem.
Lecture 11 Topics Application of BFS Shortest Path
CSCE 411 Design and Analysis of Algorithms
Honors Track: Competitive Programming & Problem Solving Avoiding negative edges Steven Ge.
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
Lecture 6 Shortest Path Problem.
CSE 417: Algorithms and Computational Complexity
Lecture 12 Shortest Path.
Lecture 14 Minimum Spanning Tree (cont’d)
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
Data Structures and Algorithm Analysis Lecture 8
Presentation transcript:

Maintaining Shortest Paths in Digraphs with Arbitrary Arc Weights University of Rome “La Sapienza” C. Demetrescu D. Frigioni A. Marchetti-Spaccamela U. Nanni

Fully Dynamic Single-source Shortest Paths Perform intermixed sequence of operations: s  V source node G = (V,E,w)weighted directed graphLet: Increase(u,v,  ): Increase weight w(u,v) by  Decrease(u,v,  ): Decrease weight w(u,v) by  Query(v): Return shortest path from s to v in G w(u,v)   weight of edge (u,v)

A Simple-minded Method use best static algorithm [Bellman-Ford] to recompute from scratch shortest paths in G After each Increase or Decrease : Can we do any better?  O(m·n) worst-case time ( n=|V|, m=|E| )

An Asymptotically Faster Method After each Increase or Decrease : O(m·n)O(m+n·log n) Thus: Use a reweighting technique to obtain from G a new graph G * with nonnegative weights 1.  O(m) Perform Dijkstra’s algorithm to compute from scratch shortest paths in G * 2.  O(m+n·log n) Retrieve shortest paths in G from shortest paths in G * 3.  O(n)

G * = (V,E,w * ) Reweighting A Reweighting Technique G = (V,E,w) w : E   Lemma 1: p is a shortest path in G  p is a shortest path in G * h : V   (arbitrary) w * (u,v) = w(u,v) + h(u) - h(v) [Edmonds, Karp]

A Reweighting Technique [Ramalingam and Reps] d(v) ≤ w(u,v) + d(u) 0 ≤ w(u,v) + d(u) - d(v) [Bellman] Proof: If we choose: h(v) := d(v) = distance from s to v Lemma 2: w * (u,v) = w(u,v) + d(u) - d(v) ≥ 0

Weight decrease [Ramalingam and Reps] v u T(v) -- Decreasing the weight of an edge might allow to find better paths out of T(v) Ramalingam and Reps: apply Dijkstra’s alg. to the graph G* (with modified weights)

Weight decrease (cont.) v u There exists a negat. cycle if and only if v is labelled again T(v) Ideas of ownership and k-bounded account. fct. can be applied reducing w.c.running time

Weight increase: Output Bounded Analysis Heuristic: Dijkstra only on nodes in T(v) Output bounded: Dijkstra only on nodes which change distance ++ Increase(u,v,+  )

Algorithms Under Evaluation BFSimple-minded method [Bellman-Ford] O(m·n)O(m+n·log n)DFReweighting method + Heuristic RR Reweighting method + Output Bounded O(m+n·log n) [Ramalingam, Reps] (Does not deal with zero length cycles) DFMN Reweighting method + Output Bounded [Frigioni, Marchetti, Nanni] O(m+n·log n) Update time TechniqueName

DF vs RR/DFMN L  nodes in T(v) Compute G* induced by nodes in L Run Dijkstra on G* Remove from L nodes which don’t change distance Heuristic Output- Bounded RR/DFMN DF Increase: Reweighting

Goals of Experimentation Look for hints about questions like: 1 We know that O(m+n·log n) is better than O(m·n)... 2 DFMN and RR are efficient in output-bounded complexity... … but what about constant factors? …but is it useful in practice?

DF vs RR/DFMN L  nodes in T(v) Compute G* induced by nodes in L Run Dijkstra on G* Remove from L nodes which don’t change distance Heuristic Output- Bounded RR/DFMN DF Increase: Reweighting L  nodes in T(v) Compute G* induced by nodes in L Run Dijkstra on G* Remove from L nodes which don’t change distance Heuristic Output- Bounded RR/DFMN DF Increase: Reweighting Is it useful?

Experimental Setup - Random graphs & random update sequences (Use potentials technique to avoid negative and zero-length cycles) Test sets: - C++ using LEDA, g++ compiler - UNIX Solaris on SPARC Ultra 10 at 300 Mhz Experimental platform: Performance indicators: - Running time (msec) - # nodes processed by Dijkstra’s algorithm

Constant Factors Are Small

# Nodes Processed by Dijkstra’s Algo

The Range of Arc Weights Is Important k

Small Arc Weights Range

Large Arc Weights Range

Extreme Case: All Zero-length Cycles...

Conclusions Dynamic algorithms based on the reweighting technique are very useful What happens on real test sets? What happens on larger test sets? Output bounded is useful for small ranges of arc weights In general, the simpler, the faster

BF Algorithms in a Nutshell ( Increase ) Bellman-Ford on G DF RR DFMN L  nodes in T(v) Run Dijkstra on G* L  nodes in T(v) Compute G* induced by nodes in L Run Dijkstra on G* Remove from L nodes which don’t change distance Compute G* induced by nodes in L Heuristic Output Bounded