Search code examples
traveling-salesmancomputer-science-theory

Clarification on the formulation of the Traveling Salesman


I have been doing research in the traveling salesman problem, and I have a question about how it is formulated. Or this might be a question on classification or name of sub-problems or variations on the problem.

In the traveling salesman problem are the cities places in a space and the distances between the cities measured to form a graph with weighted connections, or can the weights on the edges be arbitrarily chosen, even though they might make it impossible to lay the cities out on a map?

If one of those is considered the standard traveling salesman problem, is there a name for the other one?


Solution

  • TSP can be defined in a lot of ways. You're describing the symmetric Euclidean TSP, where weights correspond to the actual distances between the nodes and traveling clockwise on a tour between the nodes would give. As suggested by Phpdna, the triangle inequality is satisfied.

    However, that's not the standard definition of the TSP. In fact, this IS the sub-problem or special case. The general problem can have any weight between each pair of nodes, and it doesn't have to be a Euclidean distance.

    For example, if you were trying to formulate the shortest tour by the cost of travel rather than distance, you'd have the cost of travel between cities as the weight between the vertices... that could be anything. City A might be closest to city B on a Euclidean map, but the cost of travel from A to B might be phenomenally greater than from A to C to B for whatever reason. This is the general scenario. But either way, they're both NP-hard.