Repository navigation
Fix SIBEA selection ignoring the first front - #41
Merged
Merged
Conversation
non_dominate_rank is zero-based, but SIBEA counted fronts from rank 1, so the first front was never counted toward the N survivors. Every rank-0 solution was always kept and num_needed could go negative, so the population grew from generation to generation (100 -> 343 after 30 generations on DTLZ2). Count fronts from rank 0.
Zhenyu2Liang
approved these changes
Oct 26, 2026
Collaborator
|
Thank you for fixing the bugs. |
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.
Description
SIBEA's environmental selection keeps more thanpop_sizesurvivors, so the population grows over the run:Per generation:
139, 100, 145, 159, 164, ..., 318, 334, 343. After 200 generations, the population holds 4385 solutions.Cause.
non_dominate_rankreturns zero-based ranks (seeAGENTS.md), but the front counting follows PlatEMO's one-basedFrontNo:So rank 0 is never counted, and the cumulative counts start at the second front. As a result:
max_f_nois at least 1, andmask_keep = front_no < max_f_noalways keeps the whole first front.num_needed = N - num_keptgoes negative once the first front is larger thanN, andsort_idx[:num_needed]then drops only the last few solutions of the next front instead of selecting nothing.Fix. Count fronts from rank 0. With that change,
num_kept < N <= num_kept + |last front|, and exactlyNsolutions survive.Testing.
test_sibea_keeps_population_sizeruns 10 generations and checks the population and fitness sizes. Before the fix it fails with38 != 20; with the fix it passes.unit_test/algorithms/test_moea_generated.pypasses.Checklist
ruff.