Steps for Problem-Based Multiobjective Optimization
This topic shows how to set up a multiobjective optimization in the problem-based approach, and details the format of results and initial points. For an example, see Pareto Front for Multiobjective Optimization, Problem-Based.
Specify Multiple Objective Functions
Specify multiple objective functions in one of two ways:
Optimization expression — Give an optimization expression that has vector or array values. For example, this objective function returns a vector of three values:
prob.Objective = [sin(x),cos(x),1 - x.^2];
Structure — Give a structure of optimization expressions, each of which evaluates to a scalar. For example, this objective function returns a structure with three objective components:
prob.Objective.sin = sin(x); prob.Objective.cos = cos(x); prob.Objective.quad = 1 - x^2;
Specify Multiple Objective Senses (Maximize or Minimize)
Specify an objective function sense, meaning maximize or minimize, depending on how you specify the objective function.
Objective is an optimization expression — All objectives in the problem have the same objective sense. For example,
prob.ObjectiveSense = "max";
Objective is a structure — Each objective function can have its own sense. The
prob.ObjectiveSensestructure has the same fields as the
prob.Objectivestructure. For example,
prob.ObjectiveSense.sin = "minimize"; prob.Objective.cos = "maximize"; prob.Objective.quad = "max";
The default sense is
Data Format of Multiobjective Solutions
sol output is a vector of
objects. Each object contains the values of the optimization variables and the objective
functions at one point on the Pareto front. If the problem has nonlinear constraints,
sol also contains the nonlinear constraint violations at each solution
fval output is a matrix where each row represents one
solution point and each column represents one objective function. The
fval output is numeric, unlike the
sol output. You
can obtain the objective function values from the
sol object. However,
you can find the values more easily in
You can plot the resulting Pareto front in two or three dimensions by calling
sol. For an example, see Pareto Front for Multiobjective Optimization, Problem-Based.
Supply Initial Points for Multiobjective Problem
Specifying initial points for multiobjective problems is optional. However, you can sometimes obtain better solutions by doing so. For an example showing the benefit, see Pareto Front for Multiobjective Optimization, Problem-Based.
To obtain more accurate solutions, the
gamultiobj solver can
fgoalattain. For an example, see Design Optimization of a Welded Beam. To use this hybrid function
in the problem-based workflow, set the
HybridFcn option to
options = optimoptions('gamultiobj',HybridFcn="fgoalattain");
Include the solver and options arguments in the
[sol,fval,exitflag,output] = solve(prob,... Solver="gamultiobj",... Options=options);
View Pareto Set
To view the Pareto set in two or three dimensions while the solver proceeds, set a plot option.
gamultiobjfunction, set the
options = optimoptions("gamultiobj",PlotFcn="gaplotpareto"); sol = solve(prob,Options=options)
paretosearchfunction, set the
To view the Pareto set after the solver finishes, call
on the solution.
sol = solve(prob); paretoplot(sol)
For an example, see Pareto Front for Multiobjective Optimization, Problem-Based.
If you have more than three objectives,
paretoplot allows you to
choose which objectives to plot. See the
reference page for details.