SlideShare a Scribd company logo
4
Most read
6
Most read
8
Most read
Dijkstra Algorithms
Dijkstra Algorithm
• It is used for solving the single source shortest
path problem.
• It computes the shortest path from one particular
source node to all other remaining nodes of the
graph.
• Dijkstra algorithm works only for connected
graphs.
• It only provides the value or cost of the shortest
paths.
• Dijkstra algorithm works for directed as well as
undirected graphs.
Dijkstra Algorithm
function dijkstra(G, S)
for each vertex V in G
distance[V] <- infinite
previous[V] <- NULL
If V != S, add V to Priority Queue Q
distance[S] <- 0
while Q IS NOT EMPTY
U <- Extract MIN from Q
for each unvisited neighbour V of U
tempDistance <- distance[U] + edge_weight(U, V)
if tempDistance < distance[V]
distance[V] <- tempDistance
previous[V] <- U
return distance[], previous[]
Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptx
Dijkstra Searching Algorithms Shortest.pptx

More Related Content

PPTX
01 Knapsack using Dynamic Programming
PPTX
Dijkstra's algorithm presentation
PPTX
Minimum spanning Tree
PPTX
NP completeness
PDF
recursion tree method.pdf
PPT
Discrete mathematics
PPTX
Laplace transformation
PPT
Graphs - Discrete Math
01 Knapsack using Dynamic Programming
Dijkstra's algorithm presentation
Minimum spanning Tree
NP completeness
recursion tree method.pdf
Discrete mathematics
Laplace transformation
Graphs - Discrete Math

What's hot (20)

PPTX
FIRST ORDER DIFFERENTIAL EQUATION
PDF
A NEW METHOD OF CENTRAL DIFFERENCE INTERPOLATION
PPTX
LECTURE 2: PROPOSITIONAL EQUIVALENCES
PPTX
Merge sort algorithm
PPTX
L10 confidence intervals
PPTX
Hierarchical Routing In Computer Networks.pptx
DOCX
UNIT III.docx
PPT
probability
PPT
Maximum flow
PDF
8 random variable
PDF
Implementing the Perceptron Algorithm for Finding the weights of a Linear Dis...
PPTX
Application of differential and integral
PPTX
Interpolation and its applications
PDF
AI 4 | Informed Search
PPT
Skewness and Kurtosis
PPTX
Interpolation
PPTX
Lec 5 - Normality Testing.pptx
PPTX
Hamiltonian Circuit
PPTX
Greedy Algorithms
PDF
Partial Differential Equation - Notes
FIRST ORDER DIFFERENTIAL EQUATION
A NEW METHOD OF CENTRAL DIFFERENCE INTERPOLATION
LECTURE 2: PROPOSITIONAL EQUIVALENCES
Merge sort algorithm
L10 confidence intervals
Hierarchical Routing In Computer Networks.pptx
UNIT III.docx
probability
Maximum flow
8 random variable
Implementing the Perceptron Algorithm for Finding the weights of a Linear Dis...
Application of differential and integral
Interpolation and its applications
AI 4 | Informed Search
Skewness and Kurtosis
Interpolation
Lec 5 - Normality Testing.pptx
Hamiltonian Circuit
Greedy Algorithms
Partial Differential Equation - Notes
Ad

Similar to Dijkstra Searching Algorithms Shortest.pptx (20)

PPTX
Data structures and algorithms Dijkstra’s Algorithm (1).pptx
PPTX
Dijkstras-Algorithm-Finding-the-Shortest-Path.pptx
PPTX
Deixtras Algorithm.pptxdjjdjdjdjddddddddddddddd
PPTX
Dijkstra Algorithm Presentation -the shortest path finding algorithm.pptx
PPTX
SEMINAR ON SHORTEST PATH ALGORITHMS.pptx
PPTX
Algo labpresentation a_group
PPT
dijkstra algo.ppt
PPTX
Dijkstra’s algorithm
PPTX
Dijkstra's Algorithm
PDF
Dijkstra algorithm
PPT
Dijkstra's algorithm for computer science
PPT
Dijkstra c
PPTX
dms slide discrete mathematics sem 2 engineering
PDF
Dijkstra's Algorithm
PDF
01-05-2023, SOL_DU_MBAFT_6202_Dijkstra’s Algorithm Dated 1st May 23.pdf
PPT
Dijkstra algorithm ds 57612334t4t44.ppt
PPT
Dijkstra Shortest Path Algorithm in Network.ppt
PPT
dijkstraC.ppt
PPT
barrera.ppt
PPT
barrera.ppt
Data structures and algorithms Dijkstra’s Algorithm (1).pptx
Dijkstras-Algorithm-Finding-the-Shortest-Path.pptx
Deixtras Algorithm.pptxdjjdjdjdjddddddddddddddd
Dijkstra Algorithm Presentation -the shortest path finding algorithm.pptx
SEMINAR ON SHORTEST PATH ALGORITHMS.pptx
Algo labpresentation a_group
dijkstra algo.ppt
Dijkstra’s algorithm
Dijkstra's Algorithm
Dijkstra algorithm
Dijkstra's algorithm for computer science
Dijkstra c
dms slide discrete mathematics sem 2 engineering
Dijkstra's Algorithm
01-05-2023, SOL_DU_MBAFT_6202_Dijkstra’s Algorithm Dated 1st May 23.pdf
Dijkstra algorithm ds 57612334t4t44.ppt
Dijkstra Shortest Path Algorithm in Network.ppt
dijkstraC.ppt
barrera.ppt
barrera.ppt
Ad

