1 function [routeRandom, distanceRandom, routeNearest, distanceNearest, ...
\r
2 routeFarthest, distanceFarthest, routeEnum, distanceEnum] ...
\r
3 = calculateHeuristics (distanceMatrix)
\r
4 % Calculate the best route and its distance using the different
\r
5 % heuristics: Random, Nearest Neighbour, Farthest Neighbour and
\r
6 % Enumerative (if the number of cities does not exceed ten).
\r
8 % Calculate the routes and distances using the three standard heuristics.
\r
9 [routeRandom,distanceRandom] = ltspsRandomHeuristic(distanceMatrix);
\r
10 [routeNearest,distanceNearest] = ltspsClosestNeighbourHeuristic(distanceMatrix);
\r
11 [routeFarthest,distanceFarthest] = ltspsFurthestNeighbourHeuristic(distanceMatrix);
\r
13 % Initialize the route and distance of the Enumerative solution.
\r
17 % Calculate using the Enumerative Solver if the number of cities does not
\r
19 if size(distanceMatrix,1) <= 10
\r
20 [routeEnum,distanceEnum] = ltspsEnumerativeSolver(distanceMatrix);
\r