hy2850 / tsp_solver

Meta-heuristics for solving TSP problem
0 stars 0 forks source link

Optimize current 2-Opt loop #2

Open hy2850 opened 3 years ago

hy2850 commented 3 years ago

Current 2-Opt loop chooses first city randomly, and searches for next target city to execute 2-Opt operator. After NN init, this seems to be causing many 'misses' where fitness after 2-Opt is worse than before.

Gen 1 : 432544438 3694 - 3695 worse 3694 - 3696 worse 3694 - 3697 worse 3694 - 3698 worse 3694 - 3699 worse 3694 - 3700 worse 3694 - 3701 worse ... 3694 - 11848 worse 3694 - 11849 worse

This isn't leading us to better path. How can we improve this?

hy2850 commented 3 years ago

Possible solutions) Sol1) Abandon randomness. Start first city A from 1 to 11849 (last city). Find second city B from A+1 to 11849. Continue current generation until better path is found.

Sol2) Try 3-opt - much slower but more optimized