Part One:
Get Us Outta Here
You wake up to find the Aurawrought defector standing far too close to your face, staring at you intently. Startled, you nearly leap to the opposite end of your bunk. Clearly, these beings are not familiar with the concepts of privacy or personal space. It proudly announces that it's finished with the map to the Aurawroughts and hands you a piece of paper, your puzzle input. However, instead of containing any obvious coordinates or paths, it has a list of nodes and their connections.
The defector explains that the path to the Aurawroughts must first cross a Nebula Labyrinth, riddled with electromagnetic storms. The node system reveals the paths that avoid these storms, guiding the ship safely outside the Nebula Labyrinth.
You realize you need to take this information to Captain Xarlos on the Bridge, but first, you must make sense of this strange system. Your task is to scour the depths of the Nebula Labyrinth and find the safest path through the storms.
Your paper contains
- First Line
- The starting node and ending node, separated by a comma.
- This represents the ship's current location and the exit of the Nebula Labyrinth.
- Subsequent Lines
-
All the nodes and their connections, separated by colons.
(node:connection) - Each node-connection combination is on its own line.
- If a node has multiple connections, those connections are separated by commas.
You can guide Captain Xarlos through the shortest path, but he first would like to
know how many units of space must be traversed.
(Each node represents one unit of space.)
For example:
10:18
12:13,20
13:12,14
14:13,15,22
15:14
18:10,26
20:12,28
22:14,30
26:18,27
27:26,28
28:27,29
29:28,30
30:22,29,31
31:30
# | # | # | # | # | # | # | # |
# | 10 | # | 12 | 13 | 14 | 15 | # |
# | 18 | # | 20 | # | 22 | # | # |
# | 26 | 27 | 28 | 29 | 30 | 31 | # |
# | # | # | # | # | # | # | # |
Following the nodes' connections, you can take different paths:
- 10-18-26-27-28-20-12-13-14-22-30-31 : 12 units of space
- 10-18-26-27-28-29-30-31 : 8 units of space
# | # | # | # | # | # | # | # |
# | 10 | # | 12 | 13 | 14 | 15 | # |
# | 18 | # | 20 | # | 22 | # | # |
# | 26 | 27 | 28 | 29 | 30 | 31 | # |
# | # | # | # | # | # | # | # |
Now, it's time to navigate the actual map through the Nebula Labyrinth.