Fastest way to get from one permutation to another (with distances between elements)

53 Views Asked by At

enter image description hereImagine that I have some rows of shelves. Some shelves have items on them. Some may be empty. Imagine also that I have computed the shortest paths between each location (using Dijkstra's algorithm, for example). I want to rearrange the items on the shelves to some fixed permutation that I have in mind. Is there an algorithm to find the optimum way to rearrange the shelves i.e the sequence of relocations for which I will have to travel the least distance? Let's also say I can only carry one item at a time, although I would also be interested to find out how the algorithm would change if we allowed multiple people each carrying an item.