Fly-in

Fly-in is a routing puzzle from the 42 Berlin curriculum. A fleet of drones has to get from a start zone to a goal, through a network of zones and the corridors between them. Every zone and corridor holds only so many drones at once, and the solver has to bring them all in using as few turns as possible.

This page is a visualisation of that solver. The routes come from the Python code of Jason Koch (jasonkochai); the page only draws what the program decided, one turn at a time.

What I learned

Speed

How the planner works

The solver plans the drones one after another. For each drone it searches over places and turns together, so waiting a turn counts as a move, and it always looks at the earliest turn first. The first time that search reaches the goal is the earliest arrival that does not clash with any drone planned before it.

That route is then booked turn by turn, zones and corridors alike, and the next drone plans around the bookings. This is why you see drones wait at a station: the place they need next is still booked for that turn.

On every map that ships with the 42 project, the plan uses exactly the number of turns the project gives as the optimum.

Solver
Written by Jason Koch (jasonkochai) in Python as the Fly-in project at 42 Berlin. The parser, the path search and the booking calendar are Jason Koch's own code; Claude added the priority tie-break at his request. Used here unchanged.
Visualisation
Designed and built by Claude (Anthropic) together with Jason Koch. It draws the solver's output and runs the same Python code with Pyodide when you plan your own map.
Source
github.com/jasonkochai
Learning notes
The interactive pages I learned the algorithms from