SlideShare a Scribd company logo
1 of 11
CS 332: Algorithms S-S Shortest Path:  Dijkstra’s Algorithm Disjoint-Set Union Amortized Analysis
Review:  Single-Source Shortest Path ,[object Object],[object Object],[object Object],[object Object]
Review: Shortest Path Properties ,[object Object],[object Object],[object Object]
Review: Relaxation ,[object Object],[object Object],[object Object],[object Object],[object Object],9 5 2 7 5 2 Relax 6 5 2 6 5 2 Relax
Review: Bellman-Ford Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Initialize d[], which will converge to  shortest-path value   Relaxation:  Make |V|-1 passes,  relaxing each edge Test for solution: have we converged yet? Ie,    negative cycle?
Review: Bellman-Ford Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],What will be the  running time?
Review: Bellman-Ford ,[object Object],[object Object],[object Object],[object Object]
DAG Shortest Paths ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dijkstra’s Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object]
Dijkstra’s Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Relaxation Step Note: this is really a  call to Q->DecreaseKey() B C D A 10 4 3 2 1 5 Ex: run the algorithm
The End

More Related Content

What's hot

Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9
Traian Rebedea
 
Algorithm Design and Complexity - Course 8
Algorithm Design and Complexity - Course 8Algorithm Design and Complexity - Course 8
Algorithm Design and Complexity - Course 8
Traian Rebedea
 

What's hot (20)

chapter24.ppt
chapter24.pptchapter24.ppt
chapter24.ppt
 
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt AlgorithmString Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
 
Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9Algorithm Design and Complexity - Course 9
Algorithm Design and Complexity - Course 9
 
Dynamics Kinematics Curvilinear Motion
Dynamics Kinematics Curvilinear MotionDynamics Kinematics Curvilinear Motion
Dynamics Kinematics Curvilinear Motion
 
Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
 
Prims and kruskal algorithms
Prims and kruskal algorithmsPrims and kruskal algorithms
Prims and kruskal algorithms
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
 
Prim's algorithm
Prim's algorithmPrim's algorithm
Prim's algorithm
 
Proyecto parcial iii_ proyecciones lineales
Proyecto parcial iii_ proyecciones linealesProyecto parcial iii_ proyecciones lineales
Proyecto parcial iii_ proyecciones lineales
 
Single source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstraSingle source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstra
 
Minimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiMinimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumi
 
Topological sorting
Topological sortingTopological sorting
Topological sorting
 
Shortest path
Shortest pathShortest path
Shortest path
 
Prims & kruskal algorithms
Prims & kruskal algorithmsPrims & kruskal algorithms
Prims & kruskal algorithms
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
 
Algorithm Design and Complexity - Course 8
Algorithm Design and Complexity - Course 8Algorithm Design and Complexity - Course 8
Algorithm Design and Complexity - Course 8
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
 
21 All Pairs Shortest Path
21 All Pairs Shortest Path21 All Pairs Shortest Path
21 All Pairs Shortest Path
 
2.3 shortest path dijkstra’s
2.3 shortest path dijkstra’s 2.3 shortest path dijkstra’s
2.3 shortest path dijkstra’s
 
Kruskal's algorithm
Kruskal's algorithmKruskal's algorithm
Kruskal's algorithm
 

Viewers also liked

Santosh Sahu_MTech_CSE
Santosh Sahu_MTech_CSESantosh Sahu_MTech_CSE
Santosh Sahu_MTech_CSE
Santosh Sahu
 
Lec1 Algorthm
Lec1 AlgorthmLec1 Algorthm
Lec1 Algorthm
humanist3
 
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Andrea Angella
 
Chapter25
Chapter25Chapter25
Chapter25
inddxp
 
Lec2 Algorth
Lec2 AlgorthLec2 Algorth
Lec2 Algorth
humanist3
 
Sets and disjoint sets union123
Sets and disjoint sets union123Sets and disjoint sets union123
Sets and disjoint sets union123
Ankita Goyal
 
Conformational analysis
Conformational analysisConformational analysis
Conformational analysis
Pinky Vincent
 

Viewers also liked (20)

