This project finds the shortest path between two nodes in a weighted graph using Dijkstra's algorithm implemented from scratch (no libraries). It demonstrates algorithmic thinking, graph representation, and path reconstruction.
Dijkstra's algorithm systematically updates distances to each vertex starting from a source node, selecting the unvisited vertex with the smallest current distance each time.
- Number of vertices and edges
- Each edge as (u, v, weight)
- Source vertex
Displays the shortest distance and path to every vertex from the source.
- Time: O(V²)
- Space: O(V + E)