Overhead BinOptimizer

Every passenger declares their bag count at check-in. Airlines have all the data they need to predict bin overflow, pre-allocate space, and eliminate gate-check chaos. They just aren't using data structures to do it.

scroll

The Problem

180 passengers, 60 overhead bins, zero coordination. Watch what happens when bags are placed first-come, first-served with no data and no plan.

cockpit
1
A
B
C
D
E
F
2
A
B
C
D
E
F
3
A
B
C
D
E
F
4
A
B
C
D
E
F
5
A
B
C
D
E
F
6
A
B
C
D
E
F
7
A
B
C
D
E
F
8
A
B
C
D
E
F
9
A
B
C
D
E
F
10
A
B
C
D
E
F
11
A
B
C
D
E
F
12
A
B
C
D
E
F
13
A
B
C
D
E
F
14
A
B
C
D
E
F
15
A
B
C
D
E
F
16
A
B
C
D
E
F
17
A
B
C
D
E
F
18
A
B
C
D
E
F
19
A
B
C
D
E
F
20
A
B
C
D
E
F
21
A
B
C
D
E
F
22
A
B
C
D
E
F
23
A
B
C
D
E
F
24
A
B
C
D
E
F
25
A
B
C
D
E
F
26
A
B
C
D
E
F
27
A
B
C
D
E
F
28
A
B
C
D
E
F
29
A
B
C
D
E
F
30
A
B
C
D
E
F
tail

0

Gate-checked bags

0.0

Avg bin search distance

rows from assigned seat

0s

Boarding time elapsed

0

Passenger conflicts

searched beyond own row

Progress: 0 / 180

idle

The Data Structure

Every passenger already declares their bags at check-in. This is the composite data structure that turns that data into a zero-conflict boarding plan.

Check-In Counter

Checked in: 0 / 180

Step or play to begin check-in

idle

No segment tree data available. Initialize the simulation to view the tree.

Like BullMQ's Redis Sorted Sets: O(log n) insertion and range queries for capacity tracking

Priority queue is empty. Check in passengers to populate the queue.

Like BullMQ's priority queue: (priority << 32) + counter scoring ensures boarding group order with FIFO within groups

Capacity Gauge

0%utilization

0 / 240 slots committed

Checked in
0
Remaining
180
Alert level
green

Like BullMQ's rate limiter: { max: 240, duration: boardingWindow } - once the rate limit is hit, new jobs (bags) are delayed (gate-checked)

No allocations yet. Check in passengers to see bin assignments.

The Algorithm

Four bin-packing strategies running on the same 180-passenger dataset. Watch how algorithmic choice alone determines whether bins overflow or stay organized.

key insight

The check-in allocation algorithm (BullMQ-optimized) achieves near-optimal bin utilization because it converts an ONLINE problem (passengers arrive one at a time with no advance info) into an OFFLINE problem (all data is known at check-in before boarding begins). This is the fundamental insight: airlines already have the data. They just process it too late.

The Check-In Notification System

Real-time passenger communication transforms bin allocation from a gate-time scramble into a check-in-time certainty.

Check-In (online)

Bag Declaration

System Allocates Bin Slot

Gate Arrival (bin shown on pass)

Boarding (direct to assigned bin)

Check-in notification

ChaosPlane Airlines

How many carry-on bags?

Selected: 1 bag

Gate display board

Flight UA 1234 — Overhead Bin Status

0%allocated240slots leftGroup 1now boarding
Low
Medium
High
Full

Enhanced boarding pass

CP

ChaosPlane

UA 1234

Passenger

Jane Smith

Seat

14A

Group

3

Bin

NO BIN INFO

Current boarding passes have no bin information. One additional field eliminates all searching.

key insight

Airlines already send notifications during check-in (seat assignments, upgrade offers, gate changes). Adding bin allocation is zero additional infrastructure — it is a software update, not a hardware purchase. The $750K-per-aircraft retrofit for larger bins is unnecessary if you allocate existing space intelligently.

The Numbers

Real industry data quantifying the impact of algorithmic bin allocation versus the status quo.

$7.27B

Annual U.S. checked bag fees driving carry-on overcrowding

28%

Potential improvement in bin utilization with algorithmic allocation

1M

Passengers avoiding gate-checking annually with optimized bins

~$0

Additional hardware cost for check-in-based bin allocation

Before vs. after comparison

Run the simulation to see comparison data

Algorithm performance hierarchy

Approximation ratio (lower is better)

Next Fit
2x
First Fit
1.7x
First Fit Decreasing
1.22x
Check-in pre-allocation
1.05x
Theoretical optimum
1x

The BullMQ Pattern Map

BullMQ conceptAirline equivalent
Job
Passenger bag
Queue
Boarding line
Priority levels
Boarding groups
Rate limiter
Boarding flow control
Delayed job
Gate-checked bag
Retry with backoff
Passenger checking adjacent bins
Stalled job detection
Crew intervention for aisle blockers
Job lifecycle states
Bag placement states
Redis Sorted Set
Segment tree over bin capacities