Just One Elevator? It's Tougher Than You Think
One elevator should be simple, right? Just going up and down.
That's where you're mistaken.
Rush hour, a 20-story building, and only one elevator.
During the morning rush, the lobby is already crowded with people, and 'ding' sounds of pressed buttons echo everywhere. On the 5th floor, someone has pressed the "down" button, while on the 8th floor, someone is waiting to go up. Calls are also coming from the 3rd, 10th, and 13th floors.
Currently, the elevator is at the 6th floor, heading downward. Who should be picked up first, and which floor should be reached first?
That's where it begins. The moment simple button presses turn into questions of "who to help first" and "who to keep waiting," the elevator transforms from a simple machine into a scheduler coordinating priorities.
The Simplest Approach: First-Come, First-Served (FCFS)
The most straightforward method is First-Come, First-Served, meaning requests are handled in the order they arrive.
- Example: If calls come in from floors 3, 8, and 2 in that order, the elevator moves to each floor accordingly.
The Problem? Efficiency goes out the window. Even if the elevator is at the 6th floor and floor 2 is closer, it must go to floor 8 first. This leaves people wondering, "Why is that person getting picked up first?"
Various Algorithms: Experiencing Them from a User's Perspective
Same scenario: Elevator is at floor 6, with requests from floor 3 (down), floor 8 (up), floor 2 (down), floor 10 (up).
Visual Example
Floor | Request | Note
---------------------
10 | ▲ | Up request
9 | |
8 | ▲ | Up request
7 | |
6 | ◎ | Current position
5 | |
4 | |
3 | ▼ | Down request
2 | ▼ | Down request
1 | |
Let's see how each algorithm handles this situation.
1. SSTF (Shortest Seek Time First)
→ From floor 6, floor 8 (up) is closest. Then floor 10, then down to floors 3 and 2.
User Experience: It's fast, but the person who pressed first at floor 2 has been waiting for 10 minutes. Frustrating.
User Reaction Simulation: "Wait, I'm pretty sure I pressed the button first. Why is that person getting picked up before me? What kind of system is this?"
2. SCAN (Elevator Algorithm)
→ If currently going down, handle all downward requests first, go all the way down, then head back up.
User Experience: "Why does the elevator keep going up when I'm waiting below?" But it does arrive in a predictable order. The wait is understandable.
User Reaction Simulation: "I had to wait, but at least that person pressed after me, so it makes sense that I'm getting on first."
3. LOOK (Modified SCAN)
→ Eliminates unnecessary movement from SCAN. For example, if the lowest request is from floor 2, it only goes down to 2 before heading back up.
User Experience: "There's some waiting time, but it's understandable." It's efficient since the elevator doesn't unnecessarily go all the way to floor 1.
User Reaction Simulation: "At least it's coming to my floor eventually. I can wait a bit longer."
4. C-SCAN (Circular SCAN)
→ Only picks up passengers while going up. When going down, it doesn't stop for anyone and returns to the bottom.
User Experience: "Why did it pass by floor 5 without picking anyone up?" There's a mechanical fairness to it, but users find it frustrating.
User Reaction Simulation: "The elevator is empty and still won't pick me up? What kind of machine is this?"
Algorithms from the User's Perspective
| Algorithm | User Experience | Advantages | Disadvantages |
|---|---|---|---|
| FCFS | Unfair, inefficient | Simple to implement | Long wait times |
| SSTF | Fast but frustrating | Prioritizes shorter distances | Ignores distant requests |
| SCAN | Slower but acceptable | Fair | Unnecessary movement |
| LOOK | Reasonably fast and acceptable | Efficient, makes sense | Slightly more complex |
| C-SCAN | "Why am I being ignored?" | Predictable wait times | Feels discriminatory |
What Algorithms Do Real Elevators Use?
In reality, variants of SCAN and LOOK are most commonly used. Especially in apartments and mid-rise buildings, SCAN-based algorithms are prevalent, while in high-rise commercial buildings, destination-based dispatching systems are becoming more common.
Recently, AI-based prediction systems are also being used. For example, knowing that requests will come from upper floors on weekday mornings, the system positions elevators accordingly.
Conclusion
Don't underestimate the challenge of having just one elevator. That single elevator has to coordinate the waiting times of dozens of people, and deciding who to pick up first becomes a matter of fairness versus efficiency.
Even in a simple scenario, a single algorithm change can completely alter people's impressions, waiting times, and frustration levels. The elevator you ride has an invisible priority algorithm breathing within it.