Repository navigation
Fix #1252: symmetric split point in dichotomic ObjectiveStrategy - #1253
Merged
Merged
Conversation
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
ArthurGodet
requested changes
Oct 12, 2026
ArthurGodet
approved these changes
Oct 13, 2026
The dichotomic target was rounded down whatever the resolution policy, so minimizing f and maximizing -f did not try mirrored cuts, and a two-value interval gave a no-op decision when maximizing. The target is now rounded towards the bound to improve (down when minimizing, up when maximizing). A new parameter, largerHalfFirst, selects the opposite rounding, which tries the larger half first. A decision that would not reduce the domain is no longer returned. ObjectiveStrategy now has a single constructor, ObjectiveStrategy(objective, policy, fraction, largerHalfFirst). The int[] coefs parameter is replaced by a double fraction in [0, 1]: [a, b] becomes b / (a + b).
cprudhom
force-pushed
the
fix/1252-objective-strategy-split
branch
from
October 13, 2026 16:16
4c66547 to
ba34204
Compare
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.
Fixes #1252.
Problem
In
ObjectiveStrategy.getDecision(), theDICHOTOMICtarget was rounded down whatever the resolution policy. Rounding down is right forMINIMIZE(obj <= target), but it is not the mirror image forMAXIMIZE(obj >= target):[a, a+1], the decisionobj >= adid not reduce the domain at all.As a result, minimizing
fand maximizing-fdid not explore the same tree.Changes
largerHalfFirstparameter: selects the opposite rounding (up when minimizing, down when maximizing), which tries the larger half of the domain first: a more cautious cut with a stronger refutation. This is option B from the issue discussion. Also available throughSearch.objectiveStrategy(objective, largerHalfFirst).getDecision()returnsnull).ObjectiveStrategy(objective, policy, fraction, largerHalfFirst).fractionreplacesint[] coefs: withDICHOTOMIC, the split point isLB + fraction * (UB - LB), withfractionin[0, 1]. It is ignored forBOTTOM_UPandTOP_DOWN.Behaviour and API changes
Search.objectiveStrategy(obj, DICHOTOMIC)tries a different cut when maximizing (rounded up instead of down). Minimization is unchanged by default.ObjectiveStrategyare removed. Former coefficients[a, b]becomefraction = b / (a + b), e.g.[1, 1]→0.5,[1, 2]→2. / 3.fractionthrowsIllegalArgumentException.Notes
Math.ceilDiv, suggested in the issue, is only available from Java 18; the rounding is done withMath.floor/Math.ceilon thedoublesplit point.0.1,1. / 3), a split point that is theoretically an integer may be shifted by one.0.5is exact over the wholeintrange. This only affects which cut is tried, not the correctness of the search.largerHalfFirst = false) is the option proposed in the issue. On the instance reported there, the other option explored fewer nodes; which default is best deserves a wider benchmark.Tests
ObjectiveTest#testDichotomicIsSymmetric: minimizingf, maximizing35 - fand maximizing-ftry mirrored cuts, for both values oflargerHalfFirstand with negative bounds.ObjectiveTest#testDichotomicFraction: mirrored cuts with fractions0.75/0.25, and rejection of an out-of-range fraction.DCMSTnow builds the strategy throughSearch.objectiveStrategy.ObjectiveTestandDCMSTpass (21 tests), as doesmvn checkstyle:checkon thesolvermodule. The full test suite was not run locally.