How can I use recursion in an Hamiltonian cycle?
I got to resolve an optimization and programmation problem in my cursus of Business Engineering. The program must simulate the movements of an elevator at the start to serve n people in the Empire State Building. Here is the problem statement, and unfortunately, I have trouble in recursion coding using the permutation code : 5. Implements the presence of a second lift whose purpose is to minimize the longest waiting times. This second lift has a capacity of 5 people, as for the first one. Whenever the maximum waiting time exceeds 100 seconds, the second lift turns on. It first identifies the set S of the 5 most long-waiting people and builds both the set Q={(origin_i, destination_i), for each i in S} and the distance matrix D between each pairs of distinct floors in Q. Subsequently, it computes the shortest Hamiltonian path in the graph induced by D and serves the people in S according to this schema. The four first steps were quite easy, but the fifth is quite harder.