Download Traveling Salesman Problem

Traveling Salesman Problem

Traveling Salesman Problem

License :
Language :
Publisher :
Joseph Kirk
Updated :
July 6, 2010
OS Support :
Windows , Linux, Mac OS, BSD, Solaris

Traveling Salesman Problem Publisher's Description

Finds a near-optimal solution to a TSP using a GA

By Joseph Kirk about Traveling Salesman Problem

Editor: TSP_GA Traveling Salesman Problem (TSP) Genetic Algorithm (GA)
Finds a (near) optimal solution to the TSP by setting up a GA to search for the shortest route (least distance for the salesman to travel to each city exactly once and return to the starting city)

1. A single salesman travels to each of the cities and completes the route by returning to the city he started from
2. Each city is visited by the salesman exactly once

XY (float) is an Nx2 (or Nx3) Matrix of cities
DMAT (float) is an NxN matrix of point to point distances/costs
POP_SIZE (scalar integer) is the size of the population (should be divisible by 4)
NUM_ITER (scalar integer) is the number of desired iterations for the algorithm to run
SHOW_PROG (scalar logical) shows the GA progress if true
SHOW_RES (scalar logical) shows the GA results if true

OPT_RTE (integer array) is the best route found by the algorithm
MIN_DIST (scalar float) is the cost of the best route

n = 50;
xy = 10*rand(n,2);
a = meshgrid(1:n);
dmat = reshape(sqrt(sum((xy(a,:)-xy(a',:)).^2,2)),n,n);
pop_size = 60;
num_iter = 1e4;
show_prog = 1;
show_res = 1;
[opt_rte,min_dist] = tsp_ga(xy,dmat,pop_size,num_iter,show_prog,show_res);
System Requirements :
No special requirements
What's new in Traveling Salesman Problem :
No changelog

Traveling Salesman Problem Screenshots

Currently no screenshot.

Traveling Salesman Problem Alternatives

Rainflow Counting Algorithm
matlab to realize Rainflow Counting Algorithm...
Gaver-Stehfest algorithm for inverse Laplace transform
Gaver-Stehfest algorithm for inverse Laplace transform...
User Rating
Your Rating
Click the stars to rate
Add your review