Dijkstra's Algorithm

How it Works

Dijkstra's algorithm finds the shortest path between nodes in a weighted graph. It is a greedy algorithm that explores the closest unvisited vertices first.

Core Steps:

  1. Mark all nodes unvisited and set distance to infinity.
  2. Assign zero distance to the starting node.
  3. Select the unvisited node with the smallest current distance.
Graph Diagram

For a deeper dive, visit the Wikipedia Page.