logoalt Hacker News

Elevators

724 pointsby Jrh0203today at 3:17 PM186 commentsview on HN

Comments

jgrahamctoday at 5:10 PM

It also depends on the person understanding what the elevator button does: https://blog.jgc.org/2010/06/elevator-button-problem.html

randallsquaredtoday at 5:11 PM

If you optimize for initial wait times, someone who is going to a floor not usually visited might effectively get trapped on an elevator which shuttles between more trafficked floors to reduce wait for elevators overall. Maybe this is very unlikely in practice.

tgsovlerkhgseltoday at 4:23 PM

Is there a comprehensive overview of a) multi-bank elevator algorithms that are out there, b) the config parameters that the elevator tech/company can set on an elevator system?

For example, some elevators allow adjusting the door closing/opening speeds etc., I'd be curious what other things can be adjusted.

jhallenworldtoday at 4:58 PM

What this doesn't include: not all people are equal. Do you want the CEO of your new office building to have to wait behind a bunch of plebeians? At least one car is going to have to be reserved for the better people.

show 1 reply
paxystoday at 4:00 PM

My biggest pet peeve is elevator banks where they don’t make some number of idle elevators automatically come back to the lobby. Half your traffic is over there! Everyone coming in has to wait an extra minute or two because all your elevators were chilling on the 35th floor and above.

show 1 reply
mallory854today at 5:16 PM

Super interesting. I've always wondered how exactly they work.

oeithotoday at 8:24 PM

I am wondering where these more complex elevator algorithms are deployed, because I never see them.

I was recently at a Radisson hotel in Germany where I was tried to summon an car, but none would appear for a long time. I believe that someone was keeping the doors open on their floor to wait for someone. The fact that all the other elevators were passing by in both directions was actually a bit infuriating as well.

At that moment I really wished for an algorithm that would recognize when an car spent a significant amount of time on one floor and then reassign the other floors to a new elevator.

cruffle_duffletoday at 4:30 PM

If you like elevator hacking don’t forget the seminal DEF CON talk by Deviant Ollam and Howard Payne: https://youtu.be/oHf1vD5_b5I

I watch it like once a year because it always tickles some part of me. Like all the different modes you can get an elevator into. The most fancy one people might encounter is when moving into or out of a building. The front office can give you a key to give exclusive control over an elevator so your movers aren’t waiting around on elevators. Put it in that mode and it will stop responding to calls from other floors. Only the person with the key can control the elevator. You get on, select the floor, door closes elevator goes, and then just chills there with the door open waiting for you. Annoying for the rest if the building (the building is down an elevator when in that mode) but is amazing for the person using it! But there are way, way more depending on the installation and function.

Fun fact: most elevator shafts are sealed at the top as tight as possible to prevent them from becoming a giant chimney in a fire. It never even occurred to me until I was in a mechanical room wondering “where is the hatch to look down the shaft?” The answer is “there is none, and it’s a feature not a bug.” You want to block all airflow so fire doesn’t chase up the shaft into neighboring floors. Who knew!

yreadtoday at 5:47 PM

Our elevator doesnt stop for people who called it after it started on the way up. It only picks up people on the way down

zatkintoday at 4:02 PM

I think a small improvement that could be made is to have the dot representing the person be colored the same as a dot on each floor, which would obviate the destination floor for each individual.

show 1 reply
cyanregimenttoday at 6:04 PM

Level 1: Elevators, load balancing (1D arrays)

Level 2: Traffic lights, graphics (2D arrays)

Level 3: Flight control, simulations (3D arrays)

Level 4: Satellite tracking, virtual worlds (4D arrays)

...

So many problems can be cast to arrays to be solved with various linear algebra.

Considering LLMs are "Level 1000+" puzzles in this analogy, I wonder if every problem could be represented by an n-dimensional vector and solvable with algebra.

They at least make great interview questions - Tic-Tac-Toe is commonly given, but is obvious. The board already "looks" like arrays. The less obvious ones, like elevators (or load balancing), are always interesting.

arm32today at 6:15 PM

My autism just went KABLAOW when seeing this. I know what I'm doing the next hour.

realaccfromPLtoday at 4:21 PM

I absolutely adore this, I am always trying to guess whichever elevator will come in first in large crowded buildings. Thanks for this article.

prometheus1992today at 5:03 PM

This is beautiful. By the end of it I started to feel like I was calculating complicated chess lines in a middle game.

proeetoday at 4:05 PM

Don't forget the executive elevator algorithm (EEA), which uses a priority interrupt to take passengers directly to the top floor.

show 1 reply
Quantumhunktoday at 6:00 PM

This is cool, but wondering which tool was used to build those animations?

supportmtoday at 6:37 PM

The animation is really cool, how did you make it?

shadeslayer_today at 3:49 PM

This article gives me war flashbacks about a particularly irritating OO design interview from 5 years ago.

hastegtoday at 5:01 PM

Lol, love this post. Every single day when I take the elevators at the office I try and figure out what the algorithm is behind it. Been too lazy to just research it. Now I know!

itunpredictabletoday at 3:58 PM

I didn't realize that neal.fun had some competition.

