From 0b897ea78ad479c4389da5bc4bec1b7623d4e798 Mon Sep 17 00:00:00 2001 From: eiro800 Date: Sat, 11 Oct 2025 22:09:45 +0100 Subject: [PATCH] Fix strength calculation axis in SPEA2Survival._do to follow SPEA2 algorithm definition --- pymoo/algorithms/moo/spea2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymoo/algorithms/moo/spea2.py b/pymoo/algorithms/moo/spea2.py index 71c86436a..946adf827 100644 --- a/pymoo/algorithms/moo/spea2.py +++ b/pymoo/algorithms/moo/spea2.py @@ -39,7 +39,7 @@ def _do(self, problem, pop, *args, n_survive=None, **kwargs): M = Dominator().calc_domination_matrix(F) # the number of solutions each individual dominates - S = (M == 1).sum(axis=0) + S = (M == 1).sum(axis=1) # the raw fitness of each solution - strength of its dominators R = ((M == -1) * S).sum(axis=1)