# What is the best rest position for two elevators in a 10-story building?

## Situation

• My apartment block has ten stories.
• The first ground level is 1, the highest story is 10.
• There are two equivalent elevators, spanning all stories.

Current configuration: One elevator always rests at level 1, the other at level 10.

## Thoughts

I am pretty sure that this is a bad configuration and I started thinking about a better one. While keeping one elevator always on the first level seems very reasonable, I think the one on the tenth level is very inefficient.

An efficient configuration would be where most people would wait as little as possible to reach their level. One example situation that occurs is that, someone walks 30m in front of me outside the building and takes the first elevator and then I have to wait for the second one to come down from 10 to 1.

## Modeling

Let's further assume:

• People only use the elevator to get from their story to the ground level (1) and from ground level back to their story.
• The number of elevator users is the same for all levels.
• The usage over time is uniform.

## My Calculation

I did a "numerical calculation" (spreadsheet) and found that if I optimize one elevator $U$ for people going up and one elevator for people going down $D$, then elevator $U$ should always be on floor 1 and elevator $D$ should be on floor 6. I compared all start levels for people wanting to go down from 2-10 and an elevator on level 6 has the minimum number of traversed levels.

So for the story $s \in \{2..10\}$ where the person starts his descent and $r \in \{1..10\}$ the story where the elevator rests we need to find $$min \left(\sum_{s=2}^{10} (s-1)+|s-r|\right)$$

The values over $r$ are:

## Questions

Taking into account the points in Situation and Modeling:

1. Is there a better position for elevator $D$ than level 6?
2. And maybe even something better for $U$ even though it's position on the first floor seems "very optimal"?
• "inefficient" on what sense? You must start defining with precision what is the criteria you want to use here for "efficient". Jul 23, 2017 at 14:19
• There is no reason to reserve one elevator for people going up: If it i sinstead used to fetch someone from anothre floor, it will be available at floor 0 immediately after that task because that is where the task takes it to. Jul 23, 2017 at 20:34
• Unrelated: play.elevatorsaga.com Jul 23, 2017 at 21:42
• Are there stairs? How many flights are people prepared to walk up (probability distribution)? what about down (presumably a larger number)? Does this probability vary not just between trips (for the same person it will depend on load) but on time of day? For that matter do you want to take into account many people going out to work in the morning and coming back in the evening? Jul 24, 2017 at 9:09
• From my experience, both elevators should be resting at ground level in the evening, when a lot of people are coming home from work. I know you are asuuming uniform use over time, but going for a non-uniform use may help your optimization a lot. Jul 24, 2017 at 14:36

In general, elevator scheduling is a seriously difficult problem (see, e.g., this presentation and its list of references for some idea of its complexity). Your example situation starts to get at why it's hard: in order to know how often this happens, you need to know how quickly the elevator travels, relative to how often people arrive. And once it happens, maybe it would be better to dispatch the 10th-floor elevator, but maybe the 1st-floor elevator will do its thing fairly quickly and you should just wait for it to be done. In order to answer these kinds of questions, you need lots of data about your apartment's specific situation; a theoretical answer based on a few assumptions isn't going to get you anywhere useful.

But the hard part is determining what to do when the elevators are busy. You're asking about which floors you want the elevators to rest on, which is something that only matters when they are not particularly busy. And in that case, along with your assumptions, we can come up with something tractable.

So, in addition to the assumptions you made, I will also assume that:

• Only one person wants to use the elevator at a time, so the elevators are always on their resting floors when someone wants to use them.
• Elevators move from floor to floor at constant speed, so a passenger's wait time is proportional to the distance to the closest elevator. (This assumption could be removed and it wouldn't make the problem much more difficult, but it's hard to know what to replace it with.)

Additionally, unless we are in a certain classic mathematician joke, your assumptions imply that a passenger will want to go up or down with equal probability.

This is enough to solve the problem. We take a representative population consisting of one person on each higher floor wanting to go down, and 9 people on the ground floor wanting to go up. Over this population, we minimize the total waiting time; i.e., the total distance to the closest elevator. The following simple python script does this for each possible elevator configuration, and then tells you which one is best:

least_wait_time = float('inf')
passengers = [1 for i in range(0, 9)] + range(2, 11)

def wait_time(passenger, elevator1, elevator2):
return min(abs(passenger - elevator1), abs(passenger - elevator2))

for high_elevator in range(2, 11):
for low_elevator in range(1, high_elevator):
total_wait_time = sum(wait_time(passenger, low_elevator, high_elevator)
for passenger in passengers)
print 'Elevator positions: ' + str((low_elevator, high_elevator))
print 'Total wait time: ' + str(total_wait_time)

if total_wait_time < least_wait_time:
best_elevators = (low_elevator, high_elevator)
least_wait_time = total_wait_time

print ''
print 'Optimal elevator position: ' + str(best_elevators)
print 'Optimal wait time: ' + str(least_wait_time)


It turns out that the optimal thing to do, given all these assumptions, is to put one elevator on floor 1 and the other one on floor 7. This gives a total wait time of 15 (i.e., over the population of 18 people, the nearest elevator will on average start 15/18 floors away).

Why is this different from your result? Because we're not assuming the elevator on floor 1 is used solely to go up. If someone wants to come down from floor 2 or 3, the 1st-floor elevator is already closer to them than the higher-up elevator even when the higher elevator is at floor 6, so it's not useful to keep the higher elevator close to them. So we might as well move the higher elevator up a bit to keep the people on really high floors happy.

