0

I need to solve a bunch of tsp with time windows, I'm working with python and using the LKH package (since it is the state of art solver next to concorde).

The goal of my work is to optimize a given route, so I would like to take the initial route as the seed of the solver, does anyone knows if that is possible within the LKH package?

For now, I have used the solver normally, like this:

`a=lkh.solve(lkh_path, problem, max_trials=10000, runs=10, MOVE_TYPE=5, tour_file='solution1.txt') `

But the fitness of the best solution is always worst than the fitness of my initial route.

UPDATE: On the LKH solver user guide, I found a possible way of doing this using the parameter initial_tour_file.

enter image description here

I tried it by adding it to the solver function, like this:

`a=lkh.solve(lkh_path, problem, max_trials=10000, runs=10, MOVE_TYPE=5, intial_tour_file='initial.txt', tour_file='solution1.txt') `

But I get an error saying:

*** Error ***
[initial_tour.txt] Unknown Keyword: 1

The initial tour file (initial.txt) is a txt file with the list of the nodes, like this:

1
2
3
4
5
6
7
8
9
10
-1
Beatriz Santos
  • 117
  • 3
  • 11

0 Answers0