Greedy algorithm to the multiple Traveling Salesman Problem
Run make all
- 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)
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
./tsp.out test_file/kroA100.tsp test_file/kroB100.tsp 200
gnuplot -e "plot 'sol_bi_objective.dat'" --persist
./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
First is the bi-objective, and the second, the tri-objective render: