perf: bound symmetry work, incremental affine, and cap unproductive affine fill-in#954
Merged
Conversation
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.
Follow-up to #950 for #937's presolve outliers (part of #951).
What changed (4 commits)
assignColoursre-grouping), not just arc count. On a sparse model the arc-only charge under-counted enormously, letting colour refinement run thousands of unbounded rounds.passInputview across passes that change nothing, so a round-to-fixpoint sweep no longer rebuilds the live-factor list + domain snapshot for every pass that fires an empty delta.(degree-1)·|termVars|exceeds 64 is deferred (the variable stays, solved directly). Such models fold their many equality-defined variables into a few constraints, inflating them without simplifying — dense, unproductive fill-in. The ratio is taken once from the original problem (PresolveContext.affineUnderdetermined) so it stays stable as later rounds shrink the factor set.Why
Testing
dry-run-presolve): commits 2 and 3 are byte-identical. Commits 1 and 4 change presolve output on a small, bench-parity-validated set: symmetry on cargo/challenge01, carpet-cutting/mzn_rnd_test.01, latin-squares/03; the affine cap on bus_scheduling only (165→164, i.e. affine deferred).-t,-s): identical status/optimum/no regression. bus_scheduling is UNKNOWN with solutions=0 both with and without the cap (the deferred affine was dead weight — it added 99 constraints). The three symmetry instances solve identically (breaking fewer symmetries only removes symmetric duplicates)../gradlew check lintDocs: BUILD SUCCESSFUL.Notes
removeValuescans can exceed the whole-list rebuild they replace (2.4s→3.1s); still >0.5s either way. gardner_dinner is the clear win.