Skip to content

NSGA-III

For problems with three or more objectives. Reference points keep the front well spread.

NSGAIII

NSGAIII(*, divisions=None, pop_size=None, **kwargs)

Reference-point-based Non-dominated Sorting Genetic Algorithm III for many objectives.

NSGA-II with a different way to cut the last front and no tournament. Each iteration makes pop_size children from parents picked at random, crossed and mutated. Parents and children are merged and sorted into non-dominated fronts, and the best fronts fill S_t until it holds at least N solutions. When S_t has more, the members of S_t are normalized, each is associated with its nearest reference line, and the free places go one at a time to the least crowded reference points (niching).

Objectives are normalized as in Algorithm 2 of the paper, with the ideal and extreme points kept over the run (feasible solutions only, once one exists).

Parameters

  • divisions (int, pair of ints, or None): The number of divisions p of each objective for the reference points of Das and Dennis: comb(m + p - 1, p) points. A pair (p_boundary, p_inside) gives two layers, the inside one shrunk by half toward the center, as the paper does for many objectives. None (the default) picks them from the number of objectives, as the table below shows (Table I of the paper where it has a value).
  • pop_size: population size N. None (the default) gives the smallest multiple of 4 at least as large as the number of reference points, as in Table I of the paper.
  • crossover (ypea.operators.Crossover or None): None (the default) is SBX(eta=30, prob=1.0), the setting of Table II.
  • mutation (ypea.operators.Mutation or None): None (the default) is PolynomialMutation(eta=20) with probability 1/n.
  • space, operators: native operators, as in NSGAII
  • max_archive: as in NSGAII

Constraints use the problem's rule, constrained domination by default. This is not the constrained NSGA-III of part II of the paper.

Reference: K. Deb and H. Jain, "An evolutionary many-objective optimization algorithm using reference-point-based nondominated sorting approach, part I: solving problems with box constraints", IEEE Transactions on Evolutionary Computation 18(4), 577 to 601, 2014.

Reference points and population size

Objectives divisions Reference points Population Source
2 99 100 100 ypea
3 12 91 92 Table I of the paper
4 8 165 168 ypea
5 6 210 212 Table I
6, 7, 9 (3, 2) 77, 112, 210 80, 112, 212 ypea
8 (3, 2) 156 156 Table I
10 (3, 2) 275 276 Table I
15 (2, 1) 135 136 Table I
11 to 14, 16 or more (2, 1) 77 for 11 80 for 11 ypea

ypea.algorithms.nsga.reference_points(m, divisions) gives the points, and alg.ref_points holds those of the last run.

Example

Solve DTLZ2 with three objectives and measure the distance of the front to the true front:

import ypea
from ypea.benchmarks import dtlz2, pareto_front
from ypea.indicators import igd

problem = ypea.Problem(
    ypea.Real("x", shape=12),
    lambda sol: dtlz2(sol.x, m=3),
    n_obj=3,
    vectorized=True,
    name="dtlz2",
)

alg = ypea.NSGAIII(max_nfe=5_000)
result = alg.solve(problem, seed=1)

true_front = pareto_front("dtlz2", 1000, m=3)
score = igd(result.front.obj_values, true_front)
print(len(result.front), score)
865 0.03329507374582301

Differs from Python: MATLAB draws its own random numbers, so the front size and IGD differ from Python's.

problem = ypea.Problem( ...
    vars=ypea.Real("x", shape=12, lb=0, ub=1), ...
    objective=@(sol) ypea.benchmarks.dtlz2(sol.x, 3), ...
    vectorized=true, ...
    n_obj=3, ...
    name="dtlz2");

alg = ypea.NSGAIII(max_nfe=5000);
result = alg.solve(problem, seed=1);

true_front = ypea.benchmarks.pareto_front("dtlz2", 1000, 3);
score = ypea.indicators.igd(result.front.obj_values, true_front);
fprintf("%d %.17g\n", length(result.front), score)
824 0.034998037714132332

Front on ZDT1

Front found by NSGA-III on ZDT1
NSGA-III with default settings on ZDT1 with 10 variables, 10 000 evaluations (seed 1), a separate run from the example above. Each dot is one solution of result.front, and the dashed line is the true front.