pymoo icon indicating copy to clipboard operation
pymoo copied to clipboard

SBX crossover

Open KCrux opened this issue 2 years ago • 2 comments

Hello,

if I compare your CBX algorithm with the one given in [1] (equation (5), (6) and (7) and the following paragraph), and if I didn't make some mistakes in matching the variables, ~~I think that in line 55 and 59 of [2] you should write:~~

~~beta = 2.0 + ... instead of~~ ~~beta = 1.0 + ...~~

~~Otherwise at least line 47 differs from equation (5) with u <= 0.5/(1-gamma) in [1].~~

See my comment below.

[1] https://ieeexplore.ieee.org/document/8477746 [2] https://github.com/anyoptimization/pymoo/blob/main/pymoo/operators/crossover/sbx.py

KCrux avatar Aug 14 '22 07:08 KCrux

~~I think i did some mistakes here, sorry...~~

See my comment below.

KCrux avatar Aug 14 '22 08:08 KCrux

Sorry for confusing everyone here, even myself. Well, the main statement remains the same: I think some values are twisted up, at least to paper [1].

I think the '2.0' in line 55:

beta = 1.0 + (2.0 * (y1 - _xl) / delta)

should not be there and instead should be in alpha in line 42:

alpha = 2.0 - 2.0 * np.power(beta, -(eta + 1.0))


You can see this by comparing the condition rand <= (1.0 / alpha) in line 44 and the condition u <= 1/(2*(1-gamma)) in [1] equation (5). I run through this in the following steps (first bullet is your code, second bullet is according to the paper).

Lets start with:

  • 1 / alpha
  • 1 / (2 * (1 - gamma))

Then:

  • 1 / (2 - np.power(beta, -(eta+1)))
  • 1 / (2 - 2 * gamma)

Then:

  • 1 / (2 - np.power(1 + 2 * (y1 - xl) / (y2 - y1), -(eta+1)))
  • 1 / (2 - 2 * np.power(alpha, -(eta+1)))

Then:

  • 1 / (2 - np.power(1 + 2 * (y1 - xl) / (y2 - y1), -(eta+1))) [nothing changed to the previous step]
  • 1 / (2 - 2 * np.power(1 + (y1 - xl) / (y2 - y1), -(eta+1))))

(see the bold 2 in both equations)

KCrux avatar Aug 14 '22 08:08 KCrux

Sorry for the late reply. Thanks for figuring it out! (only through such deep dives we fully understand such operators :) )

blankjul avatar Dec 12 '22 05:12 blankjul