Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong optimal solution in Travelling Salesman example #151

Open
iPapatsoris opened this issue Jun 13, 2022 · 1 comment
Open

Wrong optimal solution in Travelling Salesman example #151

iPapatsoris opened this issue Jun 13, 2022 · 1 comment

Comments

@iPapatsoris
Copy link

Describe the bug

Running tsp.cpp in the examples directory, the third hardcoded problem instance (br17 from TSPLIB) returns a solution of supposed optimal cost of 87, while the optimal solution reported by TSPLIB is 39. By copy and pasting the hardcoded input into a custom model that uses the cost-less version of the circuit constraint, I was able to get the 39, suggesting that it isn't a typo between the hardcoded data inside tsp.cpp and the one posted by TSPLIB.

To Reproduce

Compile /examples/tsp.cpp and run with argument 2.

Gecode and Platform Configuration

Gecode version commit bbefcea214fec798a0f5acc442581984555acd21
Ubuntu 18.04.1 LTS
g++ 7.5.0

@zayenz
Copy link
Member

zayenz commented Jun 13, 2022

Looking closer, this seems to be beacuse the TSP example is written with the assumption that 0 represents an invalid part, while br17 has 0-cost segments that are valid. This should be fixed, but requires checking all the examples to make sure that they are all as they should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants