daffidwilde / matching

A package for solving matching games
https://daffidwilde.github.io/matching/
MIT License
149 stars 42 forks source link

Add `NoStableMatchingWarning` for SR #131

Closed daffidwilde closed 3 years ago

daffidwilde commented 3 years ago

Sometimes, instances of SR have no stable matching. This occurs when any player has their preference list emptied; by being rejected by everyone in the first phase, or by being paired up with all of their remaining preferences in all-or-nothing cycles during the second phase.

This warning matching.exceptions.NoStableMatchingWarning rings when either of these things happen, but does not stop the algorithm from continuing until its natural termination.