Dijkstra’s Algorithm
Dijkstra’s Algorithm
ALGORITHM
PRESENTATION
GROUP 1
PRESENTATION
OUTLINE
1.INTRODUCTION
2.DESCRIPTION OF ALGORITHMS
3.ALGORITHM’S BASICS & EXAMPLE
4.EFFICIENCY
5.DISADVANTAGE
6.COMPARISON ALGORITHMS
7.APPLICATION
ABOUT AUTHOR
Edsger Wybe Dijkstra
1930-2002
INTRODUCTION
Graph
Representati
on
Greedy Distance
Nature Calculation
BASIC STEPS
• Initialize Distances
• Explore Neighbors
• Repeat
HOW IT WORKS?
This algorithm finds the path
with lowest cost between that
vertex and every other vertex.
For example, if the vertices of
the graph represent cities and
edge path costs represent
driving distances between pairs
of cities connected by a direct
road, Dijkstra's algorithm can be
used to find the shortest route
between one city and all other
cities.
VISUALIZATION
6
B E
2 9
3
A 5 1 C
0
8 3
D F
2
VISUALIZATION
6
B E
2 9
3
A 5 1 C
8 3
D F
2
VISUALIZATION
6
B E
2 9
3
A 5 1 C
8 3
D F
2
VISUALIZATION
6
B E
2 9
3
A 5 1 C
8 3
D F
2
VISUALIZATION
6
B E
2 9
3
A 5 1 C
8 3
D F
2
VISUALIZATION
6
B E
2 9
3
A 5 1 C
8 3
D F
2
VISUALIZATION
6
B E
2 9
3
A 5 1 C
8 3
D F
2
EFFICIENCY
The effi ciency of Dijkstra's
algorithm depends on the data
structure used for its priority
queue operations, as described
by Big-O notation:
• Fibonacci Heap
• Binary Heap
• Unordered Priority Queue
Comparison
optimized for finding the shortest path Bellman-Ford algorithm is optimized for A* algorithm is commonly used
between a single source node and all finding the shortest path between a in path finding and graph
Optimization other nodes in a graph with non- single source node and all other nodes traversal problems, such as
negative edge weights in a graph with negative edge weights. video games, robotics, and
planning algorithms.
Dijkstra’s algorithm is a single-source the Bellman-Ford algorithm relaxes A* algorithm is an informed search
shortest path algorithm that uses a all edges in each iteration, updating algorithm that uses a heuristic
Technique greedy approach and calculates the the distance of each node by function to guide the search towards
shortest path from the source node to considering all possible paths to that the goal node.
all other nodes in the graph. node
Dijkstra’s algorithm has a time complexity of Bellman-Ford algorithm has a time The time complexity of A* algorithm
Time Complexity O(V^2) for a dense graph and O(E log V) for a complexity of O(VE), where V is the depends on the quality of the
sparse graph, where V is the number of heuristic function.
number of vertices and E is the
vertices and E is the number of edges in the
graph.
number of edges in the graph.
Dijkstra’s algorithm does not work Bellman-Ford algorithm can handle A* Algorithm, on the other hand, is an
Negative Weights with graphs that have negative negative edge weights and can all-pairs shortest path algorithm that
edge weights, as it assumes that all detect negative-weight cycles in the calculate the shortest path between
edge weights are non-negative. graph. all pairs of nodes in the graph.
APPLICATION