mirror of
https://github.com/thib8956/advent-of-code.git
synced 2026-06-15 21:48:16 +00:00
2015 day 9
This commit is contained in:
@@ -28,7 +28,10 @@ def can_reach(pos, obstacles, grid_size):
|
||||
return False
|
||||
|
||||
|
||||
def search(obstacles, start, goal, grid_size): # could just use bfs?
|
||||
def search(obstacles, start, goal, grid_size):
|
||||
"""
|
||||
Dijkstra's algorithm. Could as well use BFS since step costs are uniform. (n = Node(new_pos, node.cost + 1))
|
||||
"""
|
||||
queue = [Node(start)]
|
||||
visited = set()
|
||||
i = 0
|
||||
|
||||
Reference in New Issue
Block a user