RC RANDOM CHAOS

Why Your Elevator Ignores You: The Scheduling Algorithms Behind the Wait

· via Hacker News

Original source

Elevators

Hacker News →

Elevators are a surprisingly deep exercise in real-time scheduling. The oldest approach, the 1961 SCAN algorithm, simply runs a car to the top and back, servicing requests along the way; the more familiar LOOK variant only travels as far as the highest active request before reversing. Once a building has multiple cars, the problem shifts from pathing a single car to dispatching a fleet — deciding which car answers each call. A naive scheduler assigns every request to the nearest car, but Otis’ RSR (Relative System Response) does better by scoring cars against penalties and rewards: it discourages two cars from bunching toward the same floor and favors idle cars near the caller. Crucially, RSR re-optimizes every five seconds, so a rider initially assigned to a delayed car can be silently reassigned to a faster one.

Performance is best judged not by averages but by the tail of the wait-time distribution. Riders don’t remember their median wait; they remember the p90 outliers when a car took forever, so that’s the number worth optimizing. Traffic pattern matters enormously — the morning lobby-to-upper-floors rush produces the worst statistics — and the smarter algorithm doesn’t always win. Under heavy load, when every car is full and stopping at every floor, plain LOOK actually catches up to and can beat RSR, and in small buildings with few cars the extra rules add little.

The most counterintuitive result concerns Destination Dispatch, the lobby kiosks that ask your floor up front and assign you a specific car. Despite giving the optimizer complete knowledge of everyone’s destination, these systems generally produce worse wait times than ordinary up/down buttons. The reason is rigidity: because the kiosk locks you into an assigned car, the system loses the ability to rebalance as conditions change over the next 30 seconds. Except in extreme cases — very tall buildings with large elevator banks — the flexibility of last-second reassignment beats the value of the extra information, a useful reminder for anyone designing scheduling systems that adaptability often outperforms perfect foresight.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.