The Elevator Doesn't Know Where to Go. And That's the Best Algorithm We Have
Elevator dispatching is an NP-hard problem. For 60 years, the best engineers in the world have been solving it with heuristics — essentially, educated guesses.
Yesterday I spent 4 minutes standing in my lobby watching two elevators go up simultaneously. Both of them. The display showed 12, 15, 18. I'm on the first floor. I need the sixth. And I thought: I've spent years writing software, optimizing database queries, caching everything that moves — and these two boxes on cables can't figure out which one should come down for me.
Then I dove into the topic. And discovered they don't "can't figure it out." They are mathematically incapable of finding the perfect solution. Nobody is. The group elevator dispatching problem is NP-hard. Literally: there is no algorithm that can guarantee finding the optimal route in reasonable time.
And for 60 years, the world's best engineers have been solving this problem with heuristics. Essentially — educated guesses.
Thought Experiment: 3 Elevators, 20 Floors, Rush Hour
Imagine a building. 20 floors. 3 elevators. Monday morning, 9:15. Fifty people are standing in the lobby of a business center. Someone needs the 5th floor, someone the 19th, someone wants to go from the 7th to the 12th.
Task: distribute people among elevators so that average wait time is minimized.
Sounds simple? Let's do the math. For each new call, the dispatcher must decide which of 3 elevators to send. That's 3 options. For 50 calls — 3⁵⁰ combinations. That's 7.18 × 10²³. Seven hundred sextillion options. For context: there are approximately 10⁸⁰ atoms in the universe.
And this is still a simple model. In reality, each elevator is a system with continuous state: current floor, direction, speed, load (in kilograms), list of buttons already pressed inside, door open/close time.
The First Approach: "Just Go Back and Forth"
The oldest elevator dispatching algorithm is so simple they named it SCAN. Or — the "elevator algorithm" (yes, the elevator algorithm is called the "elevator algorithm").
Principle: the elevator goes up as long as there's at least one call above. Picks up all passengers going the same way. Reached the top — reverses and goes down. Repeat until the heat death of the universe.
If you've ever worked with hard disk drives — you know this algorithm. In operating systems, SCAN is used for scheduling disk I/O requests. Donald Knuth described a theoretical simulation of a single elevator back in the 1960s — in the context of discussing coroutines and doubly-linked lists.
Destination Dispatch: "Tell Me Where You're Going"
In 1996, Schindler released the Miconic 10 system, and this was arguably the first time the elevator industry made a real engineering breakthrough.
The idea is brilliantly simple: ask the passenger their destination floor before they enter the elevator. Not up/down, but the specific floor. On your floor there's a panel with numbers. You enter "15" — the system responds "Elevator C." You go to Elevator C, and inside the cabin there are no floor buttons (shocking for the unprepared).
What does this give you? Everything. The dispatcher now knows where every passenger is going before they've entered the cabin. It can group people with nearby floors into one elevator. Elevator A takes everyone to floors 2-5, Elevator B to 6-12, Elevator C to 13-20. Fewer stops per cabin — faster each trip — higher throughput for the entire group.
By various estimates, destination dispatch reduces travel time by 25% and increases throughput by 30% compared to classical systems. Thirty percent. Just by asking people where they're going before closing the doors.
What's Inside the Black Box: ETA and Weighted Functions
The classic approach is ETA (Estimated Time of Arrival). For each elevator, the estimated arrival time to the calling floor is calculated, accounting for current position, direction, planned stops, and load. The elevator with minimum ETA is assigned.
Simple? Too simple. Because the minimum ETA for this call can kill the wait time for the next ten. Real systems use weighted cost functions:
def cost(elevator, call, weights):
return (weights[0] * eta(elevator, call)
+ weights[1] * coincident_bonus(elevator, call)
+ weights[2] * load_penalty(elevator)
+ weights[3] * direction_change_penalty(elevator, call)
+ weights[4] * future_demand_estimate(call))
Weights are tuned manually. By engineers. Based on simulations. For each building.
Why ML Lost to Heuristics
It seems like the perfect machine learning task. Large state space, stochastic environment, repeating patterns. Crites and Barto applied Q-learning to a 4-elevator, 10-floor system back in 1996. Since then, there have been dozens of attempts: genetic algorithms, fuzzy logic, multi-agent systems, Dueling Double Deep Q-Networks (D3QN).
And real buildings still run the same heuristics. Why?
Decision time. An elevator dispatcher has about 200 milliseconds to make a decision. A heuristic on a switch-case executes in microseconds.
Interpretability. When an elevator behaves strangely, a KONE engineer needs to understand why. "Weight w₃ is too high" is a diagnosis. "The neural network decided so" is not. Elevators are safety systems.
Patterns change. An ML model trained on morning peak (everyone going up from the lobby) gets confused during lunch (everyone moving chaotically between floors).
Heuristics are already very good. 60 years of iterations, millions of installed systems. Weighted cost functions calibrated for specific traffic patterns work at about 95% of theoretical optimum. ML wins the remaining 5% (maybe) while losing in reliability, explainability, and deployment cost.
200 Milliseconds
Here's what happens when you press a button in a modern building with destination dispatch: you enter "15" on the touchscreen (~2 sec). The controller receives the call (~5ms). For each of N elevators, a weighted cost function is computed (~50-150ms). The elevator with minimum cost is assigned (~1ms). "Elevator C" lights up on the display (~10ms).
Total: about 100-200 milliseconds from press to answer. In that time, the system solves an NP-hard problem. Not optimally. But well enough that you reach the 15th floor in 45 seconds instead of 3 minutes. Every day, in every building in the world, millions of times.