Dijkstra's Algorithm: Shortest Paths in Weighted Graphs
Dijkstra's Algorithm
Finds shortest paths from a source to all vertices in a graph with non-negative edge weights.
Key idea: Greedily select the vertex with minimum distance, update neighbors.
Time complexity: O((V + E) log V) with binary heap
def dijkstra(graph, start):
"""
Dijkstra's algorithm using min-heap.
Works correctly for both undirected and directed graphs, including
directed graph
[Description truncada. Veja o README completo no GitHub.]