1. Engineering
  2. Computer Science
  3. 1 the traveling salesman problem tsp is a famous problem...

Question: 1 the traveling salesman problem tsp is a famous problem...

Question details

1. The Traveling Salesman problem (TSP) is a famous problem for which there is no known, tractable solution (though efficient, approximate solutions exist) Given a list of cities and the distances in between, the task is to find the shortest possible tour (a closed walk in which all edges are distinct) that visits each city exactly once Consider the following algorithm for solving the TSP n-number of cities m-nxnmatrix of distances between cities min -(infinity) for all possible tours, do find the length of the tour if length<min min -length store tour a) What is the worst-case (big-O) complexity of this algorithm in terms of n (number of cities)? You may assume that matrix lookup is O(1), and that the body of the if statement is also O(1). You need not count the if-statement or the for-loop conditional (i.e., testing to see when the for-loop is done), or any of the initializations at the start of the algorithm. Clearly show the justification for your answer

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution