jMetalPy
jMetalPy copied to clipboard
Are constraints strongly enforced?
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?
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.