GoalScope — dijkstra (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def dijkstra(graph, start):↵
"""Dijkstra's Algorithm implementation"""↵
import heapq↵
queue = []↵
heapq.heappush(queue, (0, start))↵
distances = {vertex: float('infinity') for vertex in graph}↵
distances[start] = 0↵
↵
while queue:↵
current_distance, current_vertex = heapq.heappop(queue)↵
↵
if current_distance > distances[current_vertex]:↵
continue↵
↵
for neighbor, weight in graph[current_vertex].items():↵
distance = current_distance + weight↵
↵
if distance < distances[neighbor]:↵
distances[neighbor] = distance↵
heapq.heappush(queue, (distance, neighbor))↵
↵
return distances↵
</code>