-
Notifications
You must be signed in to change notification settings - Fork 29
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
Can you ignore node-0 in brute force attempts? #32
Comments
Output:
Expected output:
|
Hi, @thatcode , sorry for the late answer You bring a very valid point and a nice example. But there may be some caveats with letting the algorithm choosing the initial node freely:
With all that said, I think the best approach is to implement a What do you think? |
Thanks for your reply :) Since posting this I had also realised that, in the actual travelling salesman problem the 1st city is their home, so can't change. And you do implement this faithfully! Given this, I think a minimal fix would be to update your README.md (the "Open TSP problem" section) to make it clearer that node 0 is fixed! I just followed (literally copy/pasted...) the Beyond that, making it programmable gives users the option to work around this. To avoid back-compatibility you might want to default to 0 rather than None until your next breaking change, but I'm fine with either. (Also, as a support engineer, +1 for fixing two issues with one change :p) |
The comment on https://github.com/fillipe-gsm/python-tsp/blob/master/python_tsp/exact/brute_force.py#L32 says:
However, we can fix node 0 and permutate only the remaining
.This is true for closed loops - once you've found the best you can rotate the loop until any node you want is node 0.
Is it really true for open loops? I haven't worked out a counter example yet, but I'm sure one can exist with not much effort!
The text was updated successfully, but these errors were encountered: