Function Dijkstra(src): visited_costs = new hash table frontier = new min priority queue add 0:src to frontier While frontier not empty: cost_to_vertex = next priority in frontier vertex = remove from frontier If vertex not in visited_costs add vertex:cost_to_vertex to visited_costs For each neighbor of vertex: If neighbor not in visited_costs: total_cost = cost_to_vertex + edge(vertex,neighbor).cost add cost:neighbor to frontier End If End For End If End While return visited_costs End Function