20 Single Source Shorthest Path
20 Single Source Shorthest Path20 Single Source Shorthest Path
20 Single Source Shorthest Path
 
Santosh Sahu_MTech_CSE
Santosh Sahu_MTech_CSESantosh Sahu_MTech_CSE
Santosh Sahu_MTech_CSE
 
Lec1 Algorthm
Lec1 AlgorthmLec1 Algorthm
Lec1 Algorthm
 
Union find
Union findUnion find
Union find
 
Year 2 Organic Chemistry Mechanism and Stereochemistry Lecture 3 Conformation...
Year 2 Organic Chemistry Mechanism and Stereochemistry Lecture 3 Conformation...Year 2 Organic Chemistry Mechanism and Stereochemistry Lecture 3 Conformation...
Year 2 Organic Chemistry Mechanism and Stereochemistry Lecture 3 Conformation...
 
Mk ppt chapter 5
Mk ppt chapter 5Mk ppt chapter 5
Mk ppt chapter 5
 
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
 
Disjoint sets
Disjoint setsDisjoint sets
Disjoint sets
 
Introduction to the Internet of Things
Introduction to the Internet of ThingsIntroduction to the Internet of Things
Introduction to the Internet of Things
 
Lec32
Lec32Lec32
Lec32
 
Chapter25
Chapter25Chapter25
Chapter25
 
Lecture2
Lecture2Lecture2
Lecture2
 
Substructure Search Face-off
Substructure Search Face-offSubstructure Search Face-off
Substructure Search Face-off
 
Lec2 Algorth
Lec2 AlgorthLec2 Algorth
Lec2 Algorth
 
Advance Network Technologies
Advance Network TechnologiesAdvance Network Technologies
Advance Network Technologies
 
Sets and disjoint sets union123
Sets and disjoint sets union123Sets and disjoint sets union123
Sets and disjoint sets union123
 
Conformational analysis
Conformational analysisConformational analysis
Conformational analysis
 
Glutamate receptor
Glutamate receptorGlutamate receptor
Glutamate receptor
 
Big data lecture notes
Big data lecture notesBig data lecture notes
Big data lecture notes
 
Neuropharmacology: GABA & Glutamate
Neuropharmacology: GABA & GlutamateNeuropharmacology: GABA & Glutamate
Neuropharmacology: GABA & Glutamate
 

Similar to lecture 21

Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10
Traian Rebedea
 
Bellman ford Algorithm
Bellman ford AlgorithmBellman ford Algorithm
Bellman ford Algorithm
taimurkhan803
 
Unit26 shortest pathalgorithm
Unit26 shortest pathalgorithmUnit26 shortest pathalgorithm
Unit26 shortest pathalgorithm
meisamstar
 

Similar to lecture 21 (20)

Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10
 
Dijksatra
DijksatraDijksatra
Dijksatra
 
lec6.pptx
lec6.pptxlec6.pptx
lec6.pptx
 
Daa chpater14
Daa chpater14Daa chpater14
Daa chpater14
 
Dijkstra c
Dijkstra cDijkstra c
Dijkstra c
 
Shortest path
Shortest pathShortest path
Shortest path
 
Shortest Paths Part 2: Negative Weights and All-pairs
Shortest Paths Part 2: Negative Weights and All-pairsShortest Paths Part 2: Negative Weights and All-pairs
Shortest Paths Part 2: Negative Weights and All-pairs
 
Bellman ford Algorithm
Bellman ford AlgorithmBellman ford Algorithm
Bellman ford Algorithm
 
2.6 all pairsshortestpath
2.6 all pairsshortestpath2.6 all pairsshortestpath
2.6 all pairsshortestpath
 
dijkstraC.ppt
dijkstraC.pptdijkstraC.ppt
dijkstraC.ppt
 
Shortest Path Problem.docx
Shortest Path Problem.docxShortest Path Problem.docx
Shortest Path Problem.docx
 
SINGLE SOURCE SHORTEST PATH.ppt
SINGLE SOURCE SHORTEST PATH.pptSINGLE SOURCE SHORTEST PATH.ppt
SINGLE SOURCE SHORTEST PATH.ppt
 
