-
Notifications
You must be signed in to change notification settings - Fork 42
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
StableRoommates returning None for simple problems #124
Comments
Hi @MartinMohlenkamp, thanks for bringing this up but this behaviour is expected currently. The
I hope that clears things up. I appreciate that this appears rather unsatisfying, but I would prefer not to muck about with the algorithm implementation for the sake of a trivial case. Having said that, I'd happily accept a small catch in the Let me know your thoughts |
@daffidwilde, the problem is not specific to two players. These also fail:
Based on your description, in any case when the second phase does not trigger, the code will fail. What if |
Yes, you are absolutely right. That is quite the oversight by me. Your solution sounds good, and I've run it through some other examples as well without issue. So, yeah, I'm happy for the unmatching to happen in the second phase 😄 |
* Move unmatching inside `second_phase` This was causing simple examples to fail because the second phase of the algorithm never kicked in. By moving the unmatching, this is avoided, and is fine because of the corollaries in Irving's paper. * Add example tests from #124 * Checkout CI file from dev.
* Fix ipython version to avoid warnings. (#126) * Fix ipython version to avoid warnings. There were some weird warnings coming from an internal `ipython`/`ipykernel` API, causing `pytest-nbval` to fail its tests. So, downgrading `ipython` to 7.10 until that is fixed. Details are available under [this issue](ipython/ipykernel#540). * Fix ipython version in workflow file. * Move unmatching inside `second_phase` of SR (#125) * Move unmatching inside `second_phase` This was causing simple examples to fail because the second phase of the algorithm never kicked in. By moving the unmatching, this is avoided, and is fine because of the corollaries in Irving's paper. * Add example tests from #124 * Checkout CI file from dev.
Hi @MartinMohlenkamp, I've implemented the changes you've suggested here and released a new version on PyPI I'll close the issue now, but if anything else comes up then please let me know! Thanks again |
This simple example:
returns
{A: None, B: None}
I think the problem is in stable_roommates.py within forget_successors. Line 113
player.unmatch()
erases the correct matching, which is then never recovered.I have version '1.3.2'.
The text was updated successfully, but these errors were encountered: