Skip to content

ThiBsc/mTSP

Repository files navigation

mTSP

Build Status
Greedy algorithm to the multiple Traveling Salesman Problem

Compile

Run make all

Use

  • Mono: ./tsp.out <tsp_file> [UNDER_LIMIT], generate file sol_mono_objective.txt
  • Multi: ./tsp.out <tsp_file1> <tsp_file2> [<tsp_file3>] 100, where 100 is the number of wanted solutions. It's generate a sol_[bi/tri]_objective.dat (Higher is the number of wanted solutions, slower is the answer)

Result

Mono

sol_mono_objective.txt contain the solution cost returned by 2-opt and the path order.
If you specify the UNDER_LIMIT parameter, it will run until reach you limit cost.

./tsp.out test_file/onurjuzelle.txt 34000

Multi

bi-objective
./tsp.out test_file/kroA100.tsp test_file/kroB100.tsp 200
gnuplot -e "plot 'sol_bi_objective.dat'" --persist
tri-objective
./tsp.out test_file/kroA100.tsp test_file/kroB100.tsp test_file/kroC100.tsp 1000
gnuplot
splot 'sol_tri_objective.dat' w p lc palette z
plot render

First is the bi-objective, and the second, the tri-objective render:

About

Greedy algorithm to the multiple Traveling Salesman Problem

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published