More from sandeep54552 (20)

PPTX
E_R-Diagram (2).pptx
PPTX
Dijkstra Searching Algorithms.pptx
PPTX
DFS_New.pptx
PPT
Agents_AI.ppt
PPT
YCMOU_FYBCA_DS_Unit-7.ppt
PPTX
Queue_Data_Structure.pptx
PPTX
Tree_Definition.pptx
PPTX
Stack_Application_Infix_Prefix.pptx
PPTX
Stack_Data_Structure.pptx
PPTX
Heap_Sort1.pptx
PPTX
Quick_sort1.pptx
PPTX
Link_List.pptx
PPTX
Templates in c++
PPTX
File handling in c++
PPTX
Exception handling in c++
PPTX
Inheritance in c++
PPTX
Constructor and Destructors in C++
PPTX
C++ programming introduction
PPTX
Jsp tag library
PDF
Hill climbing algorithm in artificial intelligence
E_R-Diagram (2).pptx
Dijkstra Searching Algorithms.pptx
DFS_New.pptx
Agents_AI.ppt
YCMOU_FYBCA_DS_Unit-7.ppt
Queue_Data_Structure.pptx
Tree_Definition.pptx
Stack_Application_Infix_Prefix.pptx
Stack_Data_Structure.pptx
Heap_Sort1.pptx
Quick_sort1.pptx
Link_List.pptx
Templates in c++
File handling in c++
Exception handling in c++
Inheritance in c++
Constructor and Destructors in C++
C++ programming introduction
Jsp tag library
Hill climbing algorithm in artificial intelligence

Recently uploaded (20)

PPTX
Digestion and Absorption of Carbohydrates, Proteina and Fats
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PPTX
Lesson notes of climatology university.
PDF
Classroom Observation Tools for Teachers
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
Introduction to Building Materials
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
Trump Administration's workforce development strategy
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
IGGE1 Understanding the Self1234567891011
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
RMMM.pdf make it easy to upload and study
PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PDF
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation
Digestion and Absorption of Carbohydrates, Proteina and Fats
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
History, Philosophy and sociology of education (1).pptx
LDMMIA Reiki Yoga Finals Review Spring Summer
Lesson notes of climatology university.
Classroom Observation Tools for Teachers
Indian roads congress 037 - 2012 Flexible pavement
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Introduction to Building Materials
UNIT III MENTAL HEALTH NURSING ASSESSMENT
Trump Administration's workforce development strategy
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Paper A Mock Exam 9_ Attempt review.pdf.
IGGE1 Understanding the Self1234567891011
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
RMMM.pdf make it easy to upload and study
Unit 4 Skeletal System.ppt.pptxopresentatiom
SOIL: Factor, Horizon, Process, Classification, Degradation, Conservation

Dijkstra Searching Algorithms Shortest.pptx

  • 2. Dijkstra Algorithm • It is used for solving the single source shortest path problem. • It computes the shortest path from one particular source node to all other remaining nodes of the graph. • Dijkstra algorithm works only for connected graphs. • It only provides the value or cost of the shortest paths. • Dijkstra algorithm works for directed as well as undirected graphs.
  • 3. Dijkstra Algorithm function dijkstra(G, S) for each vertex V in G distance[V] <- infinite previous[V] <- NULL If V != S, add V to Priority Queue Q distance[S] <- 0 while Q IS NOT EMPTY U <- Extract MIN from Q for each unvisited neighbour V of U tempDistance <- distance[U] + edge_weight(U, V) if tempDistance < distance[V] distance[V] <- tempDistance previous[V] <- U return distance[], previous[]