/aco-tsp

Solving TSP problem by Ant Colony Optimization.

Primary LanguageC++

Ant Colony Optimization

Traveling Salesman Problem

Usage

(Only tested under MacOS)
Open terminal

make
  1. Run directly in the terminal by typing the following:

     #./main [algo] [runs] [gen] [filename] [population] [alpha] [beta] [rho] [2opt]
     ./main ac 30 1250 "eil51.txt" 30 1 5 0.8 2
     ./main ac 30 1250 "eil101.txt" 30 1 5 0.8 2
    

PS [2opt] : e.g. 2 indicates implements 2opt for every 2 generations. 0 as default which doesn't implement 2opt.

  1. Or if you want to run multiple times, just by opening the "search.sh" and add whatever you want and run by typing

     ./search.sh
    

    in the terminal.

Results

The best results found for both eil51 and eil101 are placed in best_results folder.

eil51

best route: 430.396
This was found among 30 runs and the [2opt] was set to 2.
alt text

eil101

best route: 653.338
This was found among 30 runs and the [2opt] was set to 2.
alt text

PS There may be chances that you cannot get the same result due to randomness!