Problems

Benchmark Test Problems for numerical optimization.

Metaheuristics.TestProblems.get_problemFunction
get_problem(problem)

Returns a 3-tuple with the objective function, the bounds and 100 Pareto solutions for multi-objective optimization problems or the optimal solutions for (box)constrained optimization problems.

Here, problem can be one of the following symbols:

Single-objective:

  • :sphere
  • :discus
  • :rastrigin

Multi-objective:

  • :ZDT1
  • :ZDT2
  • :ZDT3
  • :ZDT4
  • :ZDT6

Many-objective:

  • :DTLZ1
  • :DTLZ2
  • :DTLZ3
  • :DTLZ4
  • :DTLZ5
  • :DTLZ6

Example

julia> import Metaheuristics: TestProblems, optimize

julia> f, bounds, pareto_solutions = TestProblems.get_problem(:ZDT3);


julia> bounds
2×30 Array{Float64,2}:
 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  …  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0
 1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0     1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0  1.0

julia> pareto_solutions
                           F space
          ┌────────────────────────────────────────┐ 
        1 │⢅⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
          │⠈⢢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
          │⠀⠀⠙⠒⠀⠀⠀⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠘⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⠄⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
   f_2    │⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠬⡦⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠂⠀⠀⠀⠀⠀⠀⢢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢧⡀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠀│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀│ 
          │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠀⠀│ 
       -1 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
          └────────────────────────────────────────┘ 
          0                                      0.9
                             f_1
source

Box-constrained Optimization

Constrained Optimization

Constrained test problems used during alpha testing of the package. These are useful for testing constrained optimization algorithms.

Metaheuristics.TestProblems.constrained1Function
constrained1(D = 5)

Constrained test problem 1. This is a simple constrained test problem with two constraints defined as:

\[g_1(x) = (x_1 - x_2)^2 - 6 g_2(x) = x_1 + x_2 - 2\]

and the objective function is:

\[f(x) = (x_1 - 1)^2 + (x_2 - 1)^2\]

source
Metaheuristics.TestProblems.constrained2Function
constrained2(D = 5)

Constrained test problem 2. This is a simple constrained test problem with three constraints defined as:

\[g_1(x) = (x_1 - x_2)^2 - 6 g_2(x) = x_1 + x_2 - 2 g_3(x) = x_1 - x_2 - 2 \]

and the objective function is:

\[f(x) = (x_1 - 1)^2 + (x_2 - 1)^2\]

source
Metaheuristics.TestProblems.constrained3Function
constrained3()

Constrained test problem 3. This is a simple constrained test problem only with equality constraints h_i(x) = 0 defined as:

\[h_1(x) = - y_1 + y_2 + y_3 + y_4 - 1 h_2(x) = 2x_1 - y_1 + 2y_2 - 0.5y_3 + y_5 - 1 h_3(x) = 2x_2 + 2y_1 - y_2 - 0.5y_3 + y_6 - 1\]

and the objective function is:

\[f(x) = x_1 + 2x_2 + y_1 + y_2 + 2y_3\]

source

Multi-objective Optimization

Metaheuristics.TestProblems.ZDT1Function
ZDT1(D, n_solutions)

ZDT1 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • D number of variables (dimension)
  • n_solutions number of pareto solutions.

Main properties:

  • convex
source
Metaheuristics.TestProblems.ZDT2Function
ZDT2(D, n_solutions)

ZDT2 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • D number of variables (dimension)
  • n_solutions number of pareto solutions.

Main properties:

  • nonconvex
source
Metaheuristics.TestProblems.ZDT3Function
ZDT3(D, n_solutions)

ZDT3 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • D number of variables (dimension)
  • n_solutions number of pareto solutions.

Main properties:

  • convex disconected
source
Metaheuristics.TestProblems.ZDT4Function
ZDT4(D, n_solutions)

ZDT4 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • D number of variables (dimension)
  • n_solutions number of pareto solutions.

Main properties:

  • nonconvex
source
Metaheuristics.TestProblems.ZDT6Function
ZDT6(D, n_solutions)

ZDT6 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • D number of variables (dimension)
  • n_solutions number of Pareto solutions.

Main properties:

  • nonconvex
  • non-uniformly spaced
source
Metaheuristics.TestProblems.DTLZ1Function
DTLZ1(m = 3, ref_dirs = gen_ref_dirs(m, 12))

DTLZ1 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
  • ref_dirs number of Pareto solutions (default: Das and Dennis' method).

Main properties:

  • convex
  • multifrontal
source
Metaheuristics.TestProblems.DTLZ2Function
DTLZ2(m = 3, ref_dirs = gen_ref_dirs(m, 12))

DTLZ2 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
  • ref_dirs number of Pareto solutions (default: Das and Dennis' method).

Main properties:

  • nonconvex
  • unifrontal
source
Metaheuristics.TestProblems.DTLZ3Function
DTLZ3(m = 3, ref_dirs = gen_ref_dirs(m, 12))

DTLZ3 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
  • ref_dirs number of Pareto solutions (default: Das and Dennis' method).

Main properties:

  • nonconvex
  • multifrontal
source
Metaheuristics.TestProblems.DTLZ4Function
DTLZ4(m = 3, ref_dirs = gen_ref_dirs(m, 12))

DTLZ4 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
  • ref_dirs number of Pareto solutions (default: Das and Dennis' method).

Main properties:

  • nonconvex
  • unifrontal
source
Metaheuristics.TestProblems.DTLZ5Function
DTLZ5(m = 3)

DTLZ5 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
source
Metaheuristics.TestProblems.DTLZ6Function
DTLZ6(m = 3)

DTLZ6 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
source

Constrained Multi-objective Optimization

Metaheuristics.TestProblems.C1_DTLZ1Function
C1_DTLZ1(m = 3, ref_dirs = gen_ref_dirs(m, 12))

C1_DTLZ1 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
  • ref_dirs number of Pareto solutions (default: Das and Dennis' method).

Main properties:

  • convex
  • multifrontal
  • constraints type 1
source
Metaheuristics.TestProblems.C1_DTLZ3Function
C1_DTLZ3(m = 3, ref_dirs = gen_ref_dirs(m, 12))

DTLZ3 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
  • ref_dirs number of Pareto solutions (default: Das and Dennis' method).

Main properties:

  • nonconvex
  • multifrontal
  • constraints type 1
source
Metaheuristics.TestProblems.C2_DTLZ2Function
C2_DTLZ2(m = 3, ref_dirs = gen_ref_dirs(m, 12))

DTLZ2 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
  • ref_dirs number of Pareto solutions (default: Das and Dennis' method).

Main properties:

  • nonconvex
  • unifrontal
  • contraints type 2
source
Metaheuristics.TestProblems.C3_DTLZ4Function
C3_DTLZ4(m = 3, ref_dirs = gen_ref_dirs(m, 12))

C3_DTLZ4 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv}) where f is the objective function and pareto_set is an array with optimal Pareto solutions with n_solutions.

Parameters

  • m number of objective functions
  • ref_dirs number of Pareto solutions (default: Das and Dennis' method).

Main properties:

  • nonconvex
  • unifrontal
  • constraints type 3
source

Combinatorial Optimization