2 %> Calculate the length of a tour of the TSP
5 %> @note Called by \ref
tspVns 9 %> @author Michel Bierlaire
10 %> @date Tue Apr 14 11:44:01 2015
11 %> @ingroup Algorithms
15 %> Calculate the length of a tour
for the TSP
16 %> @param tour list of cities
17 %> @param dist distance matrix
18 %> @
return l tour length
20 [n, shouldBeOne]= size(tour) ;
21 [dsn, dsm] = size(dist) ;
23 error(
"Incompatible dimensions") ;
26 error(
"Incompatible dimensions") ;
30 l += dist(tour(i),tour(i+1)) ;
32 l += dist(tour(end),tour(1)) ;
function tspSimulatedAnnealing(in tour, in dist)
function tspInsertionLocalSearch(in dist, in subtourList)
function tspTourLength(in tour, in dist)
Calculate the length of a tour for the TSP.
function tspLocalSearch(in tour, in dist)
function tspVns(in tour, in dist)
Runs the VNS heuristic on the TSP.