File Exchange

image thumbnail

TSPSEARCH

version 1.0.0 (19.2 KB) by Jonas Lundgren
Heuristic method for Traveling Salesman Problem (TSP).

8 Downloads

Updated 16 Apr 2019

View License

% [P,L] = TSPSEARCH(X,M) gives a tour P of length L. X is either a
% coordinate matrix of size Nx2 or Nx3 or a symmetric distance matrix.
% Euclidian distances are used in the coordinate case. M is an integer
% in the range 1 to N. Default is M = 1.
%
% METHOD
% M nearest neighbour tours are generated from randomly selected starting
% points. Each tour is improved by 2-opt heuristics (pairwise exchange of
% edges) and the best result is selected.
%
% EXAMPLES
%
% X = rand(100,2);
% [p,L] = tspsearch(X,100);
% tspplot(p,X)
%
% % Optimal tour length 1620
% X = load('hex162.dat');
% [p,L] = tspsearch(X,10);
% tspplot(p,X)

Cite As

Jonas Lundgren (2021). TSPSEARCH (https://www.mathworks.com/matlabcentral/fileexchange/71226-tspsearch), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Cemil Berin EROL

Cemil Berin EROL

Dear Jonas,

How can I use these functions if there are many rectangular forbidden areas?

MATLAB Release Compatibility
Created with R2017b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!