Shortest Path Problem - PowerPoint PPT Presentation

Loading...

PPT – Shortest Path Problem PowerPoint presentation | free to download - id: 56e384-YmY2Y



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Shortest Path Problem

Description:

Lecture 6 Dijkstra s Algorithm for the Shortest Path Problem Update 1 2 4 6 2 4 2 1 3 4 2 3 2 0 3 2 3 6 4 5 6 0 1 2 3 4 5 6 7 6 4 5 6 Choose Minimum ... – PowerPoint PPT presentation

Number of Views:1384
Avg rating:3.0/5.0
Slides: 77
Provided by: Leno358
Learn more at: http://www.utdallas.edu
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Shortest Path Problem


1
Lecture 6
  • Shortest Path Problem

2
s
t
3
Dynamic Programming
4
Dynamic Programming
Dijkstras Algorithm is motivated from a way to
implement of this dynamic programming.
5
Dynamic Programming
6
Lemma
Proof
7
Theorem
2
-1
-1
1
2
8
Counterexample
9
Smart Implementation
10
An Example
?
?
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
3
5
?
?
Initialize
Select the node with the minimum temporary
distance label.
11
Update Step
2
?
?
4
2
4
2
2
0
2
1
3
?
6
1
4
2
3
3
5
?
?
4
12
Choose u such that N_(u) S
2
?
4
4
2
2
2
0
2
1
3
?
1
6
4
2
3
3
5
?
4
13
Update Step
6
2
?
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
3
5
?
4
4
3
The predecessor of node 3 is now node 2
14
Choose u Such That N_(u) S
2
6
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
5
3
3
4
15
Update
2
6
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
5
3
3
4
d(5) is not changed.
16
Choose u s.t . N_(u) S
2
6
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
3
5
3
4
17
Update
2
6
4
2
4
2
2
0
6
2
1
3
?
1
6
4
2
3
3
5
3
4
d(4) is not changed
18
Choose u s.t. N_(u) S
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
19
Update
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
d(6) is not updated
20
Choose u s.t. N_(u) S
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
There is nothing to update
21
End of Algorithm
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
All nodes are now permanent
The predecessors form a tree
The shortest path from node 1 to node 6 can be
found by tracing back predecessors
22
Dijkstras Algorithm
23
Dijkstras Algorithm
24
Lemma
25
Lemma
26
Proof of Lemma
T
w
u
S
s
27
Theorem
28
Counterexample
3
-1
-2
1
2
29
(No Transcript)
30
(No Transcript)
31
(No Transcript)
32
(No Transcript)
33
(No Transcript)
34
(No Transcript)
35
(No Transcript)
36
(No Transcript)
37
  • Dijkstras Algorithm

38
An Example
?
?
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
3
5
?
?
Initialize
Select the node with the minimum temporary
distance label.
39
Update Step
2
?
?
4
2
4
2
2
0
2
1
3
?
6
1
4
2
3
3
5
?
?
4
40
Choose Minimum Temporary Label
2
?
4
4
2
2
2
0
2
1
3
?
1
6
4
2
3
3
5
?
4
41
Update Step
6
2
?
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
3
5
?
4
4
3
The predecessor of node 3 is now node 2
42
Choose Minimum Temporary Label
2
6
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
5
3
3
4
43
Update
2
6
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
5
3
3
4
d(5) is not changed.
44
Choose Minimum Temporary Label
2
6
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
3
5
3
4
45
Update
2
6
4
2
4
2
2
0
6
2
1
3
?
1
6
4
2
3
3
5
3
4
d(4) is not changed
46
Choose Minimum Temporary Label
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
47
Update
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
d(6) is not updated
48
Choose Minimum Temporary Label
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
There is nothing to update
49
End of Algorithm
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
All nodes are now permanent
The predecessors form a tree
The shortest path from node 1 to node 6 can be
found by tracing back predecessors
50
(No Transcript)
51
(No Transcript)
52
(No Transcript)
53
(No Transcript)
54
(No Transcript)
55
(No Transcript)
56
(No Transcript)
57
(No Transcript)
58
(No Transcript)
59
(No Transcript)
60
  • Dijkstras Algorithm with simple buckets
  • (also known as Dials algorithm)

61
An Example
Initialize distance labels
4
2
4
2
2
Initialize buckets.
2
1
3
1
6
4
2
3
Select the node with the minimum temporary
distance label.
3
5
1
62
Update Step
2
?
?
4
2
4
2
2
0
2
1
3
?
6
1
4
2
3
3
5
?
?
4
1
2
3
63
Choose Minimum Temporary Label
Find Min by starting at the leftmost bucket and
scanning right till there is a non-empty bucket.
2
?
4
4
2
2
2
0
2
1
3
?
1
6
4
2
3
3
5
?
4
4
5
6
2
3
64
Update Step
6
2
?
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
3
5
?
4
4
3
4
5
6
3
2
3
4
5
65
Choose Minimum Temporary Label
Find Min by starting at the leftmost bucket and
scanning right till there is a non-empty bucket.
2
6
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
5
3
3
4
6
3
4
5
66
Update
2
6
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
5
3
3
4
6
3
4
5
67
Choose Minimum Temporary Label
2
6
4
2
4
2
2
0
2
1
3
?
1
6
4
2
3
3
5
3
4
6
4
5
68
Update
2
6
4
2
4
2
2
0
6
2
1
3
?
1
6
4
2
3
3
5
3
4
6
4
5
6
69
Choose Minimum Temporary Label
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
4
6
70
Update
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
4
6
71
Choose Minimum Temporary Label
2
6
4
2
4
There is nothing to update
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
6
72
End of Algorithm
2
6
4
2
4
2
2
0
2
1
3
6
1
6
4
2
3
3
5
3
4
All nodes are now permanent
The predecessors form a tree
The shortest path from node 1 to node 6 can be
found by tracing back predecessors
73
(No Transcript)
74
(No Transcript)
75
(No Transcript)
76
Implementations
  • With min-priority queue, Dijkstra algorithm can
    be
  • implemented in time
  • With Fibonacci heap, Dijkstra algorithm can be
    implemented
  • in time
  • With Radix heap, Dijkstra algorithm can be
    implemented
  • in time
About PowerShow.com