Dynamic Programming solution to the TSP

This function solves the Traveling Salesman Problem (TSP) using Dynamic programming (DP).
2.7K Downloads
Updated 15 May 2011

View License

The function is based on the paper by Held and Karp from 1962. The DP is guaranteed to provide the accurate (optimal) result to the TSP, but the time complexity of this algorithm is O(2^n n^2), which limits the use of this algorithm to 15 cities or less.

NOTE: For reasonable runtime, please do not try to calculate a tour of more than 13 cities. DP is not for large sets of cities.

Cite As

Elad Kivelevitch (2024). Dynamic Programming solution to the TSP (https://www.mathworks.com/matlabcentral/fileexchange/31454-dynamic-programming-solution-to-the-tsp), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0