p12 | Traveling Salesman Problem (TSP)¶
Note
The problem implicitly assumes more than two cities (\(n > 2\)).
NP-hard: yes
Description¶
The Traveling Salesman Problem (TSP) aims to find the shortest cycle in a graph that visits every node exactly once.
Formulations¶
Formulation a (valid)¶
Note
This is the MTZ formulation of the TSP from
v1of Yazdani et al. [2].
Parameters¶
Name |
Description |
Type |
Shape |
|---|---|---|---|
|
Number of cities |
integer |
scalar |
|
Travel cost from city \(i\) to city \(j\) |
continuous |
|
Variables¶
Name |
Description |
Type |
Shape / Indices |
|---|---|---|---|
|
\(1\) if the tour goes directly from city \(i\) to city \(j\), \(0\) otherwise |
binary |
|
|
MTZ position of city \(i\) in the tour |
continuous |
|
Assumptions¶
Description |
Formulation |
Implicit |
|---|---|---|
There must be at least two cities to form a tour. |
\(n \geq 2\) |
yes |
Constraints¶
Each city has exactly one outgoing arc in the tour.
\[ \sum_{j \in V,\, j \neq i} x_{ij} = 1 \quad \forall i \in V \]Each city has exactly one incoming arc in the tour.
\[ \sum_{i \in V,\, i \neq j} x_{ij} = 1 \quad \forall j \in V \]MTZ subtour elimination constraint.
\[ u_i - u_j + n \times x_{ij} \leq n - 1 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]Depot position is fixed to \(1\) to anchor the tour ordering.
\[ u_0 = 1 \]Lower bound on MTZ position: each non-depot city’s position is at least \(2\).
\[ u_i \geq 2 \quad \forall i \in V \setminus \{0\} \]Upper bound on MTZ position: each city’s position is at most \(n\).
\[ u_i \leq n \quad \forall i \in V \]No self-loops: a city cannot have an arc to itself. (implicit)
\[ x_{ii} = 0 \quad \forall i \in V \]
Objective¶
Minimize the total travel cost of the Hamiltonian cycle.
Formulation b (valid)¶
Note
This is the MTZ formulation of the TSP from
v1of Yazdani et al. [2] augmented with acceleration cut EC1.
Parameters¶
Name |
Description |
Type |
Shape |
|---|---|---|---|
|
Number of cities |
integer |
scalar |
|
Travel cost from city \(i\) to city \(j\) |
continuous |
|
Variables¶
Name |
Description |
Type |
Shape / Indices |
|---|---|---|---|
|
\(1\) if the tour goes directly from city \(i\) to city \(j\), \(0\) otherwise |
binary |
|
|
MTZ position of city \(i\) in the tour |
continuous |
|
Assumptions¶
Description |
Formulation |
Implicit |
|---|---|---|
There must be at least two cities to form a tour. |
\(n \geq 2\) |
yes |
Constraints¶
Each city has exactly one outgoing arc in the tour.
\[ \sum_{j \in V,\, j \neq i} x_{ij} = 1 \quad \forall i \in V \]Each city has exactly one incoming arc in the tour.
\[ \sum_{i \in V,\, i \neq j} x_{ij} = 1 \quad \forall j \in V \]MTZ subtour elimination constraint.
\[ u_i - u_j + n \times x_{ij} \leq n - 1 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]Depot position is fixed to \(1\) to anchor the tour ordering.
\[ u_0 = 1 \]Lower bound on MTZ position: each non-depot city’s position is at least \(2\).
\[ u_i \geq 2 \quad \forall i \in V \setminus \{0\} \]Upper bound on MTZ position: each city’s position is at most \(n\).
\[ u_i \leq n \quad \forall i \in V \]No self-loops: a city cannot have an arc to itself. (implicit)
\[ x_{ii} = 0 \quad \forall i \in V \]Depot-Exit Position Bound (EC1): if the tour leaves the depot directly to city \(j\), then \(j\) is positioned at most second in the ordering.
\[ u_j \leq 2 + (n-2)(1 - x_{0j}) \quad \forall j \in V \setminus \{0\} \]
Objective¶
Minimize the total travel cost of the Hamiltonian cycle.
Formulation c (valid)¶
Note
This is the MTZ formulation of the TSP from
v1of Yazdani et al. [2] augmented with acceleration cut EC2.
Parameters¶
Name |
Description |
Type |
Shape |
|---|---|---|---|
|
Number of cities |
integer |
scalar |
|
Travel cost from city \(i\) to city \(j\) |
continuous |
|
Variables¶
Name |
Description |
Type |
Shape / Indices |
|---|---|---|---|
|
\(1\) if the tour goes directly from city \(i\) to city \(j\), \(0\) otherwise |
binary |
|
|
MTZ position of city \(i\) in the tour |
continuous |
|
Assumptions¶
Description |
Formulation |
Implicit |
|---|---|---|
There must be at least two cities to form a tour. |
\(n \geq 2\) |
yes |
Constraints¶
Each city has exactly one outgoing arc in the tour.
\[ \sum_{j \in V,\, j \neq i} x_{ij} = 1 \quad \forall i \in V \]Each city has exactly one incoming arc in the tour.
\[ \sum_{i \in V,\, i \neq j} x_{ij} = 1 \quad \forall j \in V \]MTZ subtour elimination constraint.
\[ u_i - u_j + n \times x_{ij} \leq n - 1 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]Depot position is fixed to \(1\) to anchor the tour ordering.
\[ u_0 = 1 \]Lower bound on MTZ position: each non-depot city’s position is at least \(2\).
\[ u_i \geq 2 \quad \forall i \in V \setminus \{0\} \]Upper bound on MTZ position: each city’s position is at most \(n\).
\[ u_i \leq n \quad \forall i \in V \]No self-loops: a city cannot have an arc to itself. (implicit)
\[ x_{ii} = 0 \quad \forall i \in V \]Depot-Entry Position Bound (EC2): if the tour returns to the depot from city \(i\), then \(i\) is positioned last in the ordering.
\[ u_i \geq n - (n-2)(1 - x_{i0}) \quad \forall i \in V \setminus \{0\} \]
Objective¶
Minimize the total travel cost of the Hamiltonian cycle.
Formulation d (invalid)¶
Note
This is the MTZ formulation of the TSP from
v1of Yazdani et al. [2] augmented with acceleration cut EC3.
Parameters¶
Name |
Description |
Type |
Shape |
|---|---|---|---|
|
Number of cities |
integer |
scalar |
|
Travel cost from city \(i\) to city \(j\) |
continuous |
|
Variables¶
Name |
Description |
Type |
Shape / Indices |
|---|---|---|---|
|
\(1\) if the tour goes directly from city \(i\) to city \(j\), \(0\) otherwise |
binary |
|
|
MTZ position of city \(i\) in the tour |
continuous |
|
Assumptions¶
Description |
Formulation |
Implicit |
|---|---|---|
There must be at least two cities to form a tour. |
\(n \geq 2\) |
yes |
Constraints¶
Each city has exactly one outgoing arc in the tour.
\[ \sum_{j \in V,\, j \neq i} x_{ij} = 1 \quad \forall i \in V \]Each city has exactly one incoming arc in the tour.
\[ \sum_{i \in V,\, i \neq j} x_{ij} = 1 \quad \forall j \in V \]MTZ subtour elimination constraint.
\[ u_i - u_j + n \times x_{ij} \leq n - 1 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]Depot position is fixed to \(1\) to anchor the tour ordering.
\[ u_0 = 1 \]Lower bound on MTZ position: each non-depot city’s position is at least \(2\).
\[ u_i \geq 2 \quad \forall i \in V \setminus \{0\} \]Upper bound on MTZ position: each city’s position is at most \(n\).
\[ u_i \leq n \quad \forall i \in V \]No self-loops: a city cannot have an arc to itself. (implicit)
\[ x_{ii} = 0 \quad \forall i \in V \]Two-City Detour Elimination (EC3): eliminates infeasible two-city detours through the depot for any pair of non-depot cities \(i\), \(j\). This cut is invalid because it excludes the feasible \(1 \to 2 \to 3 \to 1\) tour when \(n=3\).
\[ x_{j0} + x_{ji} + u_j - u_i - 1 \leq (n-1)(2 - x_{0i} - x_{ij}) \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]
Objective¶
Minimize the total travel cost of the Hamiltonian cycle.
Formulation e (invalid)¶
Note
This is the MTZ formulation of the TSP from
v2of Yazdani et al. [2] augmented with acceleration cut EC1.
Parameters¶
Name |
Description |
Type |
Shape |
|---|---|---|---|
|
Number of cities |
integer |
scalar |
|
Travel cost from city \(i\) to city \(j\) |
continuous |
|
Variables¶
Name |
Description |
Type |
Shape / Indices |
|---|---|---|---|
|
\(1\) if the tour goes directly from city \(i\) to city \(j\), \(0\) otherwise |
binary |
|
|
MTZ position of city \(i\) in the tour |
continuous |
|
Assumptions¶
Description |
Formulation |
Implicit |
|---|---|---|
There must be at least two cities to form a tour. |
\(n \geq 2\) |
yes |
Constraints¶
Each city has exactly one outgoing arc in the tour.
\[ \sum_{j \in V,\, j \neq i} x_{ij} = 1 \quad \forall i \in V \]Each city has exactly one incoming arc in the tour.
\[ \sum_{i \in V,\, i \neq j} x_{ij} = 1 \quad \forall j \in V \]MTZ subtour elimination constraint.
\[ u_i - u_j + n \times x_{ij} \leq n - 1 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]Depot position is fixed to \(1\) to anchor the tour ordering.
\[ u_0 = 1 \]Lower bound on MTZ position: each non-depot city’s position is at least \(2\).
\[ u_i \geq 2 \quad \forall i \in V \setminus \{0\} \]Upper bound on MTZ position: each city’s position is at most \(n\).
\[ u_i \leq n \quad \forall i \in V \]No self-loops: a city cannot have an arc to itself. (implicit)
\[ x_{ii} = 0 \quad \forall i \in V \]Arc Symmetry (EC1): both directions of an arc cannot be simultaneously active, eliminating two-city cycles. This cut is invalid because it excludes the feasible \(1 \to 2 \to 1\) tour when \(n=2\).
\[ x_{ij} + x_{ji} \leq 1 \quad \forall i, j \in V,\; i < j \]
Objective¶
Minimize the total travel cost of the Hamiltonian cycle.
Formulation f (invalid)¶
Note
This is the MTZ formulation of the TSP from
v2of Yazdani et al. [2] augmented with acceleration cut EC2.
Parameters¶
Name |
Description |
Type |
Shape |
|---|---|---|---|
|
Number of cities |
integer |
scalar |
|
Travel cost from city \(i\) to city \(j\) |
continuous |
|
Variables¶
Name |
Description |
Type |
Shape / Indices |
|---|---|---|---|
|
\(1\) if the tour goes directly from city \(i\) to city \(j\), \(0\) otherwise |
binary |
|
|
MTZ position of city \(i\) in the tour |
continuous |
|
Assumptions¶
Description |
Formulation |
Implicit |
|---|---|---|
There must be at least two cities to form a tour. |
\(n \geq 2\) |
yes |
Constraints¶
Each city has exactly one outgoing arc in the tour.
\[ \sum_{j \in V,\, j \neq i} x_{ij} = 1 \quad \forall i \in V \]Each city has exactly one incoming arc in the tour.
\[ \sum_{i \in V,\, i \neq j} x_{ij} = 1 \quad \forall j \in V \]MTZ subtour elimination constraint.
\[ u_i - u_j + n \times x_{ij} \leq n - 1 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]Depot position is fixed to \(1\) to anchor the tour ordering.
\[ u_0 = 1 \]Lower bound on MTZ position: each non-depot city’s position is at least \(2\).
\[ u_i \geq 2 \quad \forall i \in V \setminus \{0\} \]Upper bound on MTZ position: each city’s position is at most \(n\).
\[ u_i \leq n \quad \forall i \in V \]No self-loops: a city cannot have an arc to itself. (implicit)
\[ x_{ii} = 0 \quad \forall i \in V \]Depot Triangle (EC2): eliminates three-city subtours passing through the depot; at most 2 of the 6 arcs in any depot-adjacent triangle can be active. This cut is invalid because it excludes the feasible \(1 \to 2 \to 3 \to 1\) tour when \(n=3\).
\[ x_{0i} + x_{i0} + x_{0j} + x_{j0} + x_{ij} + x_{ji} \leq 2 \quad \forall i, j \in V \setminus \{0\},\; i < j \]
Objective¶
Minimize the total travel cost of the Hamiltonian cycle.
Formulation g (valid)¶
Note
This is the MTZ formulation of the TSP from
v2of Yazdani et al. [2] augmented with acceleration cut EC3.
Parameters¶
Name |
Description |
Type |
Shape |
|---|---|---|---|
|
Number of cities |
integer |
scalar |
|
Travel cost from city \(i\) to city \(j\) |
continuous |
|
Variables¶
Name |
Description |
Type |
Shape / Indices |
|---|---|---|---|
|
\(1\) if the tour goes directly from city \(i\) to city \(j\), \(0\) otherwise |
binary |
|
|
MTZ position of city \(i\) in the tour |
continuous |
|
Assumptions¶
Description |
Formulation |
Implicit |
|---|---|---|
There must be at least two cities to form a tour. |
\(n \geq 2\) |
yes |
Constraints¶
Each city has exactly one outgoing arc in the tour.
\[ \sum_{j \in V,\, j \neq i} x_{ij} = 1 \quad \forall i \in V \]Each city has exactly one incoming arc in the tour.
\[ \sum_{i \in V,\, i \neq j} x_{ij} = 1 \quad \forall j \in V \]MTZ subtour elimination constraint.
\[ u_i - u_j + n \times x_{ij} \leq n - 1 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]Depot position is fixed to \(1\) to anchor the tour ordering.
\[ u_0 = 1 \]Lower bound on MTZ position: each non-depot city’s position is at least \(2\).
\[ u_i \geq 2 \quad \forall i \in V \setminus \{0\} \]Upper bound on MTZ position: each city’s position is at most \(n\).
\[ u_i \leq n \quad \forall i \in V \]No self-loops: a city cannot have an arc to itself. (implicit)
\[ x_{ii} = 0 \quad \forall i \in V \]Lifted Desrochers-Laporte MTZ Ordering (EC3): strengthened MTZ constraint incorporating the reverse arc with a tighter coefficient.
\[ u_i - u_j + (n-1) x_{ij} + (n-3) x_{ji} \leq n - 2 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]
Objective¶
Minimize the total travel cost of the Hamiltonian cycle.
Formulation h (valid)¶
Note
This is the MTZ formulation of the TSP from
v2of Yazdani et al. [2] augmented with acceleration cut EC4.
Parameters¶
Name |
Description |
Type |
Shape |
|---|---|---|---|
|
Number of cities |
integer |
scalar |
|
Travel cost from city \(i\) to city \(j\) |
continuous |
|
Variables¶
Name |
Description |
Type |
Shape / Indices |
|---|---|---|---|
|
\(1\) if the tour goes directly from city \(i\) to city \(j\), \(0\) otherwise |
binary |
|
|
MTZ position of city \(i\) in the tour |
continuous |
|
Assumptions¶
Description |
Formulation |
Implicit |
|---|---|---|
There must be at least two cities to form a tour. |
\(n \geq 2\) |
yes |
Constraints¶
Each city has exactly one outgoing arc in the tour.
\[ \sum_{j \in V,\, j \neq i} x_{ij} = 1 \quad \forall i \in V \]Each city has exactly one incoming arc in the tour.
\[ \sum_{i \in V,\, i \neq j} x_{ij} = 1 \quad \forall j \in V \]MTZ subtour elimination constraint.
\[ u_i - u_j + n \times x_{ij} \leq n - 1 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]Depot position is fixed to \(1\) to anchor the tour ordering.
\[ u_0 = 1 \]Lower bound on MTZ position: each non-depot city’s position is at least \(2\).
\[ u_i \geq 2 \quad \forall i \in V \setminus \{0\} \]Upper bound on MTZ position: each city’s position is at most \(n\).
\[ u_i \leq n \quad \forall i \in V \]No self-loops: a city cannot have an arc to itself. (implicit)
\[ x_{ii} = 0 \quad \forall i \in V \]Lower MTZ Envelope (EC4): tightens the lower bound on city \(i\)’s position using its depot-adjacent arcs.
\[ u_i \geq 3 - x_{0i} + (n-3) x_{i0} \quad \forall i \in V \setminus \{0\} \]
Objective¶
Minimize the total travel cost of the Hamiltonian cycle.
Formulation i (valid)¶
Note
This is the MTZ formulation of the TSP from
v2of Yazdani et al. [2] augmented with acceleration cut EC5.
Parameters¶
Name |
Description |
Type |
Shape |
|---|---|---|---|
|
Number of cities |
integer |
scalar |
|
Travel cost from city \(i\) to city \(j\) |
continuous |
|
Variables¶
Name |
Description |
Type |
Shape / Indices |
|---|---|---|---|
|
\(1\) if the tour goes directly from city \(i\) to city \(j\), \(0\) otherwise |
binary |
|
|
MTZ position of city \(i\) in the tour |
continuous |
|
Assumptions¶
Description |
Formulation |
Implicit |
|---|---|---|
There must be at least two cities to form a tour. |
\(n \geq 2\) |
yes |
Constraints¶
Each city has exactly one outgoing arc in the tour.
\[ \sum_{j \in V,\, j \neq i} x_{ij} = 1 \quad \forall i \in V \]Each city has exactly one incoming arc in the tour.
\[ \sum_{i \in V,\, i \neq j} x_{ij} = 1 \quad \forall j \in V \]MTZ subtour elimination constraint.
\[ u_i - u_j + n \times x_{ij} \leq n - 1 \quad \forall i, j \in V \setminus \{0\},\; i \neq j \]Depot position is fixed to \(1\) to anchor the tour ordering.
\[ u_0 = 1 \]Lower bound on MTZ position: each non-depot city’s position is at least \(2\).
\[ u_i \geq 2 \quad \forall i \in V \setminus \{0\} \]Upper bound on MTZ position: each city’s position is at most \(n\).
\[ u_i \leq n \quad \forall i \in V \]No self-loops: a city cannot have an arc to itself. (implicit)
\[ x_{ii} = 0 \quad \forall i \in V \]Upper MTZ Envelope (EC5): tightens the upper bound on city \(i\)’s position using its depot-adjacent arcs.
\[ u_i \leq (n-1) + x_{i0} - (n-3) x_{0i} \quad \forall i \in V \setminus \{0\} \]
Objective¶
Minimize the total travel cost of the Hamiltonian cycle.
Reformulations¶
Each entry below pairs two formulations of this problem, records whether the second is a reformulation of the first, and gives the parameter map carrying the first formulation’s parameters to the second’s.
a → b (valid)¶
Note
Formulation
bhas the same parameters as formulationa; the map is the identity.
Parameter map
Name |
Definition in terms of |
|---|---|
|
\(n = n\) |
|
\(c_{ij} = c_{ij}\) |
a → c (valid)¶
Note
Formulation
chas the same parameters as formulationa; the map is the identity.
Parameter map
Name |
Definition in terms of |
|---|---|
|
\(n = n\) |
|
\(c_{ij} = c_{ij}\) |
a → d (invalid)¶
Note
Formulation
dhas the same parameters as formulationa; the map is the identity.
Parameter map
Name |
Definition in terms of |
|---|---|
|
\(n = n\) |
|
\(c_{ij} = c_{ij}\) |
a → e (invalid)¶
Note
Formulation
ehas the same parameters as formulationa; the map is the identity.
Parameter map
Name |
Definition in terms of |
|---|---|
|
\(n = n\) |
|
\(c_{ij} = c_{ij}\) |
a → f (invalid)¶
Note
Formulation
fhas the same parameters as formulationa; the map is the identity.
Parameter map
Name |
Definition in terms of |
|---|---|
|
\(n = n\) |
|
\(c_{ij} = c_{ij}\) |
a → g (valid)¶
Note
Formulation
ghas the same parameters as formulationa; the map is the identity.
Parameter map
Name |
Definition in terms of |
|---|---|
|
\(n = n\) |
|
\(c_{ij} = c_{ij}\) |
a → h (valid)¶
Note
Formulation
hhas the same parameters as formulationa; the map is the identity.
Parameter map
Name |
Definition in terms of |
|---|---|
|
\(n = n\) |
|
\(c_{ij} = c_{ij}\) |
a → i (valid)¶
Note
Formulation
ihas the same parameters as formulationa; the map is the identity.
Parameter map
Name |
Definition in terms of |
|---|---|
|
\(n = n\) |
|
\(c_{ij} = c_{ij}\) |