Design the optimal boarding algorithm and compete on the global leaderboard
Your goal is to minimize the total boarding time measured in ticks. A tick is the simulation's unit of time—each tick, passengers move one step forward in the aisle, make progress stowing luggage, or wait if blocked.
The challenge is that different boarding strategies have different tradeoffs. Boarding window seats first (WILMA method) reduces seat interference, but may cause more aisle congestion. Back-to-front boarding is intuitive but often performs poorly due to clustering. Your job is to find the optimal balance.
The simulation uses a Boeing 737-800 configuration with 30 rows in a 3-3 layout (seats A-B-C on the left, D-E-F on the right). Total capacity is 178 seats, with approximately 85% filled (~150 passengers per simulation).
Each passenger has a type that determines their walking speed and luggage stowing time. These values have some randomization (±20-30%) to reflect real-world variability.
Regular adult travelers. Speed: 1.0x, Stow time: ~3 ticks. The most common passenger type (~55% of solo travelers).
Frequent flyers with minimal, organized luggage. Speed: 1.2x, Stow time: ~2 ticks. They're efficient and quick to settle.
Senior travelers who need more time. Speed: 0.5x, Stow time: ~5 ticks. Often travel in pairs with a caregiver.
Young passengers traveling with family. Speed: 0.8x, Stow time: ~1 tick. Light luggage but slower walking. Usually part of a group.
Passengers requiring mobility assistance. Speed: 0.3x, Stow time: ~8 ticks. The slowest passenger type but only ~5% of passengers.
Light travelers with only a personal item. Speed: 1.0x, Stow time: ~1 tick. Minimal overhead bin usage.
Approximately 25% of passengers travel in groups of 2-3 people seated together. These represent real-world scenarios like:
Groups MUST board consecutively!
Your algorithm must keep group members together in the boarding order. If a family is separated (e.g., the child boards 50 passengers after the parents), the simulation will flag a GROUP_SEPARATION validation error. While the simulation will still run, separated groups are penalized in leaderboard scoring and represent poor real-world outcomes.
Groups are identified by groupId (null for solo travelers). The isGroupLeader property indicates the primary traveler who should board first. Use groupMemberIds to find related passengers.
When a passenger needs to reach a window or middle seat, they may need to cross over passengers who are already seated. This is expensive!
This is why WILMA (Window-Middle-Aisle) boarding can be effective—window passengers board first, then middle, then aisle, minimizing crossovers.
Each row has overhead bin capacity for 6 pieces of luggage (both sides combined). When a passenger's row is full, they must walk to find available space.
Bin conflicts are tracked in the event log as bin_conflict events. Back-to-front boarding tends to cause more bin contention because rear passengers fill up rear bins, forcing later passengers to walk further.
Your algorithm receives an array of passenger objects. Here are all the properties you can use to sort them:
row (1-30) — Row numberseat ("A"-"F") — Seat letterseatIdx (0-5) — Seat index (A=0, F=5)isWindowSeat (bool) — Seats A and FisMiddleSeat (bool) — Seats B and EisAisleSeat (bool) — Seats C and DisExitRow (bool) — Rows 14-16isBulkhead (bool) — Row 1type (string) — STD, BUS, ELD, CHD, WCHR, BAGspeed (0.24-1.44) — Walking speed multiplierluggageTime (1-10) — Base ticks to stow luggagegroupId (int|null) — Group identifiergroupSize (1-3) — Number in groupisGroupLeader (bool) — Primary travelergroupMemberIds (int[]) — Other member IDsUse these as starting points or benchmarks. Select them from the dropdown to see their code:
Baseline random ordering. Surprisingly not terrible! Averages ~450-500 ticks.
Traditional airline method. Board row 30 first, then 29, etc. Actually performs poorly (~500+ ticks) due to aisle clustering.
The worst strategy. Front passengers block everyone behind them. Included for comparison.
Window seats first, then middle, then aisle. Reduces crossover penalties. Typically ~350-400 ticks.
Theoretically optimal: windows first, alternating rows (30, 28, 26... then 29, 27, 25...). Often ~300-350 ticks.
Back-to-front but keeps groups intact. A good starting point that passes validation.
When you submit to the leaderboard, your algorithm is evaluated server-side across 1,000 different random seeds. This ensures your algorithm is robust across different passenger configurations.
Mean ticks across all 1,000 simulations. Lower is better.
Percentage of simulations without group separation errors. 100% required for ranking.
Maximum ticks in any single simulation. Used as a tiebreaker.
You can submit multiple times and keep improving. Only your best score counts. Use the SAVE button to store your algorithms locally so you can iterate on them.
Built with TanStack Start, Cloudflare Workers, and D1. Algorithm execution is sandboxed and secure.
Inspired by real-world research into airline boarding optimization.