Question: 1 : ( Elevator Optimization ) Assume that you work in a very tall building with aslow elevator. The elevator is frustratingly interrupted when people
: Elevator Optimization Assume that you work in a very tall building with aslow elevator. The elevator is frustratingly interrupted when people press buttonsfor many neighboring floors during a trip. Encountering interruptions during anupward journey becomes especially frustrating when individuals press buttons forseveral neighboring floors, like and The ascent is repeatedlyinterrupted three times, once at each of these floors. A more considerateapproach would be for those passengers to collectively agree to press only thebutton for floor Subsequently, individuals on floors and could opt to usethe stairs for a single floor, taking advantage of the opportunity to walk. Wepresume that the cost of ascending a flight of stairs is equivalent to descending considering the health benefits of exercise. To resolve ties between solutions withequal costs, management suggests prioritizing elevator stops at the lowest floorpossible, as this consumes less electricity. Importantly, the elevator is notobligated to stop precisely at the floors specified by riders; for instance, if ridersindicate floors and the elevator can choose to stop at floor instead. Yourtask is to optimize the elevator's stops to minimize the total walking distance forthe riders
I want code for this
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
