So here is the problem: There are n objects in a super market that you need to retrieve, then you need to go to the cashier register in the end. How do you find the best path of traversing the least distance to retrieve the objects and finally go to the cashier register?I could only find a brute force method of finding optimal path of each permutation of paths and seeing which overall distance covers the least traversing. But this implementation is O(n!). Is there a more efficient approach?
optimal path for traversing nodes
optimization;graph traversal;searching