SlideShare a Scribd company logo
Dijkstra’s Shortest Path Algorithm
Presented By:
Tamzida Azad
ID: …………..
Section: …………..
Presented To:
Dr. Selina Sharmin
Associate Professor
Department of Computer Science & Engineering
Table of Contents
2
Serial Topic Slide Number
1 Creator of Dijkstra Algorithm 3
2 What is Dijkstra’s Algorithm? 4
4 Dijkstra’s Algorithm 5
5 Pseudo Code 6
6 How Dijkstra’s Algorithm Works? 7
7 Example 8-13
8 Example 14-17
9 Dijkstra’s Algorithm Complexity 20
10 Application of Dijkstra’s Algorithm 21-23
11 Different Shortest Path Algorithm’s Complexity Analysis 24
12 Advantage & Disadvantage of Dijkstra’s Algorithm 25
13 Q/A session 26
Creator of Dijkstra’s Algorithm
 Designed by Dutch physicist Edsger Wybe Dijkstra in 1956
 Received Turing award in 1972 for fundamental contributions to programming
as a high, intellectual challenge
 The Edsger W. Dijkstra Paper Prize in Distributed Computing is given for outstanding papers
on the principles of distributed computing
 Famous Quote:
“Computer Science is no more about computers than astronomy is about telescopes."
3
Edsger Wybe Dijkstra
Why Dijkstra’s Algorithm?
 Used to solve the single source shortest path problem
 Finds the shortest distance between two vertices on a graph
 Creates tree of shortest paths from starting source vertex to all other points in the graph
 Works on both directed and undirected graphs
 Differs from minimum spanning tree
 Similar to BFS
 Gives optimal solution using greedy method
4
Dijkstra’s Algorithm
 Approach: Greedy
 Input: Weighted graph G={E,V} and source vertex v∈V, such that all edge weights are
nonnegative
 Output: Lengths of shortest paths (or the shortest paths themselves) from a given source
vertex v∈V to all other vertices
5
6
Dijkstra’s Algorithm Pseudo Code
7
How Dijkstra’s Algorithm Works
Example of Dijkstra’s Algorithm
8
Example Continues…
9
Example Continues…
10
Example Continues…
11
Example Continues…
12
Example Continues…
13
Example Continues…
14
Example Continues…
15
Example Continues…
16
Example Continues…
17
Dijkstra's Algorithm Complexity
 Time Complexity: O(𝑉2
)
With min priority queue time complexity is O(V + E Log V)
E = Number of edges and
V = Number of vertices
 Space Complexity: O(V)
18
19
Digital Mapping Services in Google Maps
 Used to find the minimum distance between two
locations along the path.
 Example:
Finding shortest route between Uttara to
Mohammadpur using Google Map.
20
Social Networking Applications
 Apps suggesting friends to connect
 Uses the shortest path between users measured
through handshakes or connections among them.
21
Telephone Network
 Used in network bandwidth measurement
 If a city is a graph, the vertices represent the
switching stations, and the edges represent the
transmission lines.
22
IP routing
 Finds the best path between the source and the
destination router
 Used to update forwarding table
 Provides the shortest cost path from the source
router to other routers
23
24
Comparing Complexity of Different Shortest Path Algorithm
Advantage and Disadvantage of Dijkstra’s Algorithm
Advantage
 O(𝑛2
) so efficient enough to use for relatively
large problems
 Used enormously in Google Map, IP routing,
robotic path detection, file server etc
 Low complexity, optimal and uniform
 Almost linear and works for both directed &
undirected graph.
Disadvantage
 Consume time by doing blind search
 Can not handle negative edges
 Leads to acyclic graphs
25
Any Question
27

More Related Content

PPTX
Dijkstra’S Algorithm
PPTX
Dijkstra's Algorithm
PPTX
Dijkstra's algorithm presentation
PDF
Dijkstra's Algorithm
PPT
Minimum spanning tree
PPTX
Dijkstra's algorithm
PPTX
Multimedia
PPTX
Dijkstra’s algorithm
Dijkstra’S Algorithm
Dijkstra's Algorithm
Dijkstra's algorithm presentation
Dijkstra's Algorithm
Minimum spanning tree
Dijkstra's algorithm
Multimedia
Dijkstra’s algorithm

