Travelling Salesman Problem

Can be used to solve both symmetric and asymmetric tsp; The script reads the distance matrix from an input file.

Vous suivez désormais cette soumission

The script is a modification of the TSP Example, Matlab Optimization Toolbox (https://mathworks.com/help/optim/ug/travelling-salesman-problem.html) to solve asymmetrical TSPs.
*detectSubtours.m has been kept intact without any change.
1. The script solves TSPs (both symmetric and asymmetric) based on binary integer programming
2. Required inputs: Distance matrix file. Place the input file in the same folder as the script. Distance matrix should be a square matrix.
3. Enter the file name in the prompt along with extension like .csv/.xls
4. Distance between (i,i) should be 0. Also if there is no route between two nodes, the corresponding matrix value should be zero.

Citation pour cette source

Santhanakrishnan Narayanan (2026). Travelling Salesman Problem (https://fr.mathworks.com/matlabcentral/fileexchange/64654-travelling-salesman-problem), MATLAB Central File Exchange. Extrait(e) le .

Informations générales

Compatibilité avec les versions de MATLAB

  • Compatible avec les versions R2016a à R2019b

Plateformes compatibles

  • Windows
  • macOS
  • Linux
Version Publié le Notes de version Action
1.2.3.0

Minor modifications in the code

1.2.2.0

csvread function has been replaced with readmatrix function

1.2.1.0

There was a numerical issue when using the script in Matlab 2018 or later. The issue has been rectified and the script has been tested in Matlab 2019.

1.2.0.0

There was a bug related to constraint for (i->i) and non-existing routes in previous version and has been rectified in this version.

1.1.0.0

There was a request for sample csv file. I have added a csv file containing distances corresponding to 79 German cities. The distances were taken from google maps. In the command prompt for distance matrix file, enter germanCities.csv

1.0.0.0