π Darkwood Adventofcode #05 β Many Paths, One State
on December 5, 2026
December 5, 2026 edition. In a fictional dispatch workshop, two operators prepare the same parcel. One scans it and then attaches a label. The other reverses those steps. At the verification station, both parcels are ready for the same operation. How should a program represent the two paths meeting?
Advent of Code β Day 5
The official challenge, Rhythmic Factory, asks us to think about the states that a sequence of actions can reach. The workshop below is an original example about state graphs and path costs.
Keep the information that changes what happens next
| Minimum operations | States reached for the first time |
|---|---|
| 0 | Parcel received |
| 1 | Scanned or labelled |
| 2 | Ready for verification |
| 3 | Verified |
| 4 | Sealed |
Breadth-first search processes states in order of distance from the start. When two branches reach βreadyβ, adding that state to the queue once is enough to explore what follows. An inspection that leaves the parcel in βreceivedβ is skipped for the same reason. Every action here costs one operation, so the first visit gives the minimum distance.
Merging works because scanning and labelling in either order leaves the same future actions available. If a label expires ten minutes after it is attached, the state also needs its issue time or remaining validity. Otherwise, two parcels marked βreadyβ could behave differently at the next station.
Flow β Workshop State Map
Darkwood Page β Advent of Code
The calendar
Day 04. Darkwood participates independently, without affiliation or endorsement from Advent of Code.