1

so, as you can see from this link and below, Wikipedia defines TSP in some way that I don't understand. Apparently, there are at least 2 (one and two) posts in this site that use a previous version of the equation that is currently on Wikipedia and those seem more accurate to me.

Here is the current Wikipedia formulation:

Label the cities with the numbers $1, ...,n$ and define:

$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:

$\begin{align} \min &\sum_{i=1}^n \sum_{j\ne i,j=1}^nc_{ij}x_{ij} && \\ & 0 \le x_{ij} \le 1 && i,j=1, \cdots, n \\ & u_{i} \in \mathbf{Z} && i=1, \cdots, n \\ & \sum_{i=0,i\ne j}^n x_{ij} = 1 && j=1, \cdots, n \\ & \sum_{j=0,j\ne i}^n x_{ij} = 1 && i=1, \cdots, n \\ &u_i-u_j +nx_{ij} \le n-1 && 1 \le i \ne j \le n \end{align}$

and here is the previous Wikipedia formulation:

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} $

For $i = 0, ...,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} \min &\sum_{i=0}^n \sum_{j\ne i,j=0}^nc_{ij}x_{ij} && \\ & 0 \le x_{ij} \le 1 && i,j=0, \cdots, n \\ & u_{i} \in \mathbf{Z} && i=0, \cdots, n \\ & \sum_{i=0,i\ne j}^n x_{ij} = 1 && j=0, \cdots, n \\ & \sum_{j=0,j\ne i}^n x_{ij} = 1 && i=0, \cdots, n \\ &u_i-u_j +nx_{ij} \le n-1 && 1 \le i \ne j \le n \end{align}$

I particularly want to ask about the city 0.

What happens (or happened) to city 0 in the new version? If it really doesn't matter, then why the degree constraints still start from city 0? If there is a city 0, shouldn't its cost to other cities affect the total cost in the objective function? Similarly, shouldn't the subtour elimination constraints be

$\begin{align} u_i-u_j +nx_{ij} \le n-1 && 2 \le i \ne j \le n \end{align}$

instead of

$\begin{align} u_i-u_j +nx_{ij} \le n-1 && 1 \le i \ne j \le n \end{align}$

in the current version?

Thanks in advance.

Umut C.
  • 73

0 Answers0