Dijkstra's Shortest Path
Dijkstra's algorithm computes single-source shortest paths in graphs with non-negative edge weights. It repeatedly selects the unsettled vertex with the smallest tentative distance, relaxes its outgoing edges, and finalizes that distance. A priority queue is commonly used to efficiently select the next vertex.
Requires non-negative edge weights.
Negative edges can invalidate the greedy finalization step.
Binary heap implementation: typically O((V+E) log V).
For sparse graphs, adjacency lists are preferred.
Bellman-Ford is appropriate when negative edges must be supported.