Module aoc::year2019::day15

source ·
Expand description

§Oxygen System

Breadth first search is the simplest path finding algorithm and is suitable when the cost of moving between locations is identical. This excellent blog has more detail on the various path finding algorithms that come in handy during Advent of Code.

The tricky part is determining the shape of the maze. If we assume the maze consists only of corridors of width one and has no loops or rooms, then we can use the simple wall follower algorithm to eventually trace our way through the entire maze back to the starting point.

Functions§

  • Build the shape of the maze using the right-hand version of the wall following algorithm.
  • BFS from the starting point until we find the oxygen system.
  • BFS from the oxygen system to all points in the maze.

Type Aliases§