Using gamultiobj

Problem Formulation

The gamultiobj solver attempts to create a set of Pareto optima for a multiobjective minimization. You may optionally set bounds and linear constraints on variables. gamultiobj uses the genetic algorithm for finding local Pareto optima. As in the ga function, you may specify an initial population, or have the solver generate one automatically.

The fitness function for use in gamultiobj should return a vector of type double. The population may be of type double, a bit string vector, or can be a custom-typed vector. As in ga, if you use a custom population type, you must write your own creation, mutation, and crossover functions that accept inputs of that population type, and specify these functions in the following fields, respectively:

You can set the initial population in a variety of ways. Suppose that you choose a population of size m. (The default population size is 15 times the number of variables n.) You can set the population:

Using gamultiobj with Optimization Tool

You can access gamultiobj from the Optimization Tool GUI. Enter

optimtool('gamultiobj')

at the command line, or enter optimtool and then choose gamultiobj from the Solver menu. You can also launch the tool from the MATLAB® Start menu as pictured:

If the Quick Reference help pane is closed, you can open it by clicking the ">>" button on the upper right of the GUI: . All the options available are explained briefly in the help pane.

You can create an options structure in the Optimization Tool, export it to the MATLAB workspace, and use the structure at the command line. For details, see Importing and Exporting Your Work in the Optimization Toolbox™ documentation.

Example — Multiobjective Optimization

This example has a two-objective fitness function f(x), where x is also two-dimensional:

function f = mymulti1(x)

f(1) = x(1)^4 - 10*x(1)^2+x(1)*x(2) + x(2)^4 - (x(1)^2)*(x(2)^2);
f(2) = x(2)^4 - (x(1)^2)*(x(2)^2) + x(1)^4 + x(1)*x(2);

Create an M-file for this function before proceeding.

Performing the Optimization with Optimization Tool

  1. To define the optimization problem, launch the Optimization Tool, and set it as pictured.

  2. Set the options for the problem as pictured.

  3. Run the optimization by clicking Start under Run solver and view results.

A plot appears in a figure window.

This plot shows the tradeoff between the two components of f. It is plotted in objective function space; see the figure Set of Noninferior Solutions.

The results of the optimization appear in the following table containing both objective function values and the value of the variables.

You can sort the table by clicking a heading. Click the heading again to sort it in the reverse order. The following figures show the result of clicking the heading f1.

Performing the Optimization at the Command Line

To perform the same optimization at the command line:

  1. Set the options:

    options = gaoptimset('PopulationSize',60,...
              'ParetoFraction',0.7,'PlotFcn',@gaplotpareto);
  2. Run the optimization using the options:

    [x fval flag output population] = gamultiobj(@mymulti1,2,...
                              [],[],[],[],[-5,-5],[5,5],options);

Alternate Views

There are other ways of regarding the problem. The following figure contains a plot of the level curves of the two objective functions, the Pareto frontier calculated by gamultiobj (boxes), and the x-values of the true Pareto frontier (diamonds connected by a nearly-straight line). The true Pareto frontier points are where the level curves of the objective functions are parallel. They were calculated by finding where the gradients of the objective functions are parallel. The figure is plotted in parameter space; see the figure Mapping from Parameter Space into Objective Function Space.

Contours of objective functions, and Pareto frontier

gamultiobj found the ends of the line segment, meaning it found the full extent of the Pareto frontier.

 Code for creating the figure

Options and Syntax: Differences With ga

The syntax and options for gamultiobj are similar to those for ga, with the following differences:

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS