-
Notifications
You must be signed in to change notification settings - Fork 31
Adding discrete seeds to TSP solvers #50
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
base: master
Are you sure you want to change the base?
Conversation
|
I will add the docs part when I get a chance and then ready this for review other than that any thoughts on this implementation |
|
Ok, this is ready for review now, I have added the docs. |
|
@fillipe-gsm Ready for review whenever you get a chance |
fillipe-gsm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @supersimple33 , thanks for the initiative with this PR
Sorry for the late review, I was on vacation and away from my computer.
So, I see this pull request is doing two things: adding a random generator object and a max_iterations arguments.
I personally don't plan on supporting the latter as stopping criterion at all. In my opinion, they are not as intuitive as maximum time, as the user would need to know the internals of the code to understand what an iteration is. Also, this adds more code, so more complexity that needs to be maintained, so I am reluctant on adding more stuff unless absolutely necessary.
So, if you plan on proceeding with the welcoming suggestion of adding a random number generator as argument, I would like you to do the following:
- address the issues that
mypyraised. You should see them in the "Checks" panel - there are no tests in this PR, so can you add some? Here are some ideas for them:
- pass the same
rngto each solver twice and ensure they return the same results - mock
rngand ensure it got called
- pass the same
Feel free to ask for help if you'd like. And thanks again for your time.
|
Regarding |
|
@fillipe-gsm Ok I have added tests to the pr following what you have specified. I have also fixed all the mypy warnings it was mostly just missing a few type unions. |
I understand your answer, but here are three more reasons why I prefer you to drop the
Thus, for the other methods apart from the |
|
@fillipe-gsm Ok got it. I have removed the |
I have made it so that the local_search and simulated annealing will take in a python
random.Randompre seeded RNG which can create the needed numbers for making perturbations or for other use cases in each solver.Addresses #41 and #47