Dijkstra Algorithm

Dijkstra Algorithm is one of the most widely used algorithms to find the Shortest Path from the source to the destination node, by ignoring all other routes in a graph. Basically, based on Greedy approach to find the shortest path for the destination node.

Steps:

  1. All of the nodes in a graph must be marked as not visited or unvisited.
  2. All nodes must be initialized with INFINITE distance. Starting node must hold Zero as its value.
  3. Mark out the Starting node as the Current node.
  4. From the current node, search for all unvisited adjacent nodes and calculate the distance till you get shorted path.
  5. Finally, pick your minimum distance path and your job is done.

Note: Search for projects and codes related to Dijkstra algorithm, implement emm all and add it to your github account.


Ohh by the way, I am writing this at 5:00 AM IST (Cause I am High on Medicine)

#Dijkstra #Algorithm #DSA

To view or add a comment, sign in

Explore content categories