What's hot (20)

PPTX
Dijkstra s algorithm
PPTX
Shortest path algorithm
PPTX
Dijkstra algorithm a dynammic programming approach
PPTX
Shortest path algorithm
PDF
Algorithms Lecture 7: Graph Algorithms
PDF
Shortest Path in Graph
PPTX
Greedy algorithms
PPT
B trees in Data Structure
PPTX
A presentation on prim's and kruskal's algorithm
PPTX
Bellman ford Algorithm
PPTX
All pair shortest path
PDF
Time and Space Complexity
PPT
Graph algorithm
PDF
All pairs shortest path algorithm
PPT
Floyd Warshall Algorithm
PPTX
DAA-Floyd Warshall Algorithm.pptx
PPT
Prim's Algorithm on minimum spanning tree
PPT
Randomized algorithms ver 1.0
PPTX
Graph theory
PPTX
Bfs and Dfs
Dijkstra s algorithm
Shortest path algorithm
Dijkstra algorithm a dynammic programming approach
Shortest path algorithm
Algorithms Lecture 7: Graph Algorithms
Shortest Path in Graph
Greedy algorithms
B trees in Data Structure
A presentation on prim's and kruskal's algorithm
Bellman ford Algorithm
All pair shortest path
Time and Space Complexity
Graph algorithm
All pairs shortest path algorithm
Floyd Warshall Algorithm
DAA-Floyd Warshall Algorithm.pptx
Prim's Algorithm on minimum spanning tree
Randomized algorithms ver 1.0
Graph theory
Bfs and Dfs
Ad

Similar to Dijkstra's Algorithm (20)

PPTX
Algo labpresentation a_group
PPTX
Dijkastra’s algorithm
PPTX
Dijkstras-Algorithm-Finding-the-Shortest-Path.pptx
PPTX
SEMINAR ON SHORTEST PATH ALGORITHMS.pptx
PDF
Flight-schedule using Dijkstra's algorithm with comparison of routes findings
PPTX
Spanning Tree in data structure and .pptx
PPT
barrera.ppt
PPT
barrera.ppt
PPTX
dms slide discrete mathematics sem 2 engineering
PDF
Implementation of dijsktra’s algorithm in parallel
PPTX
Shortest-Path Problems - Graph Theory in Computer Applications
PPTX
Dijkstra & flooding ppt(Routing algorithm)
PDF
AN EFFECT OF USING A STORAGE MEDIUM IN DIJKSTRA ALGORITHM PERFORMANCE FOR IDE...
PPT
dijkstra algo.ppt
PPTX
Dijkstra’s Algorithm and Prim’s Algorithm in Graph Theory and Combinatorics
PPTX
Dijkstra’s Algorithm and Prim’s Algorithm in Graph Theory and Combinatorics
PDF
Comparative Analysis of Algorithms for Single Source Shortest Path Problem
PPTX
Deixtras Algorithm.pptxdjjdjdjdjddddddddddddddd
PDF
Cnetwork
PPTX
Application of Dijkstra Algorithm in Robot path planning
Algo labpresentation a_group
Dijkastra’s algorithm
Dijkstras-Algorithm-Finding-the-Shortest-Path.pptx
SEMINAR ON SHORTEST PATH ALGORITHMS.pptx
Flight-schedule using Dijkstra's algorithm with comparison of routes findings
Spanning Tree in data structure and .pptx
barrera.ppt
barrera.ppt
dms slide discrete mathematics sem 2 engineering
Implementation of dijsktra’s algorithm in parallel
Shortest-Path Problems - Graph Theory in Computer Applications
Dijkstra & flooding ppt(Routing algorithm)
AN EFFECT OF USING A STORAGE MEDIUM IN DIJKSTRA ALGORITHM PERFORMANCE FOR IDE...
dijkstra algo.ppt
Dijkstra’s Algorithm and Prim’s Algorithm in Graph Theory and Combinatorics
Dijkstra’s Algorithm and Prim’s Algorithm in Graph Theory and Combinatorics
Comparative Analysis of Algorithms for Single Source Shortest Path Problem
Deixtras Algorithm.pptxdjjdjdjdjddddddddddddddd
Cnetwork
Application of Dijkstra Algorithm in Robot path planning
Ad

Recently uploaded (20)

PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
Introduction to Knowledge Engineering Part 1
PPT
Reliability_Chapter_ presentation 1221.5784
PDF
Foundation of Data Science unit number two notes
PPTX
Computer network topology notes for revision
PDF
Mega Projects Data Mega Projects Data
PPTX
Business Acumen Training GuidePresentation.pptx
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
IBA_Chapter_11_Slides_Final_Accessible.pptx
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Introduction-to-Cloud-ComputingFinal.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Introduction to Knowledge Engineering Part 1
Reliability_Chapter_ presentation 1221.5784
Foundation of Data Science unit number two notes
Computer network topology notes for revision
Mega Projects Data Mega Projects Data
Business Acumen Training GuidePresentation.pptx
oil_refinery_comprehensive_20250804084928 (1).pptx
Galatica Smart Energy Infrastructure Startup Pitch Deck
Miokarditis (Inflamasi pada Otot Jantung)
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...

Dijkstra's Algorithm

  • 1. Dijkstra’s Shortest Path Algorithm Presented By: Tamzida Azad ID: ………….. Section: ………….. Presented To: Dr. Selina Sharmin Associate Professor Department of Computer Science & Engineering
  • 2. Table of Contents 2 Serial Topic Slide Number 1 Creator of Dijkstra Algorithm 3 2 What is Dijkstra’s Algorithm? 4 4 Dijkstra’s Algorithm 5 5 Pseudo Code 6 6 How Dijkstra’s Algorithm Works? 7 7 Example 8-13 8 Example 14-17 9 Dijkstra’s Algorithm Complexity 20 10 Application of Dijkstra’s Algorithm 21-23 11 Different Shortest Path Algorithm’s Complexity Analysis 24 12 Advantage & Disadvantage of Dijkstra’s Algorithm 25 13 Q/A session 26
  • 3. Creator of Dijkstra’s Algorithm  Designed by Dutch physicist Edsger Wybe Dijkstra in 1956  Received Turing award in 1972 for fundamental contributions to programming as a high, intellectual challenge  The Edsger W. Dijkstra Paper Prize in Distributed Computing is given for outstanding papers on the principles of distributed computing  Famous Quote: “Computer Science is no more about computers than astronomy is about telescopes." 3 Edsger Wybe Dijkstra
  • 4. Why Dijkstra’s Algorithm?  Used to solve the single source shortest path problem  Finds the shortest distance between two vertices on a graph  Creates tree of shortest paths from starting source vertex to all other points in the graph  Works on both directed and undirected graphs  Differs from minimum spanning tree  Similar to BFS  Gives optimal solution using greedy method 4
  • 5. Dijkstra’s Algorithm  Approach: Greedy  Input: Weighted graph G={E,V} and source vertex v∈V, such that all edge weights are nonnegative  Output: Lengths of shortest paths (or the shortest paths themselves) from a given source vertex v∈V to all other vertices 5
  • 18. Dijkstra's Algorithm Complexity  Time Complexity: O(𝑉2 ) With min priority queue time complexity is O(V + E Log V) E = Number of edges and V = Number of vertices  Space Complexity: O(V) 18
  • 19. 19
  • 20. Digital Mapping Services in Google Maps  Used to find the minimum distance between two locations along the path.  Example: Finding shortest route between Uttara to Mohammadpur using Google Map. 20
  • 21. Social Networking Applications  Apps suggesting friends to connect  Uses the shortest path between users measured through handshakes or connections among them. 21
  • 22. Telephone Network  Used in network bandwidth measurement  If a city is a graph, the vertices represent the switching stations, and the edges represent the transmission lines. 22
  • 23. IP routing  Finds the best path between the source and the destination router  Used to update forwarding table  Provides the shortest cost path from the source router to other routers 23
  • 24. 24 Comparing Complexity of Different Shortest Path Algorithm
  • 25. Advantage and Disadvantage of Dijkstra’s Algorithm Advantage  O(𝑛2 ) so efficient enough to use for relatively large problems  Used enormously in Google Map, IP routing, robotic path detection, file server etc  Low complexity, optimal and uniform  Almost linear and works for both directed & undirected graph. Disadvantage  Consume time by doing blind search  Can not handle negative edges  Leads to acyclic graphs 25
  • 27. 27