MIKKEL THORUP 1999 Journal of the ACM Undirected Single-Source Shortest Paths with Positive Integer Weights in Linear Time.

Slides:



Advertisements
Similar presentations
Single Source Shortest Paths
Advertisements

1 A Faster Approximation Algorithm For The Steiner Problem In Graphs Kurt Mehlhorn. Information Processing Letters, 27(3):125–128, 高等演算法二
Shortest-paths. p2. Shortest-paths problems : G=(V,E) : weighted, directed graph w : E  R : weight function P=
1 Greedy 2 Jose Rolim University of Geneva. Algorithmique Greedy 2Jose Rolim2 Examples Greedy  Minimum Spanning Trees  Shortest Paths Dijkstra.
Tirgul 12 Algorithm for Single-Source-Shortest-Paths (s-s-s-p) Problem Application of s-s-s-p for Solving a System of Difference Constraints.
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.
CSE 421 Algorithms Richard Anderson Dijkstra’s algorithm.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Graph Algorithms: Shortest Path We are given a weighted, directed graph G = (V, E), with weight function w: E R mapping.
Shortest Path Algorithms
CSE 780 Algorithms Advanced Algorithms SSSP Dijkstra’s algorithm SSSP in DAGs.
CSE 421 Algorithms Richard Anderson Lecture 10 Minimum Spanning Trees.
Nondecreasing Paths in Weighted Graphs Or: How to optimally read a train schedule Virginia Vassilevska.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
Nondecreasing Paths in Weighted Graphs Or: How to optimally read a train schedule Virginia Vassilevska Carnegie Mellon UniversitySODA 2008.
1 Heaps Chapter 6 in CLRS. 2 Motivation Router: Dijkstra’s algorithm for single source shortest path Prim’s algorithm for minimum spanning trees.
TECH Computer Science Graph Optimization Problems and Greedy Algorithms Greedy Algorithms  // Make the best choice now! Optimization Problems  Minimizing.
Theory of Computing Lecture 7 MAS 714 Hartmut Klauck.
Graphs – Shortest Path (Weighted Graph) ORD DFW SFO LAX
Dynamic Single-source Shortest Paths Camil Demetrescu University of Rome “La Sapienza”
1 GRAPHS - ADVANCED APPLICATIONS Minimim Spanning Trees Shortest Path Transitive Closure.
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.
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.
Week -7-8 Topic - Graph Algorithms CSE – 5311 Prepared by:- Sushruth Puttaswamy Lekhendro Lisham.
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.
Data Structures Week 9 Towards Weighted BFS So, far we have measured d s (v) in terms of number of edges in the path from s to v. Equivalent to assuming.
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
SPANNING TREES Lecture 21 CS2110 – Spring
“On an Algorithm of Zemlyachenko for Subtree Isomorphism” Yefim Dinitz, Alon Itai, Michael Rodeh (1998) Presented by: Masha Igra, Merav Bukra.
All-Pairs Shortest Paths & Essential Subgraph 01/25/2005 Jinil Han.
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.
Dijkstra’s Algorithm Supervisor: Dr.Franek Ritu Kamboj
Introduction to Algorithms Jiafen Liu Sept
D IJKSTRA ' S ALGORITHM. S INGLE -S OURCE S HORTEST P ATH P ROBLEM Single-Source Shortest Path Problem - The problem of finding shortest paths from a.
Shortest Path Algorithms. Definitions Variants  Single-source shortest-paths problem: Given a graph, finding a shortest path from a given source.
Lecture 11 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
SPANNING TREES Lecture 21 CS2110 – Fall Nate Foster is out of town. NO 3-4pm office hours today!
Length of a Path The weight (length) of a path is the sum of the weights of its edges. adcbe Path p: Edge weights: w(a, b) = 7, w(b, c) = 2, w(c,
Single-Source Shortest Paths (25/24) HW: 25-2 and 25-3 p. 546/24-2 and 24-3 p.615 Given a graph G=(V,E) and w: E   weight of is w(p) =  w(v[i],v[i+1])
Undirected Single-Source Shortest Paths with Positive Integer Weights in Linear Time MIKKEL THORUP 1999 Journal of ACM.
Graphs 1 Neil Ghani University of Strathclyde. Where are we …. We studied lists: * Searching and sorting a list Then we studied trees: * Efficient search.
Minimum Spanning Tree Graph Theory Basics - Anil Kishore.
Graph Algorithms BFS, DFS, Dijkstra’s.
Discrete Optimization Lecture 1
Shortest Paths.
Algorithms (2IL15) – Lecture 5 SINGLE-SOURCE SHORTEST PATHS
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Lecture 22 CSE 331 Oct 23, 2017.
Lecture 24 CSE 331 Oct 29, 2012.
Autumn 2015 Lecture 10 Minimum Spanning Trees
Shortest path algorithm
Analysis of Algorithms
Minimum Spanning Tree Algorithms
Weighted Graphs & Shortest Paths
Autumn 2016 Lecture 10 Minimum Spanning Trees
Graph Algorithms: Shortest Path
Shortest Paths.
CSE 417: Algorithms and Computational Complexity
Implementation of Dijkstra’s Algorithm
Spanning Trees Lecture 20 CS2110 – Spring 2015.
Winter 2019 Lecture 10 Minimum Spanning Trees
Analysis of Algorithms
Premaster Course Algorithms 1 Chapter 6: Shortest Paths
More Graphs Lecture 19 CS2110 – Fall 2009.
Lecture 24 CSE 331 Oct 29, 2018.
Presentation transcript:

MIKKEL THORUP 1999 Journal of the ACM Undirected Single-Source Shortest Paths with Positive Integer Weights in Linear Time

Presenters 資訊四 巨彥霖 資訊四 羅婉嫣 資訊四 許恒瑞

Outline Introduction Preliminary Avoiding the Sorting Bottleneck The Component Hierarchy Visiting Minimal Vertices Towards Linear Time The Component Tree

Introduction(1) Mikkel Thorup

Introduction(2) Given a positively weighted graph G with a source vertex s, find the shortest path from s to all other vertices in the graph ingle S ource hortest ath problem S P S S Shortest path Shortest path Shortest path

Introduction(3) History Since 1959, all developments in SSSP have been based on Dijkstra’s algorithm (1959)

Dijkstra’s algorithm(1) Notation: G = (V, E) | v | = n, | E | = m weighted function l : edge  positive integer If (v, w) E, define l(v, w) = ∞ d(v) : distance from s to v D(v) : super distance D(v) ≧ d(v) D(v) : super distance a set S V v S : D(v) = d(v) v S : D(v) = min { d(u) + l(u, v) } ∞ d(v) 10 D(v) v can go to S u S

Dijkstra’s algorithm(2) V = { 0 v1 v2 v3 v4 v5 v6 v7 S = { v8 } } 4 ∞ ∞ ∞ ∞ ∞ 5 min min v1 v4 v3 v2 v7 v5v6 v8 Initially v1 v5 v3 v6 v2 v8 v7 v4 v1 v2 v7 v4 v8 v3 v5 v6 I n c r e a s i n g o r d e r visit

Introduction(3) History Dijkstra’s algorithm (1959) Simple : Applying William’s heap : (1964) Fredman & Tarjan Fibonacci heaps : (1987) Fredman & Willard’s fusion trees : (1993) O(m) our target !! Fredman & Willard’s atmoic heaps : (1994) Thorup’s priority queue : (1996) Raman : (1996)

Introduction(4) In fact, Dijkstra’s algorithm can be implemented in linear time  ( [Fredman & Tarjan 1987], [Thorup 1996] ) linear time sorting Since we do not know how to sort in linear time, this implies that we are deviating from Dijkstra’s algorithm in that we do not visit the vertices in order of increasing distance from s. Our algorithm is based on a hierarchical bucketing structure.  may visit the vertices in any order

Outline Introduction Preliminary Avoiding the Sorting Bottleneck The Component Hierarchy Visiting Minimal Vertices Towards Linear Time The Component Tree

Preliminary(1) Lemma 1 If v S\V minimize D(v), D(v) = d(v) Lemma 2 min D(V\S) = min d(V\s) is non-decreasing

Preliminary(2) Notation: x >> i is [ x / 2 ] If x ≦ y => x >> i ≦ y >> i If W V, minD(W) >> i is ( min { D(w) | w W }) >> i i

Preliminary(3) Bucket which elements can be inserted and deleted,and from which we can pick out an unspecified element. each operation should be supported in constant time.

Outline Introduction Preliminary Avoiding the Sorting Bottleneck The Component Hierarchy Visiting Minimal Vertices Towards Linear Time The Component Tree

Avoiding the Sorting Bottleneck(1) Dijkstra’s algorithm visit the vertices in order of increasing D(v) New approach visit the vertices where D(v) = d(v) D(v) ≧ min D(V\S)

Avoiding the Sorting Bottleneck(2) 0 ∞ ∞∞ 5 ∞ ∞4 V3V3 V2V2 V1V1 δ For some i, v V i \S, D(v) = min D(V i \S) ≦ min D(V\S) + δ d(v) = D(v)

index content … … Avoiding the Sorting Bottleneck(3) Criteria on D(v) = d(v) D(v) = min D(V i \S) ≦ min D(V\S) + δ <= min D(V i \S) ≦ min D(V\S) + 2 α > α ≦ min D(V\S) >> α Bucketing structure i min D(V i \S) >> α ix j D(v) ≦ Σ e l(e) Δ = Σ e l(e) >> α Δ+ 2 ∞

Avoiding the Sorting Bottleneck(4) SSSP algorithm A 0 ∞ ∞∞ ∞ ∞ ∞ ∞ V3V3 V2V2 V1V1 δ δ = 2 0, α = … … 5 ∞ 1 23 ix B(min D(Vi\S) >> α) = i min D(V\S) = min d(V\S) is nondecreasing 5

Avoiding the Sorting Bottleneck(5) SSSP algorithm A O(m + Δ) + cost of maintaining min D(V i \S) for each i Δ = Σe l(e) >> α δ = 2 α

Outline Introduction Preliminary Avoiding the Sorting Bottleneck The Component Hierarchy Visiting Minimal Vertices Towards Linear Time The Component Tree

The Component Hierarchy(1) Definition G i : the subgraph of G with l(e) < 2 i [v] i : the connected component on level i containing v children of [v] i : [w] i-1, w [v] i G o G 1 G 2 G 3 = G v [v] 1 v [v] 2 w [w] 1

The Component Hierarchy(2) Definition [v] i is a min-child of [v] i+1 if min D([v] i - ) >> i = min D([v] i+1 - ) >> i [v] i is minimal if [v] j is a min-child of [v] j+1 for j = i, …, b-1 [v] 2 [v] 1 v

The Component Hierarchy(3) Dijkstra’s algorithm visit v, if v V\S minimizes D(v) i, min D([v] i - ) >> i = D([v] i+1 - ) >> i = D(v) >> i => [v] 0 minimal minimal D(v) = d(v)[v] 0 minimal D(v) = d(v)[v] 0 minimal

The Component Hierarchy(4) lemma 8 If v S and [v] i is minimal, min D([v] i - ) = min d([v] i - ). In particular, D(v) = d(v) if [v] 0 = {v} is minimal.

Outline Introduction Preliminary Avoiding the Sorting Bottleneck The Component Hierarchy Visiting Minimal Vertices Towards Linear Time The Component Tree

Visiting Minimal Vertices(1) Definition visiting a vertex requires that [v] 0 = {v} is minimal when v is visited, v is moved to S and relax Lemma 10 For all [v] i, max d([v] i \[v] i - ) >> i-1 ≦ min d([v] i - ) >> i-1 Lemma 11 min D([v] i - ) >> i = min d([v] i - ) >> i, visiting w changes min D([v] i - ) >> i, and the change in min D([v] i - ) >> i is increased by one

Visiting Minimal Vertices(2) Lemma 12, 13 If [v] i has once been minimal, in all future, min D([v] i - ) >> i = min d([v] i - ) >> i

Visiting Minimal Vertices(3) SSSP algorithm B,C [s] 3 = G, i = 3 0 ∞ ∞ ∞ 5 4 ∞ ∞ d(w) >> i = min D([s] i - ) >> i min D([w] i-1 - ) >> i - 1 = min D([s] i - ) >> i - 1 Visit([s] i ) Visit([w] i-1 ) [s] 2, i = 2 s [s] 1, i = 1 [s] 0, i = 0 4 [w] i minimal

Visiting Minimal Vertices(4) Towards Linear Time !!

Outline Introduction Preliminary Avoiding the Sorting Bottleneck The Component Hierarchy Visiting Minimal Vertices Towards Linear Time The Component Tree

Towards Linear Time(1) Component tree ab c d e f a b c d e f Number of nodes

Towards Linear Time(2) Linear size bucket structure index content … … i ix j Δ = Σ e l(e) >> α Δ+ 2 ∞ ix 0 index content … … ix ∞

Towards Linear Time(3) Lemma 18. The total number of relevant buckets is < 4m + 4n Diameter of [v] I is bounded by => Define =>

Towards Linear Time(4) Lemma 18. The total number of relevant buckets is < 4m + 4n

Towards Linear Time(5)

Towards Linear Time(6) O(m)

Towards Linear Time(7)

Towards Linear Time(8) ix 0 index content … … ix ∞ O(m)

Towards Linear Time(9) Total: O(m) Total: O(n) Total: O(m)

Towards Linear Time(10) Assume that the component tree has been computed in linear time. Then no more than O(m) time and space is needed to solve the SSSP problem How to construct the component tree ?

Outline Introduction Preliminary Avoiding the Sorting Bottleneck The Component Hierarchy Visiting Minimal Vertices Towards Linear Time The Component Tree

The Component Tree(1)

The Component Tree(2) Use union-find operation Let e 1, …, e n-1 be the edges of M sorted according to

The Component Tree(3) v1v1 v2v2 v3v3 v4v4 v7v7 v5v5 v6v6 v8v8 v1v1 v2v2 v3v3 v4v4 v5v5 v6v6 v7v7 v8v8 v4,v5,v6 v7,v8 v4,v5,v6,v7,v8 v3, v2, v1,v2,v3,v4,v5,v6,v7,v8