Skip to content

Implementing Dijkstra's Algorithm (shortest path algorithm) on a map using Python.

Notifications You must be signed in to change notification settings

shivansh1012/DijkstraOnMaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DijkstraOnMaps

Implementing Dijkstra's Algorithm for shortest path on a map.

Project Details

Maps - Map is taken/exported from OpenStreetMap while is a free and open service to use.
The file exported is in .osm format which is used in the program.

Algorithm - For Shortest Path we are using Dijkstra's Algorithm.
The connection between nodes are stored in a Nodes x Nodes adjacency Matrix.

Files

There are 2 files:

  • .py File can be compiled and run using ide.
  • .ipynb File open it in jupyter or colab and then compile all the cells.

Functioning

When Compiled the map is analysed and all the nodes are stored in a list.
Then an adjacency matrix of node x node is generated and mapped.
In this at first all the nodes are assumed start point and a path to other nodes are generated.

Then we ask user for the source node using a map automatically opened in a browser.
image
(Nodes are in green dots)

After that a multiple destination nodes are displayed to the user in the browser.
image (Blue dot is the source and red dots are the possible destination)

After the user selects a destination, the shortest path is displayed in the map.
image

The whole process is running in the console when the .py file is compiled.
image

About

Implementing Dijkstra's Algorithm (shortest path algorithm) on a map using Python.

Topics

Resources

Stars

Watchers

Forks