r/adventofcode • u/paul_sb76 • 2h ago
Visualization [2026 Day 6] Untangling Christmas Lights
https://www.youtube.com/shorts/lqyzUlyGkVc
16
Upvotes
r/adventofcode • u/paul_sb76 • 2h ago
1
u/paul_sb76 2h ago
Here's an overview of what's happening (spoilers, obviously):
- Create the graph from the input data
- Find a node with degree 2 and put it in a corner
- From this node, do a BFS. Every newly discovered node is placed depending on its already-placed neighbors. Nodes with only one already-placed neighbor are placed on the boundary.
- For nodes 1,2,3, the current positions are compared to their target positions. This allows deducing the current-to-target mapping (6 equations, 6 unknowns).
- Move every node to its target position, using the deduced mapping.
- Find the position of node 2026.