xxxxxxxxxx
queue <- Empty
enqueue(queue, (start_node, 0))
distance_array[start_node] <- 0
while not empty(queue) do
current_node, current_distance <- dequeue(queue)
for each neighbor of current_node do
new_distance <- current_distance + distance_between(current_node, neighbor)
if new_distance < distance_array[neighbor] then
distance_array[neighbor] <- new_distance
enqueue(queue, (neighbor, new_distance))