Multiobjective optimization algorithms
Source:R/optimization-solvers.R
multiobjective_algorithms.RdAlgorithms for an OptimizationProblem() built with multiobjective = TRUE (or from a MultiObjectiveOptimizationFunction()), whose objective
is the vector of the costs of the system. Both return an approximation of
the Pareto front: the solution's sol$u is the Pareto set, a matrix with
one row per point and one column per unknown, sol$objective the matrix
of the cost vectors at those points, and sol[x] the values of x along
the front.
Usage
NSGA2(
population = 100L,
generations = 200L,
crossover_rate = 0.9,
mutation_rate = NULL,
eta_c = 20,
eta_m = 20,
seed = NULL
)
WeightedSumScan(n = 21L, inner = NULL)Arguments
- population
Population size.
- generations
Number of generations.
- crossover_rate
Probability of crossover of a pair of parents.
- mutation_rate
Probability of mutating each unknown;
1 / nwhenNULL.- eta_c, eta_m
Distribution indices of the crossover and mutation.
- seed
Seed of the random numbers, or
NULLto use the current stream. With a seed the caller's random number state is restored.- n
Number of weights along each edge of the simplex.
- inner
The algorithm for each scalarized problem;
AugLag()with constraints andLBFGSB()otherwise whenNULL.
Details
NSGA2()is the elitist nondominated sorting genetic algorithm of Deb and coauthors, asEvolutionary.NSGA2andMetaheuristics.NSGA2used through Optimization.jl: simulated binary crossover, polynomial mutation, selection by nondomination rank and crowding distance, and constraints handled by Deb's feasibility rules. It needs finite bounds on every unknown and finds nonconvex fronts.WeightedSumScan()minimizessum(w * (f - ideal) / (nadir - ideal))for weightswon a regular grid of the simplex with a gradient based method, starting each solve from the previous point. The ideal and nadir points come from minimizing each cost alone. A weighted sum reaches only the convex parts of a front. It is the default.
Examples
x <- Variable("x", bounds = c(-1, 3))
sys <- complete(System(list(), costs = list(x^2, (x - 2)^2), name = "mo"))
prob <- OptimizationProblem(sys, list(x ~ 1), multiobjective = TRUE)
sol <- solve(prob, WeightedSumScan(n = 5))
sol$u
#> x
#> [1,] 0.0
#> [2,] 0.5
#> [3,] 1.0
#> [4,] 1.5
#> [5,] 2.0
sol$objective
#> cost1 cost2
#> [1,] 0.00 4.00
#> [2,] 0.25 2.25
#> [3,] 1.00 1.00
#> [4,] 2.25 0.25
#> [5,] 4.00 0.00