Repository navigation
Conversation
The cut obj < best - step was posted as obj <= best - step plus a disequality that only fails once the objective is assigned. The incumbent value therefore stayed inside the objective bounds, and proving optimality could require splitting the other float variables down to single ulps. The model in MiniZinc/MiniZincIDE#220 found its optimum at once and then did not finish proving it. Post obj <= pred(lo(best - step)) when minimizing and obj >= succ(hi(best + step)) when maximizing instead. On assigned objectives this admits exactly the solutions the old cut admitted, so step 0 stays exact, but the incumbent value is pruned immediately. The issue model now proves optimality in 358 nodes instead of running indefinitely. Also initialize the step in the default constructor and read it before the Gist branch, which previously used it uninitialized.
FloatMinimizeSpace and FloatMaximizeSpace posted cost < best - step as cost <= best - step plus a disequality that fails only once the cost is assigned, so the incumbent cost stayed inside the cost bounds until then, as in the FlatZinc cut fixed by the previous commit. Post cost <= pred(lo(best - step)) when minimizing and cost >= succ(hi(best + step)) when maximizing, computing the difference with outward rounding. With step 0 this accepts exactly the assigned costs the old cut accepted; with a positive step it no longer admits an improvement smaller than the step through rounding. The float spiral and folium examples find the same solutions in 3 to 4 percent fewer nodes.
This branch has not been deployed
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.
The float model in MiniZinc/MiniZincIDE#220 finds its optimum at once and then never proves it. This makes the float improvement cuts in FlatZinc and in MiniModel's
FloatMinimizeSpace/FloatMaximizeSpacestrict in the objective bound, so the incumbent value is pruned as soon as the cut is posted.Root cause
The cut
obj < best - stepwas posted asobj <= best - stepplus a disequality.NqFloatonly fails once the objective is assigned, so the incumbent value stayed inside the objective bounds. Proving optimality then had to split the other float variables down to single ulps before the objective became assigned.Change
FlatZincSpace::constrain): postobj <= pred(lo(best - step))when minimizing andobj >= succ(hi(best + step))when maximizing. If that bound is at or beyond the float limits, the space fails. On assigned objectives this admits exactly the solutions the old cut admitted, so step 0 stays exact. The step is also initialized in the default constructor and read before the Gist branch, which used it uninitialized.FloatMinimizeSpace::constrain,FloatMaximizeSpace::constrain): the same strict cut on the bound thatcompareranks. The difference with the step is now rounded outward, so a positive step no longer admits an improvement slightly smaller than the step. With step 0, assigned costs are accepted exactly as before.Testing
FlatZinc::Float::CutExcludesIncumbentandFloat::Basic::OptimizeCutconstrain by an incumbent with objective 0.5 in both directions and require the unassigned objective's bound to exclude 0.5. Each fails without its fix.checkpassed 536/536, all FlatZinc tests passed (149), and theFloat::RelandFloat::Basicselections passed, in a macOS Release build. The changelog tidy check passed.Not in this PR
Coarse-first float step schedules (optimize with a large relative step, then shrink it) are planned separately, together with portfolio search.