jvkersch / pyconcorde

Python wrapper around the Concorde TSP solver
BSD 3-Clause "New" or "Revised" License
347 stars 95 forks source link

Output tour isn't a tour? #9

Closed Carpetfizz closed 3 years ago

Carpetfizz commented 6 years ago

I'm having trouble understanding the output of this solver, from the example input in the README.md.

array([ 0, 48, 31, 44, 18, 40,  7,  8,  9, 42, 32, 50, 10, 51, 13, 12, 46,
       25, 26, 27, 11, 24,  3,  5, 14,  4, 23, 47, 37, 36, 39, 38, 35, 34,
       33, 43, 45, 15, 28, 49, 19, 22, 29,  1,  6, 41, 20, 16,  2, 17, 30,
       21], dtype=int32)

How is this a tour if it doesn't start and end on the same vertex/index?

Carpetfizz commented 6 years ago

I'm guessing the last node is omitted on purpose since it's assumed to be 0, but I just wanted to check.

jvkersch commented 6 years ago

@Carpetfizz That is correct, the last node (equal to the starting node) is omitted.