• @BrevanEllefsen Your upvote is worth 10 reputation points, so... :-). (And of course there are bounties which you can award to an existing answer.)
– Luc
Jul 24, 2017 at 6:53
• @Luc sure, but +10 would yield 100 reputation points ;) As far as a bounty goes? While I think this answer probably qualifies for one, I feel the same way about a lot of posts on this site, and so I try to be sparing with my bounties, using them either to reward the best of the best answers or to encourage answers to my own questions (which I avoid doing often since it can reward poor quality answers, so I usually wait a year or so and try editing a few times to ensure nothing else is working!) Jul 24, 2017 at 6:57
• How does this compare to elevators waiting at the floor they last stopped at? Jul 24, 2017 at 13:55
• @Baldrickk: That'd take a more complicated analysis, because it means that the order people show up in becomes relevant. But my guess would be that this does better. The advantage to having elevators wait at the floor they last stopped at is that they're more likely to be in high-traffic areas, but we've already got an elevator in the high-traffic area. And some of the time you're going to end up with two elevators in the lobby, which is (under the low-frequency assumption we've been making) a total waste. Jul 24, 2017 at 15:22
• @Micah considering the assumptions you made in your last paragraph, I think the optimal solution would be one elevator at 3 and the other at 8.
– AMAN
Jul 26, 2017 at 9:38

Your model concerns the "low frequency mode" of the elevators: The building is $n\geq1$ stories high, whereby the floors are numbered from $0$ to $n$. The elevators are at rest at floors $r$ and $s$ with $0\leq r<s\leq n$, and are waiting for the next customer. This customer will arrive with probability ${1\over2}$ at floor $0$, and with probability ${1\over2n}$ each at one of the floors $k\in[n]$. The expected waiting time of this customer then is $$E(r,s)={1\over2} r+{1\over2n}\sum_{k=1}^r(r-k)+{1\over2n}\sum_{k=r+1}^{s-1}\min\{k-r,s-k\}+{1\over2n}\sum_{k=s}^n(k-s)\ .$$ In your case $n=9$. Use your spreadsheet power to compute the minimal $E(r,s)$. In any case the lower elevator should not be reserved for customers wanting to go upwards.

• Sorry, I have an issue where my brain seems to sometimes skip random sentences, and it apparently skipped that very important bit :o Jul 24, 2017 at 19:40

Classroom aspects of mathematical modeling is treated in the joint report called GAIMME developed by SIAM and COMAP (The Consortium for Mathematics and Its applications).

http://www.siam.org/reports/gaimme-for_print.pdf

One extended example in this report has to do with elevator management issues. Look starting at page 148 in the report above.

- @Masacroso: I added my understanding of efficient in Thoughts. – problemofficer Jul 23 '17 at 14:24
- There is no cellar. I have never seen anyone taking the stairs. I understand that in the morning more people leave and more return in the evening but I left out this because it would complicate the model. This is why I wrote that the usage is uniform over time. – problemofficer Jul 24 '17 at 9:12

It is correct that people do not like waiting for the elevator to arrive after a hall call (pressing the button). Studies have shown that they would prefer 10 seconds increase in travel time over 10 seconds increase in boarding time.

Waiting for an elevator can be one of the main annoyances in one’s experience with tall buildings [Berbeglia 2010, Sutton 1998], often resulting with the most common complaint “waiting time was for too high” [Tebbenhof 2000].

Questions

Taking into account the points in Situation and Modeling:

1. Is there a better position for elevator D than level 6?

With 10 floors and 2 elevators, assuming one is not content to leave the elevator parked at its last floor (saving wear and electricity), then the mid-pont of that zone is 7.5.

Parking one elevator on the seventh floor services the top of the building better than having it on the sixth floor, placing it on the eighth floor services the tenth floor better, at the cost of poorer service for all the floors beneath.

1. And maybe even something better for U even though it's position on the first floor seems "very optimal"?

In your modeling you want us to assume: "People only use the elevator to get from their story to the ground level (1) and from ground level back to their story.".

Using the zone splitting of 1-5 for one elevator (either elevator, they can swap duties) and 5-10 for the other places elevator U on the second floor. Putting elevator U on the third floor reduces waiting time for people on the upper floors even more, obviously that comes at a cost to people on the first floor wanting to travel up.

As for usage of the stairs, you say you have seen none. That is not my experience nor that of some of the other commenters; I have been known to run up 5 flights of stairs because it's slightly faster in an old apartment building and good exercise, but for above the third floor I do usually take the elevator.

Coming down is another matter entirely. Running and seeing if you can leap the entire flight (and grab the railing) with enough speed to continue is the fastest way down. I fully agree that most people don't do that.

References:

Despite the assumptions you wanted to make and the limits you desire to place on the scope of the questions it is a fact that:

1. Some use is made of the elevator for interfloor travel, as opposed to strictly one to the X floor and the reverse.

2. The algorithm for up-peak and down-peak are different from this simplified model, please see the references.

3. Usage by floor and throughout the day is not uniform.

One of your examples is: "... someone walks 30m in front of me outside the building and takes the first elevator and then I have to wait for the second one to come down from 10 to 1". If they are going beyond the fifth floor the second elevator ought to be on its way to the in-use elevator's parking position. As soon as the pair of elevators can calculate what would amount to the shortest wait they ought to switch parking locations or make you wait for the one you saw leave the lobby - the one on the tenth floor doesn't need you to push the button on the main floor for that decision to be made.

In the situation you describe, with the limits you impose, floor one and seven ought to be the parking locations; it would be rare to have more than one elevator in a building and for them not to share rudimentary information between them, they can trade parking locations. Modern elevator controls ask which floor you are going to when you call the elevator, that information is used in the calculations to improve service (along with collecting usage statistics). Your question doesn't say you have such a premium elevator.

If there was no sharing of information between the two imagine the situation where the person in front of you goes to the second floor and you must wait for the other elevator to come from the tenth floor, and the worse situation where someone else then goes down to the lobby (leaving two open doors on the first floor for you).