Python icon indicating copy to clipboard operation
Python copied to clipboard

tabu_search not working

Open hananaq opened this issue 5 years ago • 8 comments

hello, im trying to run you tabu_search.py code, but it's not working and keep giving my error

for k in dict_of_neighbours[visiting]: KeyError: ''

the error is not even written, so i couldn't debug it, i was wondering if you could help me out running it

hananaq avatar Dec 14 '20 06:12 hananaq

could you please send the full traceback here

ghost avatar Dec 14 '20 06:12 ghost

and please specify where in which directory can i find tabu_search.py

ghost avatar Dec 14 '20 06:12 ghost

Python/searches/tabu_search.py /

Traceback (most recent call last): File "tsp.py", line 280, in main(parser.parse_args()) File "tsp.py", line 245, in main args.File, dict_of_neighbours File "tsp.py", line 92, in generate_first_solution for k in dict_of_neighbours[visiting]: KeyError: ''

hananaq avatar Dec 14 '20 06:12 hananaq

what files did you use as input?

ghost avatar Dec 14 '20 06:12 ghost

i didnt notice there was an input file, i thought the second parameter is an output file, excuse me im new to Python

hananaq avatar Dec 14 '20 06:12 hananaq

There is no output file option and only input file option. try: python tabu_search.py --help if on windows else python3 tabu_search.py --help

ghost avatar Dec 14 '20 06:12 ghost

thanks alot, i found the input file in the repo, and the script is now running perfectly,

hananaq avatar Dec 14 '20 06:12 hananaq

your welcome, you can check the docstring in the code top to check how it works please close this issue for now. :smile:

ghost avatar Dec 14 '20 06:12 ghost