fix: invert the probability of acceptance in fading tabu#2358
Open
triceo wants to merge 4 commits into
Open
Conversation
Collaborator
Author
|
No need for Fred to review; Chris knows what this is about. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent deterministic fading-tabu accept/reject decisions from unnecessarily consuming RNG state during local search tabu acceptance.
Changes:
- Introduce a helper method that only calls
nextDouble()when0.0 < acceptChance < 1.0. - Refactor fading-tabu acceptance logic to delegate RNG usage to the helper.
Collaborator
Author
|
The logic is wrong, taking it back to draft. |
Christopher-Chianelli
approved these changes
Jun 11, 2026
…d else-if Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment on lines
+187
to
+191
| private FadingTabuDecision decideFadingTabuAcceptance(LocalSearchMoveScope<Solution_> moveScope, int fadingTabuStepCount) { | ||
| // Invert the chance; the longer the element is in the tabu list, the higher the chance should be. | ||
| var numerator = workingFadingTabuSize - fadingTabuStepCount; | ||
| if (numerator <= 0) { // The inverted chance would be >= 1. | ||
| return FadingTabuDecision.CERTAIN; |
|
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 closer the item is to becoming non-tabu, the higher should its acceptance probability be. (This has been a long-standing bug which went unnoticed.)
Also made sure that, when the chance is 0 or 1, that the RNG is not called. RNG is expensive, and it affects randomness in other places of the solver that use the same RNG.