What is the traveling salesman problem?

Problem Description:

What is the traveling salesman problem.

Questions and Answers:

The Traveling Salesman Problem (TSP) is a well-known combinatorial optimization problem and is an NP-hard problem. The description of the problem is this:

Suppose there is a traveling salesman who wants to visit n cities, and there is a travel distance between each pair of cities. The traveling salesman's task is to find the shortest route that allows him to pass through each city once and finally return to the starting city.

Specifically, TSP can be described in the following way:

  • There are n cities, numbered 1 to n.
  • For each pair of cities i and j, there is a distance or cost d(i, j) representing the travel distance from city i to city j.
  • The goal of the traveling salesman is to find a path that passes through each city once and finally returns to the starting city with the shortest total travel distance.

TSP is a classic combinatorial optimization problem, and its applications involve logistics planning, circuit board wiring, biology, transportation planning and other fields. Due to its NP-hard nature, the difficulty of solving the problem increases exponentially as the number of cities increases.

Methods to solve TSP include exhaustive methods (feasible for small-scale problems), dynamic programming, greedy algorithms, genetic algorithms, simulated annealing and other heuristic algorithms. Although an algorithm to solve TSP in polynomial time has not been found, in practical problems, it is a common practice to use methods such as heuristic algorithms to find approximately optimal solutions.

Notice:

"NP-hard" is a term used in computer science to describe the difficulty of a problem. NP-hard (Non-deterministic Polynomial-time hard) problem is a type of non-deterministic polynomial-time hard problem. This means that within a certain amount of time, we cannot find a polynomial-time algorithm to solve this type of problem.

A problem is said to be NP-hard if any problem belonging to the NP (non-deterministic polynomial time) class can be reduced to it in polynomial time. Reduction refers to converting one problem into another problem so that in the process of solving one problem, we can use the solution of the other problem.

The NP-hard problem itself is not necessarily solvable in non-deterministic polynomial time, but if we can solve any NP-hard problem in polynomial time, then all problems belonging to the NP class can also be solved in polynomial time, because They can be transformed into the same NP-hard problem through reduction.

Classic examples are the traveling salesman problem (TSP) and the set covering problem. Although we have not yet found a polynomial time algorithm to solve these problems, if we can solve any of them in polynomial time, then we will be able to solve all NP problems. This gives NP-hard problems an important position in computational complexity theory.

Guess you like

Origin blog.csdn.net/weixin_43501408/article/details/135406332