User Tools

Site Tools


travelling_salesman_problem

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
travelling_salesman_problem [2015/09/22 12:49]
bsuresh Minor change, added \ldots
travelling_salesman_problem [2024/04/24 03:11] (current)
65.108.99.179 old revision restored (2024/04/18 13:15)
Line 5: Line 5:
 ===== Integer linear programming formulation ===== ===== Integer linear programming formulation =====
  
-TSP can be formulated as an integer linear program. Label the cities with the numbers $0, \ldots, n$ and define:+TSP can be formulated as an integer linear program. Label the cities with the numbers $0, ..., n$ and define:
 $$ $$
  x_{ij} = \begin{cases} 1 & \text{the path goes from city } i \text{ to city } j \\ 0 & \text{otherwise} \end{cases}  x_{ij} = \begin{cases} 1 & \text{the path goes from city } i \text{ to city } j \\ 0 & \text{otherwise} \end{cases}
 $$ $$
 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 &\sum_{i=0}^n \sum_{j\ne i,j=0}^nc_{ij}x_{ij} &&  \\ \min &\sum_{i=0}^n \sum_{j\ne i,j=0}^nc_{ij}x_{ij} &&  \\
Line 19: Line 19:
 &u_i-u_j +nx_{ij} \le n-1 && 1 \le i \ne j \le n &u_i-u_j +nx_{ij} \le n-1 && 1 \le i \ne j \le n
 \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.
  
travelling_salesman_problem.1442940549.txt.gz ยท Last modified: 1998/12/03 12:11 (external edit)