Yes,there is an obvious algorithm to test each possible trip and find the best one. The trouble is the exponential run-time.
Chat with our AI personalities
An algorithm.
deadlock avoidance
If you cannot find any iterative algorithm for the problem, you have to settle for a recursive one.
An algorithm is just a description of a series of steps used to solve a specific problem.
By preparing test cases we can test an algorithm. The algorithm is tested with each test case.