It often amazes me how some things which appear trivial on the surface can actually lead to deep optimization problems. Take for example the programming challenge, Elevator Saga. Just make the lifts take the little people where they want to go. Seems easy, right?
It is – on the surface, and for the first few levels. But when you start getting more traffic and multiple lifts, things get very complicated. There even comes a point where lifts need to know the state of other lifts. Do you have lifts run in “express” mode, skipping some of the lower floors? When should they make the decision to return to ground? Do you pass by a waiting passenger if you’re ascending / descending at full speed?