SlideShare a Scribd company logo
2
Most read
7
Most read
10
Most read
Dijkstra’s Algorithm in Modern
Navigation and Autonomous
Vehicles
Oshrit Melako 209445303
Dorian Atlan 342517117
• To study and understand how Dijkstra's algorithm works and how it can be
appliedto routeplanningin roadnetworks for autonomous vehicles.
• To adapt the algorithm to account for real-time conditions such as traffic
congestion, trafficlight timings, andvariableroadconditions.
• EnhancingRoadSafety
Utilizing the algorithm not only to find the shortest route but also to avoid hazardous
areas, such as roads with high traffic volumes orzones with frequent accidents.
PROJECT GOALS
"Dijkstra’s Algorithm in modern navigation and autonomous
vehicles."
NAME OF THE
PROJECT:
WHAT IS DIJKSTRA'S
ALGORITHM?
Dijkstra's algorithm is an algorithm used to find the shortest path between a starting node (source)
and other nodes in a weighted graph. The algorithm works on graphs with edges that have non-
negative weights, and it uses a greedy approach by selecting the node with the shortest distance
at each step. During its execution, the algorithm updates the distances to neighboring nodes and
continues until all nodes are checked. At the end of the process, the shortest path to each node in
the graph is determined.
*The time complexity of the algorithm depends on the graph's density: for sparse graphs, it is O(V
log V) with a min-heap, while for dense graphs, it is O(V²) with an adjacency matrix.
Why is it relevant?
A key tool for optimizing route planning in autonomous vehicles.
HOW TO USE DIJKSTRA'S ALGORITHM
FOR PLANNING THE SHORTEST TRIP?
To use Dijkstra's algorithm to find the shortest path on a road,
you first need to construct a directed graph based on the
map. The nodes in the graph will represent the intersections
on the road, and the weight of each edge in the graph will be
defined as the distance between the connected intersections.
Prior, we need to process a map to make it suitable for computer vision,
allowing then its conversion into a directed graph.
There are various methods, some more practical than others. For research
purposes, we have tested multiple map samples and Python algorithms to
understand the most efficient way to process a map before applying Dijkstra’s
algorithm.
The overall algorithm consists of the following steps:
1.Read the image with OpenCV.
2.Convert it to grayscale.
3.Apply Gaussian blur.
4.Detect edges using the Canny edge detector.
5.Skeletonize the binary image.
6.Detect lines with the Hough Line Transform.
7.Visualize the detected lines on the image.
We’ll demonstrate the process from this map sample of Manhattan
Computer Vision-
Converting a map to a
graph
To apply this method, we will try to remove
unnecessary details from the map, making it
easier to differenciate roads from other
elements.
For this, we use OpenCV, an open-source
computer vision and machine learning library.
OpenCV provides a wide range of algorithms for
tasks like image processing, video analysis, and
object detection.
Method 1: Image Processing, edge
and intersection detection
A. Image Processing:
After opening the image, the first processing step
is converting the image to grayscale using
OpenCV’s COLOR_BGR2GRAY algorithm.
Image Processing
Next, we apply a slight blur to the map to reduce noise and unnecessary
details. This helps improve the performance of subsequent processing steps
by making it easier to isolate key features, such as roads.
Parameters of cv2.GaussianBlur:
• src: The input image, which in this case is the grayscale map.
• ksize: The kernel size, defined as (width, height). Here, a (5,5) kernel is
used.
• sigmaX: The standard deviation in the X direction. A value of 0 lets
OpenCV compute it automatically based on the kernel size.
Image Processing
Canny edge detection is a multi-stage algorithm designed to detect a
broad range of edges in images. It includes:
Gradient calculation: Identifies the intensity of the changes of pixels
in the picture.
Non-maximum suppression: Thins out the edges to retain only the
most relevant ones.
Edge tracking: Suppresses weak edges unless they are connected to
strong edges.
Parameters:
gray_map: The input grayscale image.
100, 200: The lower and upper thresholds, which control edge detection
sensitivity. Lower values detect more edges, while higher values detect
fewer but stronger edges.
Image Processing
Next step is Edge Detection:
Skeletonization is applied to the binary image obtained from Canny
edge detection. This process reduces the image to its skeletal form,
preserving the essential structure while minimizing thickness.
We use the skeletonize function from skimage.morphology for this
step:
Image
Processing
-
Skeleton
Before converting the map into a graph, we verify
the accuracy of line detection using OpenCV’s
cv2.HoughLinesP function, which implements the
Probabilistic Hough Line Transform to detect lines in
the skeletonized image.
With the algorithm cv2.HoughLinesP function we
detect lines in the skeletonized image. This function
implements the Probabilistic Hough Line Transform
Image Processing
-
Line Detection Checking
Prior Image
processing -
Conclusions and Decisions
•The result looks good enough to try an algorithm
that will detect those lines again to make it edge of
an actual graph, we need to look at the intersections
and hope they are sufficiently clear to be detected by
the algorithm but will it be accurate enough to allow
the algorithm to make an accurate graph ?
After first running the graph making
algorithm and start twitching the
parameters, we arrive to a result that let
us hope that we will arrive to a concrete
result. But still even by scaling to a
smaller area of the map, the line
detection is almost accurate, but not the
intersections detection.
Graph Making from
the processed images
Prior Image
processing -
Conclusions and Decisions
To arrive to our goals we let for a
moment the edge and intersection
detection and we created a tool to be
able to have at least few samples to
work on: We programmed a draph
drawer on top of an image (our map
sample)
Prior Image
processing -
Conclusions and Decisions
Dijkstra’s Algorithm (G,w,s)
for each vertex:
Distance[v]=infinite (the distance between every vertices), and
Source[vertices]= NIL
Distance[the vertex to start] = 0
S <-Empty group ; Q <- All vertices
Step 2 while Q Empty group
do u EXTRACT-MIN(Q)
←
if Distance[u] = infinite then break
S S Union {u}
←
for each vertex v Belongs to Adj[u] (which are the neighbors of the
vertex v) Belongs to Q
if d[u] + w(u,v) < d[v]:
d[v] = d[u] + w(u,v)
source[v]=u
return {Distance[v], source[v] : v Belongs to vertices}
CALLING DJIKSTRA ON
THE GRAPH IN THE
CODE
We are inputing the graph we just
made as a list of nodes and edges
in the python code, prior to call
Djikstra algorithm on it
DJIKSTRA
-
IMPLEMENTATION
AND RESULT
ANOTHER POSSIBLE
METHOD
–
SUPERVISED MACHINE LEARNING
HOME SERVICE ABOUTUS CONTACTUS
Another approach for detecting intersections is supervised
machine learning, using train and test sets to develop a
model capable of recognizing intersections.
Training Phase:
With a dedicated software we label examples of how an
intersection look, creating a data set that the model will
train on.
Testing Phase:
The trained model is then tested on new, unseen maps to
evaluate its accuracy in detecting intersections
PART2:DJIKSTRAIN
OBSTACLEAVOIDING
When an obstacle is detected on the road using computer vision (via
cameras and detection algorithms), Dijkstra’s algorithm helps reroute
the path safely.
By assigning weights to edges based on factors like distance, traffic
conditions, and obstacles, the algorithm dynamically recalculates the
optimal route, ensuring efficient navigation.
In this part, we will demonstrates how Djikstra’s Algorithm can be
helpfull in rerouting an autonomous vehicule in the contect of obstacle
avoidance
The field will be divided into a virtual grid, where
the vertices represent the grid’s intersections.
Any detected obstacle, such as vehicles or
pedestrians, will be removed from the grid,
ensuring that no path passes through them.
Edges will then be created between the remaining
vertices, forming a navigable network.
DJIKSTRA INOBSTACLE
AVOIDING
-
USECASE
DJIKSTRAINOBSTACLEAVOIDING
-
USECASE-RESULT
We’ll note that places where passing through is not possible
(blocked, dangerous, etc.) will not be represented as vertices, so
the algorithm will not calculate a path that goes through them.
Additionally, every specific distance on the map will be
represented by vertices.
For each time interval, the algorithm will be run again, with the
starting vertex being the current position of the vehicle and the
target vertex being the destination. We repeat the algorithm so
that changes that occur can be updated in real time.
After receiving the information from the algorithm, the
autonomous vehicle follows the instructions provided by the
algorithm to navigate accordingly. The sensors help ensure that
it follows the correct path, and make adjustments in real time
if there are changes in conditions.
Today, Dijkstra's algorithm is not used directly in most autonomous
vehicles in real-time, but it can be part of the overall path planning
process. Dijkstra is used to compute the shortest path between points
on a static map when there is no immediate need for dynamic response.
It can be useful for the initial planning stage of the route, such as
finding the most efficient way from one point to another before the
vehicle begins its journey or when the environment is not changing in
real-time. In most cases, after this stage, the vehicle will switch to other
algorithms like A* or MPC, which are capable of handling dynamic
obstacles and making real-time updates.
TO CONCLUDE

