Repository navigation
Align GrEA's grid ranking and selection with the reference - #43
Merged
Merged
Conversation
GrEA ranks the last front with grid ranking GR(x) = sum_k G_k(x), grid crowding distance and grid coordinate point distance, choosing solutions one by one and penalizing the GR of solutions in the same cell (+M+2), grid dominated by the chosen one (+M) or near it (distance-based PD). The implementation instead defined GR as the number of grid dominators plus neighbours and removed solutions one by one with different update rules. Port the last-front selection, the grid setting (lower bound and cell width padded by half a cell) and the mating selection (Pareto dominance, then grid dominance, then GCD) from the reference, and default div to the values recommended per number of objectives (45 for 2, 15 for 3, ...) instead of 10. The PD propagation is vectorized using the transitivity of grid dominance; a test checks it against a direct port of the sequential loop.
Zhenyu2Liang
approved these changes
Oct 26, 2026
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
GrEA's environmental selection does not implement GrEA's grid ranking. On ZDT1 it ends at IGD ≈ 0.036, against ≈ 0.005 for NSGA-II under the same budget.What GrEA does (Yang et al., 2013; PlatEMO's
GrEA/EnvironmentalSelection.m). The last front is filled one solution at a time. At each step it picks the best remaining solution by:GR(x) = Σ_k G_k(x), the sum of the grid coordinates;GCD, which accumulatesmax(M − GD, 0)over the solutions already chosen;GCPD.After each choice it adjusts GR to keep the chosen set spread out:
+(M+2)for solutions in the same cell;+Mfor solutions grid-dominated by the chosen one;PD = M − GDfor its other neighbours, propagated to the solutions those neighbours grid-dominate.What the implementation did.
GRwas defined as the number of grid dominators plus the number of neighbours, notΣ_k G_k.max(GR, GCD, GCPD), with different update rules and without the PD penalty.(f_max − f_min)/divinstead of(ub − lb)/divwith half-cell padding.divdefaulted to 10 for every number of objectives. GrEA's recommended settings are 45 for two objectives, 15 for three, and so on.This PR
divto the recommended value forn_objs(45, 15, 10, 9, 9, 8, 8, 10, 12 for 2–10 objectives, as in PlatEMO). An explicitdivstill overrides it.PD(r)is the largest direct penalty among the neighbours that grid-dominater. The selection is still a loop over the solutions to choose, like the previous peeling loop.Effect (IGD after 200 generations,
pop_size=100, seeds 0–2):Tests
test_grea_last_selection_matches_referencecompares_last_selectionwith a direct port of the sequential reference loop, including the order-dependent PD propagation. It covers 30 random cases, half of them with coarse values to create shared cells and ties. The same comparison over 300 random cases (2–4 objectives, up to 40 solutions) gave no mismatches.test_grea_default_divchecks the per-objective defaults.unit_test/algorithms/test_moea_generated.pypasses.Checklist
ruff.