2 %> Generate the 2-opt neightborhood
for the TSP
8 %> @author Michel Bierlaire
9 %> @date Tue Apr 14 15:29:19 2015
10 %> @ingroup Algorithms
13 %> Generate the 2-opt neightborhood
for the TSP
14 %> @param cities current tour
15 %> @
return matrix containing all tours neighbor of the current one
17 nCities = size(cities,1) ;
27 next =
twoOpt(cities,i,j) ;
34 neighborhood = [neighborhood next] ;
35 city1 = [city1 cities(i)] ;
36 city2 = [city2 cities(j)] ;
function tspInsertionLocalSearch(in dist, in subtourList)
function twoOpt(in cities, in c1, in c2)
Perform a 2-opt operation of a list of cities.
function twoOptNeighborhood(in cities)
Generate the 2-opt neightborhood for the TSP.
function tspLocalSearch(in tour, in dist)