kazinatortoday at 5:37 PM

Over the years, I've witnessed numerous instances of poor elevator behavior:

- Two elevators ascending and descending in near lock step, in a two-elevator building, effectively reduced to one elevator.

- When going in a different direction from the requested one (e.g. called elevator to go up, but actually going down), the doors wastefully close, open and close again. Seen this in many elevators.

- At 3 a.m. you take the elevator to a parkade, like to get something from a car. When you return to the elevator a minute later, it is gone; it spontaneously moved away even though nobody is using it but you.

mallory854today at 5:15 PM

This is super interesting. I've always wondered how the complicated things work!

crabbonetoday at 7:07 PM

The question about designing elevators used to be the mainstay of programming job interviews. I had an annoying interview where I was asked, for the umpteens time to design an elevator. I already made up my mind at the time, knowing I'm not going to work for the company, but decided to have a... unexpected approach.

So, for instance, I didn't measure the elevator's efficiency in the wait time. I included (weighted) travel time. I assumed LOOK algorithm was used. And then when I tried to calculate various outcomes for different trips I suddenly realized that elevator's efficiency and fairness seem to go different ways.

Without trying to reproduce my evaluation system, here's my finding in fewer details: if you have two passengers, one going from the ground floor to the top floor and other joining for the shorter ride down in the middle, then the elevator that makes a "detour" is more efficient, but it hardly seems fair that the passenger traveling ground floor to the top should go even a single floor in the opposite direction.

Somehow, until that point, I lived with an illusion that the most efficient solution to a problem must be the most fair to every participant. Discovering this counterexample sent me on the "tour of discovery" of ethics and different philosophers who contributed to it... and while in the end it made me none the wiser, I'm happy to have discovered this field.

danielvaughntoday at 4:43 PM

I've always wondered about elevator algorithms. This is awesome.

tamimiotoday at 4:30 PM

As someone who lives in a penthouse, elevator’s frustrations are real struggle especially in rush hours, because the elevator has to travel dedicated to you rather than you piggy backing on one that is already going up or down.

quietsegfaulttoday at 4:06 PM

I love elevator simulations.

gosub100today at 3:52 PM

Maybe I missed it, but the algorithm should also redistribute empty elevators that stop too closely to each other.

moralestapiatoday at 4:04 PM

>All this technology just to underperform the S&P

My takeaway is that the benefit of using a much more complex algorithm is marginal.

DoneWithAllThattoday at 5:59 PM

Having gone to many large furry cons(notoriously brutal on the elevators due to how much floor-to-floor traffic there is compared to other usage) I’ve seen these algos basically completely fail to adapt to unusual patterns. I once spent over half an hour on checkout day, in a hotel with 8 banks, to even have a car stop on our floor at all. Can’t really blame the algo for such a unique situation and at the end of the day a saturated system is a saturated system and nothing can be done to make it fast, but it’s always interesting to witness when a system is completely unable to accommodate a demand like that.

(In the example above we gave up and decided it was cardio time, five laps up and down 14 flights to escape with all our luggage.)

cubefoxtoday at 4:19 PM

> Everyone has shared the frustration of waiting for an elevator that never seems to arrive.

Really? Maybe I'm lucky I never had to deal a lot with elevators.

jmyeettoday at 3:55 PM

This is a good article. It reminds me of a story.

At a previous employer we had heteregenous elevators. In one bank, some went to the lower half of floors only while others went to all and the company installed a "smart" elevator system. I kind of became known because I was constantly yelling about this system in the feedback group because I hate "smart" elevators and and (IMHO) they just don't work. What actually works is express elevators and sky lobbies.

This article covers one of the deficiencies this system had: full elevators. For example, you'd want to go down and an elevator would skip your floor because another had already been assigned. That one would show up full and you couldn't go down. Down wasn't so bad because the stairs weren't a bad option but up was terrible. Going up a few floors was fine. Going up 20 was... a bigger issue.

Back in the day we had elevator operators and people in the lobby during the morning rush who would shepherd people into particular elevators. I actually think this system works way better than anything technology has come up with. Even if you nail the implementation (and I've never experienced elevators that have), people don't read and will just get into elevators anyway.

Anyway the article says that generally speaking on smaller banks simple up and down buttons work best. I absolutely agree.

There's a deeper issue here though and that is solutions looking for a problem. Nobody is making money from up and down buttons. They are fromn selling smart elevator solutions. And you see this everywhere in life. It basically devolves into rent-seeking behavior. Salespeople wine and dine a couple of people responsible for making decisions and then make bank on selling something nobody wants or needs as well as the constant maintenance and updates.

show 1 reply
yucongchentoday at 5:31 PM

[flagged]

mito88today at 4:12 PM

did he factor in the lifting speed?

cpuguy83today at 5:14 PM

Enjoyed the read, thanks!

Beyond the content, the font, style, etc made it a pleasant experience for me.

OJFordtoday at 4:11 PM

I think this comparison is also assuming the distribution of request & requested floor is uniform? When actually near pairs are less likely (I'll just take the stairs) than bottom to top, so even analysing it is more complex than at first glance.