/tsp-solver

Solving Travelling Salesman Problem using discrete Particle Swarm Optimization.

Primary LanguageMATLABMIT LicenseMIT

tsp-solver

MATLAB toolkit of the Travelling Salesman Problem (TSP).

Please note that this project is not done yet and the developer is now working on the code.

files

.
├── china32.tsp —— [the tsp file for examples]
├── readfile.m —— [read the file with name '*.tsp']
├── drawtour.m —— [draw the tour path using lines]
└── tourlength.m —— [calculate the given tour's length]

usage

[n, coordinate, distance] = readfile(filename)
drawtour(sequence, coordinate)

tour

length = tourlength(sequence, coordinate)