Repository navigation
Improve numerical stability and robustness of enumpoly - #1057
Merged
Merged
Conversation
The branch-and-bound subdivision in `enumpoly` is bounded by a minimum rectangle size. However, given that the number of rectangles that can be searched goes up exponentially as the size is refined, this is not a very good bound on the total amount of work allowed - and means pathological cases can run more or less forever. This introduces a `max_rectangles` parameter, which limits the total amount of searching on a given support. It's set provisionally to 20000 as a first guess at a reasonable value. If this budget is exhausted, a new event type (different from "singular" supports) is generated; this is emitted in the command-line tool if the `-V` switch is specified.
This adds an LU factorisation class internally to the branch-and-bound equation solver internal to `enumpoly_solve`. The revised approach has much better numerical stability on less-well-conditioned systems. This addresses the root cause of very long (and ultimately futile) searches on some supports, where equations would not solve due to numerical inaccuracy. Closes #1055.
rahulsavani
approved these changes
Aug 20, 2026
rahulsavani
left a comment
Member
There was a problem hiding this comment.
Very happy with this.
I added the tests I had in mind for enumpoly. It runs too slow under behavior strategies to do too many equilibria, so only 2 there, and 10 for the original strategic form version.
One thing I recalled by accidentally setting stop_after to 0 is that it is equivalent to stop_after being None. I think that None corresponding to "all" equilibria is natural, but for 0 much less so, so I wonder if that should be mentioned in the docs for any methods that have stop_after as a param? If you agree I can create a separate issue and do that shortly.
Member
Author
|
stop_after = 0 working is accidental leakage from the convention in the C++ code. Please make an issue and we can discuss fixing it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes two improvements:
max_rectanglesargument to the branch-and-bound equation solver, to prevent it from futilely subdividing down to rectangles of size 1e-8 everywhere;Closes #1055.