CSE 421 Greedy Algorithms Dijkstras Algorithm Yin Tat
- Slides: 38
CSE 421 Greedy Algorithms / Dijkstra’s Algorithm Yin Tat Lee 1
Single Source Shortest Path •
Dijkstra’s Algorithm: Example s 0 2 4 5 7 4 6 3 1 9 4 5 10 8 2 3 1 5 8
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 4 6 3 1 9 4 5 10 8 2 3 1 5 8
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 4 6 3 1 9 4 5 10 8 2 3 1 5 8
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 1 9 4 5 10 8 2 3 1 5 8
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 1 9 4 5 10 8 2 3 1 5 8
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 1 8 9 4 5 10 8 2 3 1 7 5 5 8
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 1 8 9 4 5 10 8 2 3 1 7 5 5 8
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 1 8 9 4 5 10 8 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 1 8 9 4 5 10 8 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 1 8 9 4 5 10 8 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 1 8 9 4 5 10 8 16 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 1 8 9 4 5 10 8 16 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 15 1 8 9 4 10 5 10 8 16 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 15 1 8 9 4 10 5 10 8 16 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 15 1 8 9 4 10 14 5 10 20 8 16 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 15 1 8 9 4 10 14 5 10 20 8 16 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 15 1 8 9 4 10 14 5 10 19 8 16 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 15 1 8 9 4 10 14 5 10 19 8 16 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 15 1 8 9 4 10 14 5 10 18 8 16 2 3 1 7 5 5 8 13
Dijkstra’s Algorithm: Example s 0 2 2 4 4 5 7 9 4 6 3 15 1 8 9 4 10 14 5 10 18 8 3 1 7 5 5 8 13 16 2 Dijkstra’s Algorithm outputs a tree.
Remarks on Dijkstra’s Algorithm •
Implementing Dijkstra’s Algorithm •
Disjkstra’s Algorithm: Correctness • y s x S u v
Dijkstra Example 1. 6 million vertices 3. 8 million edges Distance = travel time. Images comes from A. V. Goldberg
Dijkstra Example Searched Area (starting from green point)
340 ms Bidirectional Dijkstra Forward search Backward search
BFS Dijkstra
Estimating the distance
12 ms Forward search Backward search Inactive landmarks Active landmarks Problem of ATL: We should stick with highway! From now on, we allow to preprocess the graph.
30 ms Reach Algorithm Use highway except for the beginning and the end of the journey! Forward search Backward search
Creating shortcut in the graph When you are on the highway, don’t need to keep checking the map until you are nearby!
2 ms Reach + Shortcut Algorithm Forward search Backward search
0. 7 ms Reach + Shortcut + ATL Algorithm
- Yin tat lee
- Uw cse 421
- Cse 421
- Cse 421
- Greedy algorithms
- Advantage and disadvantage of greedy algorithm
- List of greedy algorithms
- Why is huffman coding greedy
- Activity selection problem greedy algorithm
- Huffman coding greedy algorithm
- Dynamic programming vs divide and conquer
- Activity selection problem greedy algorithm example
- Time complexity of greedy algorithm
- Greedy algorithm vs brute force
- Greedy algorithm definition
- Greedy snake algorithm
- Offline caching greedy algorithm
- Activity selection problem
- N/a greedy
- Greedy programming vs dynamic programming
- Workplace problems
- Amihood amir
- Coin change greedy algorithm proof
- Interval scheduling: greedy algorithm
- General principle of greedy algorithm
- What is greedy choice property
- Greedy algorithm
- Graphrel
- 0/1 knapsack problem using greedy method
- Greedy algorithm for job sequencing with deadlines
- Estimated blood volume
- Aae 421
- Epl 421
- Me 421
- Processist
- Ist 421
- Cmsc421
- Cs 421 uiuc
- Ist 421