I am confused by Wikipedia's Linear Programming formulation of the Traveling Salesman Problem, in say the objective function.
Question: If there are n cities indexed 1,...,n, what is city with index 0?
This can be seen in the objective function which has the summation of $c_{ij} x_{ij}$ from i=0...n. Also seen in the third and forth constraint.
It seems like Wikipedia's ILP formulation of the TSP is wrong/incomplete. What changes are needed to make it correct?
There is also an older/different version of the formulation, is this correct?
And another one found on Stackexchange




I have a hunch on whoever made the figure was simultaneously thinking about it in a programming sense (where indexes start at zero) and mistranslated it into a formal expression. A safer way to represent the problem while trying to avoid hard indexes is to use generalizations like so:
Let $C$ denote the set of cities that will be visited.
Let $c_{ij}$ denote the cost it takes for the traveling salesperson to go from city $i$ to city $j$.
Let $x_{ij}$ denote a binary decision variable if a path from city $i$ to city $j$ is selected.
then the model will go as follows (Miller-Tucker-Zemlin):
Minimize the cost of traveling to all cities in set $C$:
$$\min z = \sum_{i\in C}\sum_{j\in C}c_{ij}x_{ij}$$
Subject to:
Each City needs to be visited: $$\sum_{j\in C} x_{ij}=1\quad\forall i\in C$$ $$\sum_{i\in C} x_{ij}=1\quad\forall j\in C$$
No self loops: $$x_{ii} =0 \quad\forall i\in C$$
Sub-tour Elimination:
$$|C|\cdot x_{ij}+ u_i - u_j \le |C| - 1\quad\forall i \neq j \in\{2,3,\ldots, |C|\}$$ $$1\le u_i \le |C| -1 \quad \forall i \in\{2,3,\ldots, |C|\}$$
Variable Restrictions: $$x_{ij}\in\{0,1\} \quad \forall i,j \in C$$ $$u_i \in \mathbb Z^+ \quad \forall i \in\{2,3,\ldots, |C|\}$$
With this approach, it translates better to the reader what each part is doing in less terms and avoids messy indexing. Also regardless, both of the formulations shown in the question are missing constraints regarding self loops ($x_{ii} = 0$)