1

I have a questions on the MATLAB function gamultiobj function in obtaining Pareto front.

How to convert the minimization of multiple functions using genetic algorithm in a maxmization problem with linear constraints?

For example, instead of solving:

Min [2*x(1) - x(2) - exp(-x(1));
     x(1) + 2*x(2) - exp(-x(2))];

%with  Bounds
lb = [0;0];
ub = [1;1];

Find the following max:

Max [2*x(1) - x(2) - exp(-x(1));
            -x(1) + 2*x(2) - exp(-x(2))];

%with  Bounds
lb = [0;0];
ub = [1;1];

1 Answer 1

3

The solution for max(f(x)) is the same as -min(-f(x))

Maximize and minimize

Very simple, since gamultiobj only minimizes, you can make Matlab maximize your problem by changing the sign of every coefficient of your objective function like this:

f = -[2*x(1) - x(2) - exp(-x(1));
     x(1) + 2*x(2) - exp(-x(2))];

You don't need to change your lower and upper bounds.

Then, once you run the function and obtain the solutions, make sure to invert their sign too. This is essential, otherwise your solutions will be wrong.

This kind of behavior can also be found in the functions linprog and intlinprog which are used to solve linear programming problems.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for this usefull trick. Does this kind of behiavour also appears with the MATLAB function fminimax ?
That's correct. The fminimax also minimizes, so you need apply this same method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.