More Related Content

PPTX
Spanning Tree in data structure and .pptx
DOCX
artifical intelligence final paper
PPTX
Algo labpresentation a_group
PDF
Practical Digital Image Processing 3
PPTX
Dijkstra’S Algorithm
PPTX
Fakhre alam
PPTX
TRAFFIC MANAGEMENT THROUGH SATELLITE IMAGING-- Part 3
PPTX
208114036 l aser guided robo
Spanning Tree in data structure and .pptx
artifical intelligence final paper
Algo labpresentation a_group
Practical Digital Image Processing 3
Dijkstra’S Algorithm
Fakhre alam
TRAFFIC MANAGEMENT THROUGH SATELLITE IMAGING-- Part 3
208114036 l aser guided robo

Similar to Dijkstra’s Algorithm in modern navigation and autonomous vehicles (20)

PPTX
dms slide discrete mathematics sem 2 engineering
PPTX
project final ppt.pptx
PPTX
Image Processing Applied To Traffic Queue Detection Algorithm
PDF
LANE DETECTION USING IMAGE PROCESSING IN PYTHON
PPTX
Traffic sign detection via graph based ranking and segmentation
PDF
Robot navigation in unknown environment with obstacle recognition using laser...
PDF
Dijkstra Shortest Path Visualization
PDF
Hardware Unit for Edge Detection with Comparative Analysis of Different Edge ...
PDF
IRJET- Survey on Adaptive Routing Algorithms
PDF
A PROJECT REPORT ON REMOVAL OF UNNECESSARY OBJECTS FROM PHOTOS USING MASKING
PDF
Text Detection and Recognition in Natural Images
PDF
Flight-schedule using Dijkstra's algorithm with comparison of routes findings
PDF
Module-5-1_230523_171754 (1).pdf
PPTX
SEMINAR ON SHORTEST PATH ALGORITHMS.pptx
PDF
Implementation of D* Path Planning Algorithm with NXT LEGO Mindstorms Kit for...
PPTX
PPT.pptx
PDF
Large scale 3 d point cloud compression using adaptive radial distance predic...
PDF
LogicProgrammingShortestPathEfficiency
PPT
QDA_RTP_Traffic_ppt_final.ppt
PDF
Udacity-Didi Challenge Finalists
dms slide discrete mathematics sem 2 engineering
project final ppt.pptx
Image Processing Applied To Traffic Queue Detection Algorithm
LANE DETECTION USING IMAGE PROCESSING IN PYTHON
Traffic sign detection via graph based ranking and segmentation
Robot navigation in unknown environment with obstacle recognition using laser...
Dijkstra Shortest Path Visualization
Hardware Unit for Edge Detection with Comparative Analysis of Different Edge ...
IRJET- Survey on Adaptive Routing Algorithms
A PROJECT REPORT ON REMOVAL OF UNNECESSARY OBJECTS FROM PHOTOS USING MASKING
Text Detection and Recognition in Natural Images
Flight-schedule using Dijkstra's algorithm with comparison of routes findings
Module-5-1_230523_171754 (1).pdf
SEMINAR ON SHORTEST PATH ALGORITHMS.pptx
Implementation of D* Path Planning Algorithm with NXT LEGO Mindstorms Kit for...
PPT.pptx
Large scale 3 d point cloud compression using adaptive radial distance predic...
LogicProgrammingShortestPathEfficiency
QDA_RTP_Traffic_ppt_final.ppt
Udacity-Didi Challenge Finalists
Ad

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Cloud computing and distributed systems.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation theory and applications.pdf
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MYSQL Presentation for SQL database connectivity
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
Spectral efficient network and resource selection model in 5G networks
Programs and apps: productivity, graphics, security and other tools
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
The AUB Centre for AI in Media Proposal.docx
Understanding_Digital_Forensics_Presentation.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Ad