bellman-ford Theorem.ppt
bellman-ford Theorem.pptbellman-ford Theorem.ppt
bellman-ford Theorem.ppt
 
Unit 5 session 2 MinimumSpanningTrees.ppt
Unit 5 session 2 MinimumSpanningTrees.pptUnit 5 session 2 MinimumSpanningTrees.ppt
Unit 5 session 2 MinimumSpanningTrees.ppt
 
Unit26 shortest pathalgorithm
Unit26 shortest pathalgorithmUnit26 shortest pathalgorithm
Unit26 shortest pathalgorithm
 
All pair shortest path by Sania Nisar
All pair shortest path by Sania NisarAll pair shortest path by Sania Nisar
All pair shortest path by Sania Nisar
 
Graphs
GraphsGraphs
Graphs
 
Topological Sort
Topological SortTopological Sort
Topological Sort
 
Ppt 1
Ppt 1Ppt 1
Ppt 1
 
04 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x204 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x2
 

More from sajinsc

lecture 30
lecture 30lecture 30
lecture 30
sajinsc
 
lecture 29
lecture 29lecture 29
lecture 29
sajinsc
 
lecture 28
lecture 28lecture 28
lecture 28
sajinsc
 
lecture 27
lecture 27lecture 27
lecture 27
sajinsc
 
lecture 26
lecture 26lecture 26
lecture 26
sajinsc
 
lecture 25
lecture 25lecture 25
lecture 25
sajinsc
 
lecture 24
lecture 24lecture 24
lecture 24
sajinsc
 
lecture 23
lecture 23lecture 23
lecture 23
sajinsc
 
lecture 19
lecture 19lecture 19
lecture 19
sajinsc
 
lecture 18
lecture 18lecture 18
lecture 18
sajinsc
 
lecture 17
lecture 17lecture 17
lecture 17
sajinsc
 
lecture 16
lecture 16lecture 16
lecture 16
sajinsc
 
lecture 15
lecture 15lecture 15
lecture 15
sajinsc
 
lecture 14
lecture 14lecture 14
lecture 14
sajinsc
 
lecture 13
lecture 13lecture 13
lecture 13
sajinsc
 
lecture 12
lecture 12lecture 12
lecture 12
sajinsc
 
lecture 11
lecture 11lecture 11
lecture 11
sajinsc
 
lecture 10
lecture 10lecture 10
lecture 10
sajinsc
 
lecture 9
lecture 9lecture 9
lecture 9
sajinsc
 
lecture 8
lecture 8lecture 8
lecture 8
sajinsc
 

More from sajinsc (20)

lecture 30
lecture 30lecture 30
lecture 30
 
lecture 29
lecture 29lecture 29
lecture 29
 
lecture 28
lecture 28lecture 28
lecture 28
 
lecture 27
lecture 27lecture 27
lecture 27
 
lecture 26
lecture 26lecture 26
lecture 26
 
lecture 25
lecture 25lecture 25
lecture 25
 
lecture 24
lecture 24lecture 24
lecture 24
 
lecture 23
lecture 23lecture 23
lecture 23
 
lecture 19
lecture 19lecture 19
lecture 19
 
lecture 18
lecture 18lecture 18
lecture 18
 
lecture 17
lecture 17lecture 17
lecture 17
 
lecture 16
lecture 16lecture 16
lecture 16
 
lecture 15
lecture 15lecture 15
lecture 15
 
lecture 14
lecture 14lecture 14
lecture 14
 
lecture 13
lecture 13lecture 13
lecture 13
 
lecture 12
lecture 12lecture 12
lecture 12
 
lecture 11
lecture 11lecture 11
lecture 11
 
lecture 10
lecture 10lecture 10
lecture 10
 
lecture 9
lecture 9lecture 9
lecture 9
 
lecture 8
lecture 8lecture 8
lecture 8
 

Recently uploaded

Recently uploaded (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

lecture 21

  • 1. CS 332: Algorithms S-S Shortest Path: Dijkstra’s Algorithm Disjoint-Set Union Amortized Analysis
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.