This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
travelling_salesman_problem [2023/05/05 05:45] 135.181.140.36 old revision restored (2015/10/28 11:30) |
travelling_salesman_problem [2024/04/17 12:40] 47.128.33.178 old revision restored (2024/03/14 11:02) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Travelling salesman problem ====== | ====== Travelling salesman problem ====== | ||
- | |||
- | < | ||
The travelling salesman problem (TSP) asks the following question: Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city? It is an NP-hard problem in combinatorial optimization, | The travelling salesman problem (TSP) asks the following question: Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city? It is an NP-hard problem in combinatorial optimization, | ||
Line 12: | Line 10: | ||
$$ | $$ | ||
For $i = 1, ..., n$, let $u_i$ be an artificial variable, and finally take $c_{ij}$ to be the distance from city $i$ to city $j$. Then TSP can be written as the following integer linear programming problem: | For $i = 1, ..., n$, let $u_i$ be an artificial variable, and finally take $c_{ij}$ to be the distance from city $i$ to city $j$. Then TSP can be written as the following integer linear programming problem: | ||
+ | $$ | ||
\begin{align} | \begin{align} | ||
\min & | \min & | ||
Line 21: | Line 19: | ||
& | & | ||
\end{align} | \end{align} | ||
+ | $$ | ||
The first set of equalities requires that each city be arrived at from exactly one other city, and the second set of equalities requires that from each city there is a departure to exactly one other city. The last constraints enforce that there is only a single tour covering all cities, and not two or more disjointed tours that only collectively cover all cities. To prove this, it is shown below (1) that every feasible solution contains only one closed sequence of cities, and (2) that for every single tour covering all cities, there are values for the dummy variables $u_i$ that satisfy the constraints. | The first set of equalities requires that each city be arrived at from exactly one other city, and the second set of equalities requires that from each city there is a departure to exactly one other city. The last constraints enforce that there is only a single tour covering all cities, and not two or more disjointed tours that only collectively cover all cities. To prove this, it is shown below (1) that every feasible solution contains only one closed sequence of cities, and (2) that for every single tour covering all cities, there are values for the dummy variables $u_i$ that satisfy the constraints. | ||