7.3 The Travelling Salesman Problem
7.3.2 The symmetric travelling salesman problem
As explained in the previous section, the ATSP lower and upper bounding procedures perform poorly when applied to the symmetric TSP. For this reason, several STSP tailored procedures have been developed.
The STSP can be formulated on a complete undirected graphG =(V, E), in which with each edge(i, j )∈Eis associated a transportation costcijequal to that of a least-cost path betweeniandj inG. Hence,cijcosts satisfy the triangle inequality, and there exists an optimal solution which is a Hamiltonian cycle inG. Let xij, (i, j )∈E, be a binary decision variable equal to 1 if edge(i, j )∈Ebelongs to the least-cost Hamiltonian cycle, and to 0 otherwise. The formulation of the STSP is as follows (recall thati < jfor each edge(i, j )∈E).
258 SHORT-HAUL FREIGHT TRANSPORTATION
Minimize
(i,j )∈E
cijxij
subject to
i∈V:(i,j )∈E
xij +
i∈V:(j,i)∈E
xj i=2, j ∈V, (7.6)
(i,j )∈E:i∈S,j /∈S
xij +
(j,i)∈E:i∈S,j /∈S
xj i⩾2, S⊂V, 2⩽|S|⩽|V|/2, (7.7) xij ∈ {0,1}, (i, j )∈E.
Equations (7.6) mean that exactly two edges must be incident to every vertex j ∈V (degree constraints). Inequalities (7.7) state that, for every vertex subsetS, there exist at least two edges with one endpoint inS ⊂Vand the other endpoint in V\S(connectivity constraints). Since the connectivity constraints of a subsetSand that of its complementV\Sare equivalent, one has to consider only inequalities (7.7) associated with subsetsS ⊂Vsuch that|S|⩽|V|/2. Constraints (7.7) are redundant if|S| =1 because of (7.6). Alternatively, the connectivity constraints (7.7) can be replaced with the following equivalentsubcycle elimination constraints:
(i,j )∈E:i∈S,j∈S
xij ⩽|S| −1, S⊂V, 2⩽|S|⩽|V|/2.
A lower bound. The STSP is an NP-hard problem. A lower bound on the optimal solution cost z∗STSP can be obtained by solving the following problem (see Exer- cise 7.5).
Minimize
(i,j )∈E
cijxij (7.8)
subject to
i∈V:(i,r)∈E
xir+
i∈V:(r,i)∈E
xri =2, (7.9)
(i,j )∈E:i∈S,i=r,j /∈S,j=r
xij+
(j,i)∈E:i∈S,i=r,j /∈S,j=r
xj i⩾1,
S⊂V, 1⩽|S|⩽|V|/2, (7.10) xij ∈ {0,1}, (i, j )∈E, (7.11) wherer∈Vis arbitrarily chosen (rootvertex). Model (7.8)–(7.11) corresponds to a minimum-cost spanningr-tree problem (MSrTP), for which the optimal solution is a least-cost connected subgraph spanningGand such that vertexr ∈Vhas degree 2. The MSrTP can be solved inO(|V|2)) steps with the following procedure:
SHORT-HAUL FREIGHT TRANSPORTATION 259 Table 7.2 Shortest distances (in kilometres) between terminals in the Saint-Martin problem.
Betteville Bolbec Dieppe F´ecamp Le Havre Luneray Rouen Valmont Betteville 0.0 27.9 54.6 42.0 56.5 37.0 30.9 34.1 Bolbec 27.9 0.0 67.2 25.6 28.8 48.4 57.4 21.6 Dieppe 54.6 67.2 0.0 60.5 95.8 18.8 60.4 52.1 F´ecamp 42.0 25.6 60.5 0.0 39.4 43.1 70.2 12.2 Le Havre 56.5 28.8 95.8 39.4 0.0 77.2 84.5 44.4 Luneray 37.0 48.4 18.8 43.1 77.2 0.0 51.6 34.0
Rouen 30.9 57.4 60.4 70.2 84.5 51.6 0.0 59.3
Valmont 34.1 21.6 52.1 12.2 44.4 34.0 59.3 0.0
Step 1. Determine a minimum-cost treeT∗(V\ {r}, ET)spanningV\ {r}.
Step 2. Insert inT∗vertexras well as the two least-cost edges incident to vertexr.
Saint-Martin distributes fresh fishing products in Normandy (France). Last 7 June, the company received seven orders from sales points all located in northern Normandy.
It was decided to serve the seven requests by means of a single vehicle sited in Betteville. The problem can be formulated as an STSP on a complete graphG(V, E), whereVis composed of eight vertices corresponding to the sales points and of vertex 0 associated with the depot. With each edge(i, j )∈E, is associated a costcij equal to the shortest distance between verticesiandj (see Table 7.2). The minimum-cost spanning r-tree is depicted in Figure 7.9, to which corresponds a costz∗MSrTP = 225.8 km.
The MSrTP lower bound can be improved in two ways. In the former approach, the MSrTP relaxation is solved for more choices of the rootsr ∈ V and then the largest MSrTP lower bound is selected. In the latter method,r∈Vis fixed but each constraint (7.6) with the only exception ofj =ris relaxed in a Lagrangian fashion.
Letλj,j ∈V\ {r}, be the Lagrangian multiplier attached to vertexj ∈V\ {r}. A Lagrangian relaxation of the STSP is as follows.
Minimize
(i,j )∈E
cijxij +
j∈V\{r}
λj
i∈V:(i,j )∈E
xij +
i∈V:(j,i)∈E
xj i−2
(7.12) subject to
i∈V:(i,r)∈E
xir+
i∈V:(r,i)∈E
xri =2, (7.13)
260 SHORT-HAUL FREIGHT TRANSPORTATION
i j
5 7
6 1
3
4
2
12.2
28.8
27.9 21.6
34.0
30.9 51.6 18.8 cij
0
Figure 7.9 Minimum-cost spanningr-tree in the Saint-Martin problem.
(i,j )∈E:i∈S,i=r,j /∈S,j=r
xij+
(j,i)∈E:i∈S,i=r,j /∈S,j=r
xj i⩾1,
S⊂V, 1⩽|S|⩽|V|/2, (7.14) xij ∈ {0,1}, (i, j )∈E. (7.15) Setting arbitrarilyλr =0, the objective function (7.12) can be rewritten as
(i,j )∈E
(cij+λi+λj)xij−2
j∈V
λj. (7.16)
To determine the optimal multipliers (or at least a set of ‘good’ multipliers), a suitable variant of the subgradient method illustrated in Section 3.3.1 can be used. In particular, at thekth iteration the updating formula of the Lagrangian multipliers is the following,
λkj+1=λkj+βksjk, j ∈V\ {r}, where
sjk=
i∈V:(i,j )∈E
xijk +
i∈V:(j,i)∈E
xj ik −2, j ∈V\ {r},
xijk,(i, j )∈E, is the optimal solution of the Lagrangian relaxation MSrTP(λ) (7.16), (7.13)–(7.15) at thekth iteration, andβkcan be set equal to
βk= 1
k, k=1, . . . .
SHORT-HAUL FREIGHT TRANSPORTATION 261 The results of the first three iterations of the subgradient method in the Saint-Martin problem (r =0) are
λ1j =0, j ∈V\ {r}; z∗MSrTP(λ1)=225.8; s1= [1,−1,−1,−1,1,0,1]T; β1=1;
λ2= [1,−1,−1,−1,1,0,1]T; z∗MSrTP(λ2) =231.8;
s2= [1,−1,−1,−1,1,0,1]T; β2=0.5;
λ3= [32,−23,−32,−32,32,0,32]T; z∗MSrTP(λ3) =234.8.
Nearest-neighbour heuristic. The nearest-neighbour heuristic is a simple con- structive procedure that builds a Hamiltonian path by iteratively linking the vertex inserted at the previous iteration to its nearest unrouted neighbour. Finally, a Hamil- tonian cycle is obtained by connecting the two endpoints of the path. The nearest- neighbour heuristic often provides low-quality solutions, since the edges added in the final iterations may be very costly.
Step 0. SetC = {r}, wherer ∈V, is a vertex chosen arbitrarily, and seth=r.
Step 1. Identify the vertexk∈V\Ssuch thatchk=minj∈V\C{chj}.Addkat the end ofC.
Step 2. If|C| = |V|, addrat the end ofC,STOP(Ccorresponds to a Hamiltonian cycle), otherwise leth=kand go back to Step 1.
In order to find a feasible solutionx¯STSPto the Saint-Martin distribution problem, the nearest-neighbour heuristic is applied (r = 0), and the following Hamiltonian cycle is obtained (see Figure 7.10),
C= {(0,1), (1,7), (3,7), (3,4), (4,5), (2,5), (2,6), (0,6)},
whose cost is 288.4 km. The deviation of this solution cost from the available lower bound LB=234.8 is
¯
zSTSP−LB
LB =288.4−234.8
234.8 =22.8%.
The Christofides heuristic. The Christofides heuristic is a constructive procedure that works as follows.
Step 1. Compute a minimum-cost tree T = (V, ET ) spanning the vertices of G(V, E). Letz∗MSTPbe the cost of this tree.
262 SHORT-HAUL FREIGHT TRANSPORTATION
i j
5
7
6 0
1 3
4
2
12.2
77.2
27.9 21.6
30.9 18.8
39.4
60.4 cij
0
Figure 7.10 STSP feasible solution generated by the nearest-neighbour algorithm in the Saint-Martin problem.
Step 2. Compute a least-cost perfect matchingM(VD, ED)among the vertices of odd degree in the treeT (|VD|is always an even number). Letz∗Mbe the optimal matching cost. LetH (V, EH)be the Eulerian subgraph (or multigraph) of G induced by the union of the edges ofT andM(EH=ET ∪ED ).
Step 3. If there is a vertexj ∈Vof degree greater than 2 in subgraphH, eliminate fromES two edges incident inj and in verticesh∈ Vandk∈ V, withh=k.
Insert inEH edge(h, k)∈E(or the edge(k, h)∈Eif(h, k) /∈E) (theshortcuts method, see Figure 7.11). Repeat Step 3 until all vertices inVhave a degree of 2 in subgraphH.
Step 4. STOP, the setEHis a Hamiltonian cycle.
It is worth stressing that the substitution of a pair of edges(h, j )and(j, k)with edge(h, k) (Step 3 of the algorithm) generally involves a cost reduction since the triangle inequality holds. It can be shown that the cost of the Christofides solution is at most 50% higher than the optimal solution cost. The proof is omitted for brevity.
The Saint-Martin distribution problem is solved by means of the Christofides algo- rithm. The minimum-cost spanning tree is made up of edges{(0,1), (0,6), (1,4), (1,7), (2,5), (3,7), (5,7)}, and has a cost of 174.2 km. The optimal matching of the odd- degree vertices (1, 2, 3, 4, 6 and 7) is composed of edges (1,4), (2,6) and (3,7), and has a cost of 101.4 km. The Eulerian multigraph generated at the end of Step 2 is illustrated in Figure 7.12. Edges (1,7) and (3,7) are substituted for edge (1,3), edges (0,1) and (1,4) are substituted for edge (0,4). At this stage a Hamiltonian cycle of
SHORT-HAUL FREIGHT TRANSPORTATION 263
5 6
0 1
3
4 2
5 6
0 1
3
4 2
(a) (b)
0 0
Figure 7.11 The Christofides algorithm. (a) Partial solution at the end of Step 2 (mini- mum-cost spanning tree edges are continuous lines while matching edges are dashed lines).
(b) The Hamiltonian cycle obtained after Step 3 (where the degree of vertex 2 is reduced by removing edges (0,2) and (2,1) and by inserting edge (0,1), and the degree of vertex 4 is reduced by removing edges (1,4) and (4,6) and by inserting edge (1,6)).
cost equal to 267.2 km is obtained (see Figure 7.13). The deviation from the available lower bound LB is
¯
zSTSP−LB
LB =267.2−234.8
234.8 =13.8%.
Local search algorithms. Local search algorithms are iterative procedures that try to improve an initial feasible solutionx(0). At thekth step, the solutions contained in a ‘neighbourhood’ of the current solutionx(k) are enumerated. If there are feasible solutions less costly than the current solution x(k), the best solution of the neigh- bourhood is taken as the new current solutionx(k+1)and the procedure is iterated.
Otherwise, the procedure is stopped (the last current solution is alocal optimum).
Step 0. (Initialization). Letx(0)be the initial feasible solution and letN (x(0))be its neighbourhood. Seth=0.
Step 1. Enumerate the feasible solutions belonging toN (x(h)). Select the best fea- sible solutionx(h+1)∈N (x(h)).
Step 2. If the cost ofx(h+1)is less than that ofx(h), seth =h+1 and go back to Step 1; otherwise,STOP,x(h)is the best solution found.
264 SHORT-HAUL FREIGHT TRANSPORTATION
i j
5 7
6 0
1 3
4
2
12.2 12.2
28.8 28.8
27.9 21.6
34.0
30.9
60.4 18.8
cij
0
Figure 7.12 Eulerian multigraph generated by the Christofides heuristic in the Saint-Martin problem (minimum cost spanning tree edges are full lines and minimum-cost matching edges are dashed lines).
i j
5 7
6 0
1 3
4
2
12.2
28.8
34.0
30.9
60.4 18.8
25.6
56.5 cij
0
Figure 7.13 Hamiltonian cycle provided by the Christofides algorithm in the Saint-Martin problem.
For the STSP,N (x(h))is commonly defined as the set of all Hamiltonian cycles that can be obtained by substitutingkedges(2⩽k⩽|V|)ofx(h)forkother edges inE(k-exchange) (Figure 7.14).
Step 0. LetC(0) be the initial Hamiltonian cycle and letz(0)STSPbe the cost ofC(0). Seth=0.
Step 1. Identify the best feasible solutionC(h+1) that can be obtained through a k-exchange. IfzSTSP(h+1)< z(h)STSP,STOP,C(h)is a Hamiltonian cycle for the STSP.
SHORT-HAUL FREIGHT TRANSPORTATION 265
Figure 7.14 A feasible 3-exchange (dotted edges are removed, dashed edges are inserted).
Step 2. Leth=h+1 and go back to Step 1.
In a local search algorithm based onk-exchanges,k can be constant or can be dynamically increased in order to intensify the search when improvements are likely to occur. Ifkis constant, each execution of Step 1 requiresO(|V|k)operations. In general,kis set equal to 2 or 3 at most, in order to limit the computational effort.
If a 2-exchange procedure is applied to the solution provided by the Christofides heuristic in the Saint-Martin problem, a less costly Hamiltonian cycle (see Figure 7.15) is obtained at the first iteration by replacing edges (0,4) and (1,3) with edges (0,1) and (3,4). As a consequence, the solution cost decreases by 14.8 km.