···3030 already seen is valid so long as h(n) is admissible.
3131 """
32323333- frontier = []
3333+ frontier = [(0, start)]
3434 seen = set()
3535 cost_to = {start: 0} # this is g(n)
3636-3737- heapq.heappush(frontier, (0, start))
38363937 while frontier:
4038 _priority, (x, y) = heapq.heappop(frontier)