Skip to content

Commit

Permalink
Make sure indexes provided in TSPLIB files are used in output.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Nov 22, 2015
1 parent 829682d commit f1b8edc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/loaders/tsplib_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ class tsplib_loader : public problem_io<distance_t>{

result += "\"tour\":[";
for(auto const& step: tour){
// Using rank rather than index to describe places.
result += std::to_string(step + 1) + ",";
// Using index provided in the file to describe places.
result += std::to_string(_nodes[step].index) + ",";
}
result.pop_back(); // Remove trailing comma.
result += "],";
Expand Down

0 comments on commit f1b8edc

Please sign in to comment.