Find the shortest path between two vertices using Dijkstra's algorithm on a weighted edge list.
Dijkstra's algorithm finds the shortest path from a source vertex to all other vertices in a weighted graph with non-negative edge weights. It works by greedily selecting the unvisited vertex with the smallest tentative distance.
For each unvisited vertex u with min distance d[u]: for each neighbor v, if d[u]+w(u,v) < d[v], update d[v]
No. For graphs with negative edges, use the Bellman-Ford algorithm. Dijkstra assumes all edge weights are non-negative.
O(V²) with a simple array, or O((V+E) log V) with a priority queue, where V is vertices and E is edges.