Optimization: principles and algorithms, by Michel Bierlaire
getTourSequence.m
Go to the documentation of this file.
1 %> \file
2 %> Transform tour stored as list of successor, into a sequence of cities
3 %>
4 %> @note Called by \ref tspInsertionLocalSearch
5 %>
6 %> @author Michel Bierlaire
7 %> @date Wed Apr 15 12:12:51 2015
8 %> @ingroup Algorithms
9 %> @ingroup chap27
10 
11 %> Print tour stored as list of successor
12 %> @param tour
13 function sequence = getTourSequence(tour)
14  currentnode = 1 ;
15  sequence = [currentnode] ;
16  while (tour(currentnode) != 0)
17  currentnode = tour(currentnode) ;
18  sequence = [sequence ; currentnode] ;
19  endwhile
20 endfunction
function tspInsertionLocalSearch(in dist, in subtourList)
function getTourSequence(in tour)
Print tour stored as list of successor.
Copyright 2015-2016 Michel Bierlaire