Travelling Salesman Problem
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.
Cite As
Santhanakrishnan Narayanan (2025). Travelling Salesman Problem (https://www.mathworks.com/matlabcentral/fileexchange/64654-travelling-salesman-problem), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Mathematics and Optimization > Global Optimization Toolbox > Particle Swarm >
- AI and Statistics > Statistics and Machine Learning Toolbox > Cluster Analysis and Anomaly Detection > Nearest Neighbors >
- Mathematics and Optimization > Optimization Toolbox > Linear Programming and Mixed-Integer Linear Programming > Solver-Based Linear Programming >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
atsp
Version | Published | Release Notes | |
---|---|---|---|
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 |