Chapter 7: Dijkstra's Algorithm
def find_lowest_cost_node(costs):
lowest_cost = float(āinfā)
lowest_cost_node = None
for node in costs:
cost = costs[node]
if cost < lowest_cost and node not in processed:
lowest_cost = cost
lowest_cost_node = node
return lowest_cost_nodeLast updated