Darkwood Blog
  • Articles
  • Auto
  • Watch
  • Releases
  • Creators
  • English
  • FranΓ§ais
  • Deutsch
Login
  • βŒ‚ Blog
  • β–¦ Articles
  • β˜… Auto
  • β—· Watch
  • ↑ Releases
  • β™™ Creators

πŸŽ„ Darkwood Adventofcode #05 β€” Many Paths, One State

on December 5, 2026

πŸŽ„ Darkwood Adventofcode #05 β€” Many Paths, One State

Log in to add a reaction to this post

πŸ‘ 1

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

Flow
Workshop State Map

Use PHP and Flow to explore six workshop states and measure the minimum steps needed to reach each.

View the Flow example

Darkwood Page β€” Advent of Code

Darkwood Page
Advent of Code

Follow the calendar, challenge references and previous editions.

  • Kind: content
  • Status: working
  • Topics: algorithms, php, rust
Open the catalog card

The calendar

Day 04. Darkwood participates independently, without affiliation or endorsement from Advent of Code.

Log in to add a reaction to this post

πŸ‘ 1

Site

  • Sitemap

Network

  • Hello
  • Blog
  • Apps
  • Photos

Social

Contact Legal mentions
  • Darkwood
  • Navi
  • Flow
  • Uniflow
  • Darkwaar
  • HeroClip
  • DJ Matyo
  • Geo
  • Slide
  • Darkwood Job

Darkwood 2026, all rights reserved