jMetalPy icon indicating copy to clipboard operation
jMetalPy copied to clipboard

Are constraints strongly enforced?

Open OlegKarandin opened this issue 2 years ago • 1 comments

Hello, I tried to use jMetalPy for a simple problem with 1 objective and 1 constraint.

I've compared solutions by GeneticAlgorithm and SimulatedAnnealing. GeneticAlgorithm returns a solution that satisfies the constraint, while SimulatedAnnealing returns a solution with better objective, but negative value of result.constraints[0].

Does this mean that algorithm hasn't found a single feasible solution? Or it preferred lower objective, even though constraint is violated?

OlegKarandin avatar Apr 13 '22 10:04 OlegKarandin

Hi. The single objective algorithms in jMetalPy by default do not consider problems with constraints. A way to cope with this issue is to modify them by using the OverallConstraintViolationComparator class when comparing solutions.

ajnebro avatar Apr 18 '22 08:04 ajnebro