Dijkstra’s Algorithm in modern navigation and autonomous vehicles

  • 1. Dijkstra’s Algorithm in Modern Navigation and Autonomous Vehicles Oshrit Melako 209445303 Dorian Atlan 342517117
  • 2. • To study and understand how Dijkstra's algorithm works and how it can be appliedto routeplanningin roadnetworks for autonomous vehicles. • To adapt the algorithm to account for real-time conditions such as traffic congestion, trafficlight timings, andvariableroadconditions. • EnhancingRoadSafety Utilizing the algorithm not only to find the shortest route but also to avoid hazardous areas, such as roads with high traffic volumes orzones with frequent accidents. PROJECT GOALS "Dijkstra’s Algorithm in modern navigation and autonomous vehicles." NAME OF THE PROJECT:
  • 3. WHAT IS DIJKSTRA'S ALGORITHM? Dijkstra's algorithm is an algorithm used to find the shortest path between a starting node (source) and other nodes in a weighted graph. The algorithm works on graphs with edges that have non- negative weights, and it uses a greedy approach by selecting the node with the shortest distance at each step. During its execution, the algorithm updates the distances to neighboring nodes and continues until all nodes are checked. At the end of the process, the shortest path to each node in the graph is determined. *The time complexity of the algorithm depends on the graph's density: for sparse graphs, it is O(V log V) with a min-heap, while for dense graphs, it is O(V²) with an adjacency matrix. Why is it relevant? A key tool for optimizing route planning in autonomous vehicles.
  • 4. HOW TO USE DIJKSTRA'S ALGORITHM FOR PLANNING THE SHORTEST TRIP? To use Dijkstra's algorithm to find the shortest path on a road, you first need to construct a directed graph based on the map. The nodes in the graph will represent the intersections on the road, and the weight of each edge in the graph will be defined as the distance between the connected intersections.
  • 5. Prior, we need to process a map to make it suitable for computer vision, allowing then its conversion into a directed graph. There are various methods, some more practical than others. For research purposes, we have tested multiple map samples and Python algorithms to understand the most efficient way to process a map before applying Dijkstra’s algorithm. The overall algorithm consists of the following steps: 1.Read the image with OpenCV. 2.Convert it to grayscale. 3.Apply Gaussian blur. 4.Detect edges using the Canny edge detector. 5.Skeletonize the binary image. 6.Detect lines with the Hough Line Transform. 7.Visualize the detected lines on the image. We’ll demonstrate the process from this map sample of Manhattan Computer Vision- Converting a map to a graph
  • 6. To apply this method, we will try to remove unnecessary details from the map, making it easier to differenciate roads from other elements. For this, we use OpenCV, an open-source computer vision and machine learning library. OpenCV provides a wide range of algorithms for tasks like image processing, video analysis, and object detection. Method 1: Image Processing, edge and intersection detection A. Image Processing:
  • 7. After opening the image, the first processing step is converting the image to grayscale using OpenCV’s COLOR_BGR2GRAY algorithm. Image Processing
  • 8. Next, we apply a slight blur to the map to reduce noise and unnecessary details. This helps improve the performance of subsequent processing steps by making it easier to isolate key features, such as roads. Parameters of cv2.GaussianBlur: • src: The input image, which in this case is the grayscale map. • ksize: The kernel size, defined as (width, height). Here, a (5,5) kernel is used. • sigmaX: The standard deviation in the X direction. A value of 0 lets OpenCV compute it automatically based on the kernel size. Image Processing
  • 9. Canny edge detection is a multi-stage algorithm designed to detect a broad range of edges in images. It includes: Gradient calculation: Identifies the intensity of the changes of pixels in the picture. Non-maximum suppression: Thins out the edges to retain only the most relevant ones. Edge tracking: Suppresses weak edges unless they are connected to strong edges. Parameters: gray_map: The input grayscale image. 100, 200: The lower and upper thresholds, which control edge detection sensitivity. Lower values detect more edges, while higher values detect fewer but stronger edges. Image Processing Next step is Edge Detection:
  • 10. Skeletonization is applied to the binary image obtained from Canny edge detection. This process reduces the image to its skeletal form, preserving the essential structure while minimizing thickness. We use the skeletonize function from skimage.morphology for this step: Image Processing - Skeleton
  • 11. Before converting the map into a graph, we verify the accuracy of line detection using OpenCV’s cv2.HoughLinesP function, which implements the Probabilistic Hough Line Transform to detect lines in the skeletonized image. With the algorithm cv2.HoughLinesP function we detect lines in the skeletonized image. This function implements the Probabilistic Hough Line Transform Image Processing - Line Detection Checking
  • 12. Prior Image processing - Conclusions and Decisions •The result looks good enough to try an algorithm that will detect those lines again to make it edge of an actual graph, we need to look at the intersections and hope they are sufficiently clear to be detected by the algorithm but will it be accurate enough to allow the algorithm to make an accurate graph ?
  • 13. After first running the graph making algorithm and start twitching the parameters, we arrive to a result that let us hope that we will arrive to a concrete result. But still even by scaling to a smaller area of the map, the line detection is almost accurate, but not the intersections detection. Graph Making from the processed images Prior Image processing - Conclusions and Decisions
  • 14. To arrive to our goals we let for a moment the edge and intersection detection and we created a tool to be able to have at least few samples to work on: We programmed a draph drawer on top of an image (our map sample) Prior Image processing - Conclusions and Decisions
  • 15. Dijkstra’s Algorithm (G,w,s) for each vertex: Distance[v]=infinite (the distance between every vertices), and Source[vertices]= NIL Distance[the vertex to start] = 0 S <-Empty group ; Q <- All vertices Step 2 while Q Empty group do u EXTRACT-MIN(Q) ← if Distance[u] = infinite then break S S Union {u} ← for each vertex v Belongs to Adj[u] (which are the neighbors of the vertex v) Belongs to Q if d[u] + w(u,v) < d[v]: d[v] = d[u] + w(u,v) source[v]=u return {Distance[v], source[v] : v Belongs to vertices}
  • 16. CALLING DJIKSTRA ON THE GRAPH IN THE CODE We are inputing the graph we just made as a list of nodes and edges in the python code, prior to call Djikstra algorithm on it
  • 18. ANOTHER POSSIBLE METHOD – SUPERVISED MACHINE LEARNING HOME SERVICE ABOUTUS CONTACTUS Another approach for detecting intersections is supervised machine learning, using train and test sets to develop a model capable of recognizing intersections. Training Phase: With a dedicated software we label examples of how an intersection look, creating a data set that the model will train on. Testing Phase: The trained model is then tested on new, unseen maps to evaluate its accuracy in detecting intersections
  • 19. PART2:DJIKSTRAIN OBSTACLEAVOIDING When an obstacle is detected on the road using computer vision (via cameras and detection algorithms), Dijkstra’s algorithm helps reroute the path safely. By assigning weights to edges based on factors like distance, traffic conditions, and obstacles, the algorithm dynamically recalculates the optimal route, ensuring efficient navigation. In this part, we will demonstrates how Djikstra’s Algorithm can be helpfull in rerouting an autonomous vehicule in the contect of obstacle avoidance
  • 20. The field will be divided into a virtual grid, where the vertices represent the grid’s intersections. Any detected obstacle, such as vehicles or pedestrians, will be removed from the grid, ensuring that no path passes through them. Edges will then be created between the remaining vertices, forming a navigable network. DJIKSTRA INOBSTACLE AVOIDING - USECASE
  • 21. DJIKSTRAINOBSTACLEAVOIDING - USECASE-RESULT We’ll note that places where passing through is not possible (blocked, dangerous, etc.) will not be represented as vertices, so the algorithm will not calculate a path that goes through them. Additionally, every specific distance on the map will be represented by vertices. For each time interval, the algorithm will be run again, with the starting vertex being the current position of the vehicle and the target vertex being the destination. We repeat the algorithm so that changes that occur can be updated in real time. After receiving the information from the algorithm, the autonomous vehicle follows the instructions provided by the algorithm to navigate accordingly. The sensors help ensure that it follows the correct path, and make adjustments in real time if there are changes in conditions.
  • 22. Today, Dijkstra's algorithm is not used directly in most autonomous vehicles in real-time, but it can be part of the overall path planning process. Dijkstra is used to compute the shortest path between points on a static map when there is no immediate need for dynamic response. It can be useful for the initial planning stage of the route, such as finding the most efficient way from one point to another before the vehicle begins its journey or when the environment is not changing in real-time. In most cases, after this stage, the vehicle will switch to other algorithms like A* or MPC, which are capable of handling dynamic obstacles and making real-time updates. TO CONCLUDE