Skip to content

Problems

Multi-objective

zdt

ZDT1(number_of_variables=30)

Bases: FloatProblem

Problem ZDT1.

.. note:: Bi-objective unconstrained problem. The default number of variables is 30. .. note:: Continuous problem having a convex Pareto front

:param number_of_variables: Number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/zdt.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["x", "y"]

    self.lower_bound = number_of_variables * [0.0]
    self.upper_bound = number_of_variables * [1.0]

ZDT1Modified(number_of_variables=30)

Bases: ZDT1

Problem ZDT1Modified.

.. note:: Version including a loop for increasing the computing time of the evaluation functions.

Source code in src/jmetal/problem/multiobjective/zdt.py
def __init__(self, number_of_variables=30):
    super().__init__(number_of_variables)

ZDT2(number_of_variables=30)

Bases: ZDT1

Problem ZDT2.

.. note:: Bi-objective unconstrained problem. The default number of variables is 30. .. note:: Continuous problem having a non-convex Pareto front

Source code in src/jmetal/problem/multiobjective/zdt.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["x", "y"]

    self.lower_bound = number_of_variables * [0.0]
    self.upper_bound = number_of_variables * [1.0]

ZDT3(number_of_variables=30)

Bases: ZDT1

Problem ZDT3.

.. note:: Bi-objective unconstrained problem. The default number of variables is 30. .. note:: Continuous problem having a partitioned Pareto front

Source code in src/jmetal/problem/multiobjective/zdt.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["x", "y"]

    self.lower_bound = number_of_variables * [0.0]
    self.upper_bound = number_of_variables * [1.0]

ZDT4(number_of_variables=10)

Bases: ZDT1

Problem ZDT4.

.. note:: Bi-objective unconstrained problem. The default number of variables is 10. .. note:: Continuous multi-modal problem having a convex Pareto front

:param number_of_variables: Number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/zdt.py
def __init__(self, number_of_variables: int = 10):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__()
    self.lower_bound = number_of_variables * [-5.0]
    self.upper_bound = number_of_variables * [5.0]
    self.lower_bound[0] = 0.0
    self.upper_bound[0] = 1.0

ZDT5(number_of_variables=11)

Bases: BinaryProblem

Problem ZDT5.

.. note:: Bi-objective binary unconstrained problem. The default number of variables is 11.

In this implementation, each variable is represented by a single boolean value in the solution, and the number_of_bits_per_variable attribute is used to track how many bits each variable conceptually represents for evaluation purposes.

:param number_of_variables: Number of variables in the problem.

Source code in src/jmetal/problem/multiobjective/zdt.py
def __init__(self, number_of_variables: int = 11):
    """
    :param number_of_variables: Number of variables in the problem.
    """
    super().__init__()

    # Track how many bits each variable conceptually represents
    self.number_of_bits_per_variable = [5 for _ in range(number_of_variables)]
    self.number_of_bits_per_variable[0] = 30

    # Total number of bits is the sum of all bits per variable
    self.total_number_of_bits = sum(self.number_of_bits_per_variable)

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["x", "y"]

    # For compatibility with the original implementation
    self.number_of_bits = self.total_number_of_bits

evaluate(solution)

Evaluate the solution by counting the number of true bits in each variable's range.

Source code in src/jmetal/problem/multiobjective/zdt.py
def evaluate(self, solution: BinarySolution) -> BinarySolution:
    """
    Evaluate the solution by counting the number of true bits in each variable's range.
    """
    # Calculate first objective: 1 + number of true bits in first variable (30 bits)
    first_var_bits = solution.variables[:30]
    solution.objectives[0] = 1.0 + sum(first_var_bits)

    # Calculate g function for second objective
    g = self.eval_g(solution)
    h = 1.0 / solution.objectives[0]
    solution.objectives[1] = h * g

    return solution

eval_g(solution)

Calculate the g function for ZDT5.

Source code in src/jmetal/problem/multiobjective/zdt.py
def eval_g(self, solution: BinarySolution) -> float:
    """
    Calculate the g function for ZDT5.
    """
    result = 0.0
    bit_index = 30  # Start after the first variable (30 bits)

    # Process remaining variables (each 5 bits)
    for bits in self.number_of_bits_per_variable[1:]:
        # Count true bits in this variable's range
        var_bits = solution.variables[bit_index : bit_index + bits]
        ones_count = sum(var_bits)
        result += self.eval_v(ones_count)
        bit_index += bits

    return result

eval_v(value)

Helper function for ZDT5 evaluation.

Source code in src/jmetal/problem/multiobjective/zdt.py
def eval_v(self, value: int) -> float:
    """
    Helper function for ZDT5 evaluation.
    """
    if value < 5.0:
        return 2.0 + value
    return 1.0

create_solution(rng=None)

Create a new random solution.

Source code in src/jmetal/problem/multiobjective/zdt.py
def create_solution(self, rng: np.random.Generator | None = None) -> BinarySolution:
    """
    Create a new random solution.
    """
    solution = BinarySolution(
        number_of_variables=self.total_number_of_bits,
        number_of_objectives=self.number_of_objectives(),
        number_of_constraints=self.number_of_constraints(),
    )

    # Initialize with random bits
    if rng is not None:
        for i in range(self.total_number_of_bits):
            solution.variables[i] = rng.random() < 0.5
    else:
        for i in range(self.total_number_of_bits):
            solution.variables[i] = random.random() < 0.5

    return solution

ZDT6(number_of_variables=10)

Bases: ZDT1

Problem ZDT6.

.. note:: Bi-objective unconstrained problem. The default number of variables is 10. .. note:: Continuous problem having a non-convex Pareto front

:param number_of_variables: Number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/zdt.py
def __init__(self, number_of_variables: int = 10):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__(number_of_variables=number_of_variables)

dtlz

DTLZ1(number_of_variables=7, number_of_objectives=3)

Bases: FloatProblem

Problem DTLZ1. Continuous problem having a flat Pareto front

.. note:: Unconstrained problem. The default number of variables and objectives are, respectively, 7 and 3.

:param number_of_variables: number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/dtlz.py
def __init__(self, number_of_variables: int = 7, number_of_objectives=3):
    """:param number_of_variables: number of decision variables of the problem."""
    super().__init__()

    self.obj_directions = [self.MINIMIZE] * number_of_objectives
    self.obj_labels = [f"$ f_{i} $" for i in range(number_of_objectives)]

    self.lower_bound = number_of_variables * [0.0]
    self.upper_bound = number_of_variables * [1.0]

DTLZ2(number_of_variables=12, number_of_objectives=3)

Bases: DTLZ1

Problem DTLZ2. Continuous problem having a convex Pareto front

.. note:: Unconstrained problem. The default number of variables and objectives are, respectively, 12 and 3.

:param number_of_variables: number of decision variables of the problem

Source code in src/jmetal/problem/multiobjective/dtlz.py
def __init__(self, number_of_variables: int = 12, number_of_objectives=3):
    """:param number_of_variables: number of decision variables of the problem"""
    super().__init__(number_of_variables, number_of_objectives)

DTLZ3(number_of_variables=12, number_of_objectives=3)

Bases: DTLZ1

Problem DTLZ3. Continuous problem having a convex Pareto front

.. note:: Unconstrained problem. The default number of variables and objectives are, respectively, 12 and 3.

:param number_of_variables: number of decision variables of the problem

Source code in src/jmetal/problem/multiobjective/dtlz.py
def __init__(self, number_of_variables: int = 12, number_of_objectives=3):
    """:param number_of_variables: number of decision variables of the problem"""
    super().__init__(number_of_variables, number_of_objectives)

DTLZ4(number_of_variables=12, number_of_objectives=3)

Bases: DTLZ1

Problem DTLZ4. Continuous problem having a convex Pareto front

.. note:: Unconstrained problem. The default number of variables and objectives are, respectively, 12 and 3.

:param number_of_variables: number of decision variables of the problem

Source code in src/jmetal/problem/multiobjective/dtlz.py
def __init__(self, number_of_variables: int = 12, number_of_objectives=3):
    """:param number_of_variables: number of decision variables of the problem"""
    super().__init__(number_of_variables, number_of_objectives)

DTLZ5(number_of_variables=12, number_of_objectives=3)

Bases: DTLZ1

Problem DTLZ5. Continuous problem having a convex Pareto front

.. note:: Unconstrained problem. The default number of variables and objectives are, respectively, 12 and 3.

:param number_of_variables: number of decision variables of the problem

Source code in src/jmetal/problem/multiobjective/dtlz.py
def __init__(self, number_of_variables: int = 12, number_of_objectives=3):
    """:param number_of_variables: number of decision variables of the problem"""
    super().__init__(number_of_variables, number_of_objectives)

DTLZ6(number_of_variables=12, number_of_objectives=3)

Bases: DTLZ1

Problem DTLZ6. Continuous problem having a convex Pareto front

.. note:: Unconstrained problem. The default number of variables and objectives are, respectively, 12 and 3.

:param number_of_variables: number of decision variables of the problem

Source code in src/jmetal/problem/multiobjective/dtlz.py
def __init__(self, number_of_variables: int = 12, number_of_objectives=3):
    """:param number_of_variables: number of decision variables of the problem"""
    super().__init__(number_of_variables, number_of_objectives)

DTLZ7(number_of_variables=22, number_of_objectives=3)

Bases: DTLZ1

Problem DTLZ6. Continuous problem having a disconnected Pareto front

.. note:: Unconstrained problem. The default number of variables and objectives are, respectively, 22 and 3.

:param number_of_variables: number of decision variables of the problem

Source code in src/jmetal/problem/multiobjective/dtlz.py
def __init__(self, number_of_variables: int = 22, number_of_objectives=3):
    """:param number_of_variables: number of decision variables of the problem"""
    super().__init__(number_of_variables, number_of_objectives)

wfg

zcat

eqdtlz

constrained

Srinivas()

Bases: FloatProblem

Class representing problem Srinivas.

Source code in src/jmetal/problem/multiobjective/constrained.py
def __init__(self):
    super().__init__()
    number_of_variables = 2

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [-20.0 for _ in range(number_of_variables)]
    self.upper_bound = [20.0 for _ in range(number_of_variables)]

Tanaka()

Bases: FloatProblem

Class representing problem Tanaka.

Source code in src/jmetal/problem/multiobjective/constrained.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    number_of_variables = 2
    self.lower_bound = [10e-5 for _ in range(number_of_variables)]
    self.upper_bound = [pi for _ in range(number_of_variables)]

Osyczka2()

Bases: FloatProblem

Class representing problem Osyczka2.

Source code in src/jmetal/problem/multiobjective/constrained.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [0.0, 0.0, 1.0, 0.0, 1.0, 0.0]
    self.upper_bound = [10.0, 10.0, 5.0, 6.0, 5.0, 10.0]

Binh2()

Bases: FloatProblem

Class representing problem Binh2.

Source code in src/jmetal/problem/multiobjective/constrained.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [0.0, 0.0]
    self.upper_bound = [5.0, 3.0]

unconstrained

Kursawe(number_of_variables=3)

Bases: FloatProblem

Class representing problem Kursawe.

Source code in src/jmetal/problem/multiobjective/unconstrained.py
def __init__(self, number_of_variables: int = 3):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [-5.0 for _ in range(number_of_variables)]
    self.upper_bound = [5.0 for _ in range(number_of_variables)]

SubsetSum(C, W)

Bases: BinaryProblem

The goal is to find a subset S of W whose elements sum is closest to (without exceeding) C.

This is a bi-objective problem where we want to: 1. Maximize the sum of selected elements (without exceeding C) 2. Minimize the number of selected objects

Parameters:

Name Type Description Default
C int

The target sum (large integer)

required
W list

List of non-negative integers to select from

required
Source code in src/jmetal/problem/multiobjective/unconstrained.py
def __init__(self, C: int, W: list):
    """The goal is to find a subset S of W whose elements sum is closest to (without exceeding) C.

    This is a bi-objective problem where we want to:
    1. Maximize the sum of selected elements (without exceeding C)
    2. Minimize the number of selected objects

    Args:
        C: The target sum (large integer)
        W: List of non-negative integers to select from
    """
    super().__init__()
    self.C = C
    self.W = np.array(W, dtype=float)  # Convert to numpy array for vectorized operations

    self.number_of_bits = len(self.W)
    self._number_of_objectives = 2
    self._number_of_constraints = 0

    # Objective 1: Maximize sum (minimize negative sum)
    # Objective 2: Minimize number of selected objects
    self.obj_directions = [self.MAXIMIZE, self.MINIMIZE]
    self.obj_labels = ["Sum", "No. of Objects"]

OneZeroMax(number_of_bits=256)

Bases: BinaryProblem

The OneZeroMax problem is a multi-objective problem that counts the number of ones and zeros in a binary string.

The objectives are: 1. Maximize the number of ones (minimize negative count) 2. Maximize the number of zeros (minimize negative count)

Parameters:

Name Type Description Default
number_of_bits int

The length of the binary string (default: 256)

256
Source code in src/jmetal/problem/multiobjective/unconstrained.py
def __init__(self, number_of_bits: int = 256):
    super().__init__()
    self.number_of_bits = number_of_bits
    self.number_of_bits_per_variable = [number_of_bits]  # For backward compatibility

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["Ones", "Zeros"]

lircmop

LIRCMOP1(number_of_variables=30)

Bases: FloatProblem

Class representing problem LIR-CMOP1, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [0.0 for _ in range(number_of_variables)]
    self.upper_bound = [1.0 for _ in range(number_of_variables)]

LIRCMOP2(number_of_variables=30)

Bases: LIRCMOP1

Class representing problem LIR-CMOP1, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP3(number_of_variables=30)

Bases: LIRCMOP1

Class representing problem LIR-CMOP3, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP4(number_of_variables=30)

Bases: LIRCMOP2

Class representing problem LIR-CMOP4, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP5(number_of_variables=30)

Bases: FloatProblem

Class representing problem LIR-CMOP5, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [0.0 for _ in range(number_of_variables)]
    self.upper_bound = [1.0 for _ in range(number_of_variables)]

LIRCMOP6(number_of_variables=30)

Bases: LIRCMOP5

Class representing problem LIR-CMOP6, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP7(number_of_variables=30)

Bases: LIRCMOP5

Class representing problem LIR-CMOP7, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP8(number_of_variables=30)

Bases: LIRCMOP6

Class representing problem LIR-CMOP8, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP9(number_of_variables=30)

Bases: LIRCMOP8

Class representing problem LIR-CMOP9, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP10(number_of_variables=30)

Bases: LIRCMOP8

Class representing problem LIR-CMOP10, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP11(number_of_variables=30)

Bases: LIRCMOP10

Class representing problem LIR-CMOP11, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP12(number_of_variables=30)

Bases: LIRCMOP9

Class representing problem LIR-CMOP9, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

LIRCMOP13(number_of_variables=30)

Bases: FloatProblem

Class representing problem LIR-CMOP13, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [0.0 for _ in range(number_of_variables)]
    self.upper_bound = [1.0 for _ in range(number_of_variables)]

LIRCMOP14(number_of_variables=30)

Bases: LIRCMOP13

Class representing problem LIR-CMOP14, defined in:

  • An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
Source code in src/jmetal/problem/multiobjective/lircmop.py
def __init__(self, number_of_variables: int = 30):
    super().__init__(number_of_variables)

fda

FDA1(number_of_variables=100)

Bases: FDA

Problem FDA1.

.. note:: Bi-objective dynamic unconstrained problem. The default number of variables is 100.

:param number_of_variables: Number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/fda.py
def __init__(self, number_of_variables: int = 100):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__()
    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = number_of_variables * [-1.0]
    self.upper_bound = number_of_variables * [1.0]
    self.lower_bound[0] = 0.0
    self.upper_bound[0] = 1.0

FDA2(number_of_variables=31)

Bases: FDA

Problem FDA2

.. note:: Bi-objective dynamic unconstrained problem. The default number of variables is 31.

:param number_of_variables: Number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/fda.py
def __init__(self, number_of_variables: int = 31):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__()
    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = number_of_variables * [-1.0]
    self.upper_bound = number_of_variables * [1.0]
    self.lower_bound[0] = 0.0
    self.upper_bound[0] = 1.0

FDA3(number_of_variables=30)

Bases: FDA

Problem FDA3

.. note:: Bi-objective dynamic unconstrained problem. The default number of variables is 30.

:param number_of_variables: Number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/fda.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__()
    self.limitInfI = 0
    self.limitSupI = 1
    self.limitInfII = 1

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = number_of_variables * [-1.0]
    self.upper_bound = number_of_variables * [1.0]
    self.lower_bound[0] = 0.0
    self.upper_bound[0] = 1.0

FDA4(number_of_variables=12)

Bases: FDA

Problem FDA4

.. note:: Three-objective dynamic unconstrained problem. The default number of variables is 12.

:param number_of_variables: Number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/fda.py
def __init__(self, number_of_variables: int = 12):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__()
    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)", "f(z)"]

    self.lower_bound = number_of_variables * [0.0]
    self.upper_bound = number_of_variables * [1.0]

FDA5(number_of_variables=12)

Bases: FDA

Problem FDA5

.. note:: Three-objective dynamic unconstrained problem. The default number of variables is 12.

:param number_of_variables: Number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/fda.py
def __init__(self, number_of_variables: int = 12):
    """:param number_of_variables: Number of decision variables of the problem."""
    super().__init__()
    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)", "f(z)"]

    self.lower_bound = number_of_variables * [0.0]
    self.upper_bound = number_of_variables * [1.0]

lz09

LZ09(number_of_variables, ptype, dtype, ltype)

Bases: FloatProblem

LZ09 benchmark family as defined in:

  • H. Li and Q. Zhang. Multiobjective optimization problems with complicated pareto sets, MOEA/D and NSGA-II. IEEE Transactions on Evolutionary Computation, 12(2):284-302, April 2009.
Source code in src/jmetal/problem/multiobjective/lz09.py
def __init__(
    self,
    number_of_variables: int,
    ptype: int,
    dtype: int,
    ltype: int,
):
    """LZ09 benchmark family as defined in:

    * H. Li and Q. Zhang. Multiobjective optimization problems with complicated pareto sets, MOEA/D and NSGA-II.
    IEEE Transactions on Evolutionary Computation, 12(2):284-302, April 2009.
    """
    super().__init__()

    self.lower_bound = number_of_variables * [0.0]
    self.upper_bound = number_of_variables * [1.0]

    self.ptype = ptype
    self.dtype = dtype
    self.ltype = ltype

uf

UF1(number_of_variables=30)

Bases: FloatProblem

Problem UF1.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: number of decision variables of the problem."""
    super().__init__()
    self.lower_bound = number_of_variables * [-1.0]
    self.upper_bound = number_of_variables * [1.0]
    self.lower_bound[0] = 0.0
    self.upper_bound[0] = 1.0

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2"]

UF2(number_of_variables=30)

Bases: FloatProblem

Problem UF2.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: number of decision variables of the problem."""
    super().__init__()
    self.lower_bound = [0.0] + [-1.0] * (number_of_variables - 1)
    self.upper_bound = [1.0] * number_of_variables

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2"]

UF3(number_of_variables=30)

Bases: FloatProblem

Problem UF3.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: number of decision variables of the problem."""
    super().__init__()
    self.lower_bound = [0.0] + [-1.0] * (number_of_variables - 1)
    self.upper_bound = [1.0] * number_of_variables

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2"]

UF4(number_of_variables=30)

Bases: FloatProblem

Problem UF4.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: number of decision variables of the problem."""
    super().__init__()
    self.lower_bound = [0.0] + [-2.0] * (number_of_variables - 1)
    self.upper_bound = [1.0] + [2.0] * (number_of_variables - 1)

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2"]

UF5(number_of_variables=30, N=10, epsilon=0.1)

Bases: FloatProblem

Problem UF5.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem. :param N: controls the number of subcomponents in the problem :param epsilon: controls the amplitude of the sine function in the objective

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30, N: int = 10, epsilon: float = 0.1):
    """
    :param number_of_variables: number of decision variables of the problem.
    :param N: controls the number of subcomponents in the problem
    :param epsilon: controls the amplitude of the sine function in the objective
    """
    super().__init__()
    self.lower_bound = [0.0] + [-1.0] * (number_of_variables - 1)
    self.upper_bound = [1.0] * number_of_variables
    self.n = N
    self.epsilon = epsilon

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2"]

UF6(number_of_variables=30, N=2, epsilon=0.1)

Bases: FloatProblem

Problem UF6.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem. :param N: controls the number of subcomponents in the problem (default: 2) :param epsilon: controls the amplitude of the sine function in the objective (default: 0.1)

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30, N: int = 2, epsilon: float = 0.1):
    """
    :param number_of_variables: number of decision variables of the problem.
    :param N: controls the number of subcomponents in the problem (default: 2)
    :param epsilon: controls the amplitude of the sine function in the objective (default: 0.1)
    """
    super().__init__()
    self.lower_bound = [0.0] + [-1.0] * (number_of_variables - 1)
    self.upper_bound = [1.0] * number_of_variables
    self.n = N
    self.epsilon = epsilon

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2"]

UF7(number_of_variables=30)

Bases: FloatProblem

Problem UF7.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: number of decision variables of the problem."""
    super().__init__()
    self.lower_bound = [0.0] + [-1.0] * (number_of_variables - 1)
    self.upper_bound = [1.0] * number_of_variables

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2"]

UF8(number_of_variables=30)

Bases: FloatProblem

Problem UF8 - Three-objective problem.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: number of decision variables of the problem."""
    super().__init__()
    self.lower_bound = [0.0, 0.0] + [-2.0] * (number_of_variables - 2)
    self.upper_bound = [1.0, 1.0] + [2.0] * (number_of_variables - 2)

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2", "f3"]

UF9(number_of_variables=30, epsilon=0.1)

Bases: FloatProblem

Problem UF9 - Three-objective problem with variable bounds.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem. :param epsilon: controls the shape of the Pareto front (default: 0.1)

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30, epsilon: float = 0.1):
    """
    :param number_of_variables: number of decision variables of the problem.
    :param epsilon: controls the shape of the Pareto front (default: 0.1)
    """
    super().__init__()
    self.lower_bound = [0.0, 0.0] + [-2.0] * (number_of_variables - 2)
    self.upper_bound = [1.0, 1.0] + [2.0] * (number_of_variables - 2)
    self.epsilon = epsilon

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2", "f3"]

UF10(number_of_variables=30)

Bases: FloatProblem

Problem UF10 - Three-objective problem with complex interactions.

.. note:: Unconstrained problem. The default number of variables is 30.

:param number_of_variables: number of decision variables of the problem.

Source code in src/jmetal/problem/multiobjective/uf.py
def __init__(self, number_of_variables: int = 30):
    """:param number_of_variables: number of decision variables of the problem."""
    super().__init__()
    self.lower_bound = [0.0, 0.0] + [-2.0] * (number_of_variables - 2)
    self.upper_bound = [1.0, 1.0] + [2.0] * (number_of_variables - 2)
    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f1", "f2", "f3"]

re

RE21()

Bases: FloatProblem

Problem RE21 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a two-objective, unconstrained, continuous problem with 4 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    number_of_variables = 4

    f = 10.0
    sigma = 10.0
    tmp_var = f / sigma

    upper = [3.0 * tmp_var for _ in range(number_of_variables)]
    lower = [0.0 for _ in range(number_of_variables)]
    lower[0] = tmp_var
    lower[1] = sqrt(2.0) * tmp_var
    lower[2] = sqrt(2.0) * tmp_var
    lower[3] = tmp_var

    self.lower_bound = lower
    self.upper_bound = upper

RE22()

Bases: FloatProblem

Problem RE22 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a two-objective, unconstrained, mixed-integer problem with 3 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [0.2, 0.0, 0.0]
    self.upper_bound = [15.0, 20.0, 40.0]

RE23()

Bases: FloatProblem

Problem RE23 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a two-objective, unconstrained, mixed-integer problem with 4 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [1.0, 1.0, 10.0, 10.0]
    self.upper_bound = [100.0, 100.0, 200.0, 240.0]

RE24()

Bases: FloatProblem

Problem RE24 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a two-objective, unconstrained, continuous problem with 2 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [0.5, 0.5]
    self.upper_bound = [4.0, 50.0]

RE25()

Bases: FloatProblem

Problem RE25 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a two-objective, unconstrained, mixed-integer problem with 3 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)"]

    self.lower_bound = [1.0, 0.6, 0.09]
    self.upper_bound = [70.0, 3.0, 0.5]

RE31()

Bases: FloatProblem

Problem RE31 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a three-objective, unconstrained, continuous problem with 3 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)", "f(z)"]

    self.lower_bound = [0.00001, 0.00001, 1.0]
    self.upper_bound = [100.0, 100.0, 3.0]

RE32()

Bases: FloatProblem

Problem RE32 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a three-objective, unconstrained, continuous problem with 4 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)", "f(z)"]

    self.lower_bound = [0.125, 0.1, 0.1, 0.125]
    self.upper_bound = [5.0, 10.0, 10.0, 5.0]

RE33()

Bases: FloatProblem

Problem RE33 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a three-objective, unconstrained, continuous problem with 4 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)", "f(z)"]

    self.lower_bound = [55.0, 75.0, 1000.0, 11.0]
    self.upper_bound = [80.0, 110.0, 3000.0, 20.0]

RE34(number_of_variables=5)

Bases: FloatProblem

Problem RE34 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a three-objective, unconstrained, continuous problem with 5 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self, number_of_variables: int = 5):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)", "f(z)"]

    # All variables have the same bounds [1.0, 3.0]
    self.lower_bound = [1.0] * number_of_variables
    self.upper_bound = [3.0] * number_of_variables

RE35()

Bases: FloatProblem

Problem RE35 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a three-objective, unconstrained, mixed-integer problem with 7 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)", "f(z)"]

    self.lower_bound = [2.6, 0.7, 17.0, 7.3, 7.3, 2.9, 5.0]
    self.upper_bound = [3.6, 0.8, 28.0, 8.3, 8.3, 3.9, 5.5]

RE36()

Bases: FloatProblem

Problem RE36 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a three-objective, unconstrained, discrete problem with 4 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)", "f(z)"]

    self.lower_bound = [12.0, 12.0, 12.0, 12.0]
    self.upper_bound = [60.0, 60.0, 60.0, 60.0]

RE37()

Bases: FloatProblem

Problem RE37 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a three-objective, unconstrained, continuous problem with 4 decision variables.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(x)", "f(y)", "f(z)"]

    number_of_variables = 4
    self.lower_bound = [0.0] * number_of_variables
    self.upper_bound = [1.0] * number_of_variables

RE41()

Bases: FloatProblem

Problem RE41 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a four-objective, unconstrained, discrete problem with 7 decision variables and 10 constraints.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(w)", "f(x)", "f(y)", "f(z)"]
    self.number_of_original_constraints = 10

    self.lower_bound = [0.5, 0.45, 0.5, 0.5, 0.875, 0.4, 0.4]
    self.upper_bound = [1.5, 1.35, 1.5, 1.5, 2.625, 1.2, 1.2]

RE42()

Bases: FloatProblem

Problem RE42 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a four-objective, unconstrained, continuous problem with 6 decision variables and 9 constraints. The problem represents a ship design optimization problem.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["f(w)", "f(x)", "f(y)", "f(z)"]
    self.number_of_original_constraints = 9

    self.lower_bound = [150.0, 20.0, 13.0, 10.0, 14.0, 0.63]
    self.upper_bound = [274.32, 32.31, 25.0, 11.71, 18.0, 0.75]

RE61()

Bases: FloatProblem

Problem RE61 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a six-objective, unconstrained, continuous problem with 3 decision variables and 7 constraints.

Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self):
    super().__init__()

    self.obj_directions = [self.MINIMIZE] * 6
    self.obj_labels = ["f(w)", "f(x)", "f(y)", "f(z)", "f(v)", "f(u)"]
    self.number_of_original_constraints = 7

    self.lower_bound = [0.01, 0.01, 0.01]
    self.upper_bound = [0.45, 0.10, 0.10]

RE91(rng=None)

Bases: FloatProblem

Problem RE91 from: Ryoji Tanabe and Hisao Ishibuchi, "An easy-to-use real-world multi-objective optimization problem suite", Applied Soft Computing, Vol. 89, 106078 (2020). DOI: https://doi.org/10.1016/j.asoc.2020.106078

This is a nine-objective, unconstrained, continuous problem with 7 decision variables plus 4 random variables for a total of 11 variables.

Parameters:

Name Type Description Default
rng Generator | None

Optional random generator used to draw this problem's own random variables (x7-x10) inside evaluate(). When None, falls back to an unseeded random.Random() instance, as before this parameter existed -- note that instance is independent of the global random module, so evaluate() was never reproducible via random.seed() either way.

None
Source code in src/jmetal/problem/multiobjective/re.py
def __init__(self, rng: np.random.Generator | None = None):
    """
    Args:
        rng: Optional random generator used to draw this problem's own random
             variables (x7-x10) inside evaluate(). When None, falls back to an
             unseeded random.Random() instance, as before this parameter existed
             -- note that instance is independent of the global `random` module,
             so evaluate() was never reproducible via `random.seed()` either way.
    """
    super().__init__()

    self.obj_directions = [self.MINIMIZE] * 9
    self.obj_labels = [f"f({i + 1})" for i in range(9)]

    # Bounds for the first 7 variables
    self.lower_bound = [0.5, 0.45, 0.5, 0.5, 0.875, 0.4, 0.4]
    self.upper_bound = [1.5, 1.35, 1.5, 1.5, 2.265, 1.2, 1.2]

    # Add bounds for the random variables (will be set during evaluation)
    self.lower_bound.extend([-float("inf")] * 4)
    self.upper_bound.extend([float("inf")] * 4)

    # Initialize random number generator
    import random

    self.rng = rng
    self.random = random.Random()

get_closest_value(target_array, comp_value)

Return the value in target_array that is closest to comp_value.

This is a direct translation of the provided Java method. It assumes target_array contains at least one element; otherwise, raises ValueError.

Parameters:

Name Type Description Default
target_array Sequence[float]

A non-empty sequence of floats.

required
comp_value float

The value to compare against.

required

Returns:

Type Description
float

The element of target_array with minimum absolute difference to comp_value.

Source code in src/jmetal/problem/multiobjective/re.py
def get_closest_value(target_array: Sequence[float], comp_value: float) -> float:
    """Return the value in target_array that is closest to comp_value.

    This is a direct translation of the provided Java method. It assumes
    target_array contains at least one element; otherwise, raises ValueError.

    Args:
        target_array: A non-empty sequence of floats.
        comp_value: The value to compare against.

    Returns:
        The element of target_array with minimum absolute difference to comp_value.
    """
    if not target_array:
        raise ValueError("target_array must be a non-empty sequence")

    closest_value = target_array[0]
    min_diff_value = abs(target_array[0] - comp_value)

    for i in range(1, len(target_array)):
        tmp_diff_value = abs(target_array[i] - comp_value)
        if tmp_diff_value < min_diff_value:
            min_diff_value = tmp_diff_value
            closest_value = target_array[i]

    return float(closest_value)

rwa

Ahmad2017()

Bases: FloatProblem

Problem Ahmad2017 (RWA10) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    self.lower_bound = [10.0, 10.0, 150.0]
    self.upper_bound = [50.0, 50.0, 170.0]

    self.obj_directions = [
        self.MAXIMIZE,
        self.MAXIMIZE,
        self.MAXIMIZE,
        self.MAXIMIZE,
        self.MINIMIZE,
        self.MAXIMIZE,
        self.MAXIMIZE,
    ]
    self.obj_labels = ["WCA", "OCA", "AP", "CRA", "Stiffness", "Tear", "Tensile"]

Chen2015()

Bases: FloatProblem

Problem Chen2015 (RWA9) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    self.obj_directions = [
        self.MINIMIZE,
        self.MAXIMIZE,
        self.MAXIMIZE,
        self.MAXIMIZE,
        self.MINIMIZE,
    ]
    self.obj_labels = ["F1", "F2", "F3", "F4", "F5"]

    self.lower_bound = [17.5, 17.5, 2.0, 2.0, 5.0, 5.0]
    self.upper_bound = [22.5, 22.5, 3.0, 3.0, 7.0, 6.0]

Ganesan2013()

Bases: FloatProblem

Problem Ganesan2013 (RWA3) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    self.lower_bound = [0.25, 10000.0, 600.0]
    self.upper_bound = [0.55, 20000.0, 1100.0]

    self.obj_directions = [self.MAXIMIZE, self.MAXIMIZE, self.MINIMIZE]
    self.obj_labels = ["HC4_conversion", "CO_selectivity", "H2_CO_ratio"]

Gao2020()

Bases: FloatProblem

Problem Gao2020 (RWA5) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    self.lower_bound = [40.0, 0.35, 333.0, 20.0, 3000.0, 0.1, 308.0, 150.0, 0.1]
    self.upper_bound = [100.0, 0.5, 363.0, 40.0, 4000.0, 3.0, 328.0, 200.0, 2.0]

    self.obj_directions = [self.MINIMIZE, self.MAXIMIZE, self.MAXIMIZE]
    self.obj_labels = ["t_eff", "Q_eff", "Phi_ex"]

Goel2007()

Bases: FloatProblem

Problem Gao2020 (RWA7) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    number_of_variables = 4
    self.lower_bound = [0.0] * number_of_variables
    self.upper_bound = [1.0] * number_of_variables

    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]
    self.obj_labels = ["Xcc", "TFmax", "TTmax"]

Liao2008()

Bases: FloatProblem

Problem Liao2008 (RWA2) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    number_of_variables = 5
    self.lower_bound = [1.0] * number_of_variables
    self.upper_bound = [3.0] * number_of_variables

    self.obj_labels = ["Mass", "Ain", "Intrusion"]
    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]

Padhi2016()

Bases: FloatProblem

Problem Padhi2016 (RWA4) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    self.lower_bound = [1.0, 10.0, 850.0, 20.0, 4.0]
    self.upper_bound = [1.4, 26.0, 1650.0, 40.0, 8.0]

    self.obj_labels = ["CR", "Ra", "DD"]
    self.obj_directions = [self.MAXIMIZE, self.MINIMIZE, self.MINIMIZE]

Subasi2016()

Bases: FloatProblem

Problem Subasi2016 (RWA1) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    self.lower_bound = [20.0, 6.0, 20.0, 0.0, 8000.0]
    self.upper_bound = [60.0, 15.0, 40.0, 30.0, 25000.0]

    self.obj_labels = ["Nu", "f"]
    self.obj_directions = [self.MINIMIZE, self.MINIMIZE]

Vaidyanathan2004()

Bases: FloatProblem

Problem Vaidyanathan2004 (RWA8) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    self.lower_bound = [0.0, 0.0, 0.0, 0.0]
    self.upper_bound = [1.0, 1.0, 1.0, 1.0]

    self.obj_labels = ["TFmax", "TW4", "TTmax", "Xcc"]
    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MINIMIZE, self.MINIMIZE]

Xu2020()

Bases: FloatProblem

Problem Xu2020 (RWA6) described in the paper "Engineering applications of multi-objective evolutionary algorithms: A test suite of box-constrained real-world problems". DOI: https://doi.org/10.1016/j.engappai.2023.106192

Source code in src/jmetal/problem/multiobjective/rwa.py
def __init__(self):
    super().__init__()

    self.lower_bound = [12.56, 0.02, 1.0, 0.5]
    self.upper_bound = [25.12, 0.06, 5.0, 2.0]

    self.obj_labels = ["Ft", "Ra", "MRR"]
    self.obj_directions = [self.MINIMIZE, self.MINIMIZE, self.MAXIMIZE]

misc

multiobjective_tsp

MultiObjectiveTSP(distance_files)

Bases: PermutationProblem

Multi-objective TSP problem.

Reads one or more TSPLIB-like files (NODE_COORD_SECTION) and creates one distance matrix per file. All matrices must have the same dimension.

Usage notes: - Passing a single filename produces a single-objective problem (i.e., number_of_objectives() will be 1). This makes MultiObjectiveTSP a drop-in replacement for single-objective TSP instances in most codepaths. - Filenames may be given as absolute/relative paths or as short names (e.g. "eil101.tsp"); short names are resolved by searching resources/TSP_instances inside the repository. - The reader supports typical TSPLIB NODE_COORD_SECTION formats and stops at EOF/TOUR_SECTION markers.

Source code in src/jmetal/problem/multiobjective/multiobjective_tsp.py
def __init__(self, distance_files: list[str]):
    super().__init__()

    if not distance_files:
        raise ValueError("distance_files must be a non-empty list of file paths")

    self.distance_matrices: list[list[list[float]]] = []
    self.number_of_cities = None

    for f in distance_files:
        resolved = self._resolve_file_path(f)
        matrix, dim = self._read_problem(resolved)
        if self.number_of_cities is None:
            self.number_of_cities = dim
        elif self.number_of_cities != dim:
            raise ValueError("All distance files must have the same DIMENSION")
        self.distance_matrices.append(matrix)

    self.obj_directions = [self.MINIMIZE] * len(self.distance_matrices)

Single-objective

unconstrained

OneMax(number_of_bits=256)

Bases: BinaryProblem

The OneMax problem is a simple optimization problem that counts the number of ones in a binary string.

The objective is to maximize the number of ones in the binary string, which is equivalent to minimizing the negative count of ones.

Parameters:

Name Type Description Default
number_of_bits int

The length of the binary string (default: 256)

256
Source code in src/jmetal/problem/singleobjective/unconstrained.py
def __init__(self, number_of_bits: int = 256):
    super().__init__()
    self.number_of_bits = number_of_bits
    self.number_of_bits_per_variable = [number_of_bits]  # For backward compatibility

    self.obj_directions = [self.MINIMIZE]  # We'll use negative count for minimization
    self.obj_labels = ["Ones"]

SubsetSum(C, W)

Bases: BinaryProblem

The goal is to find a subset S of W whose elements sum is closest to (without exceeding) C.

This is a single-objective problem where we want to: 1. Maximize the sum of selected elements (without exceeding C)

Parameters:

Name Type Description Default
C int

The target sum (large integer)

required
W list

List of non-negative integers to select from

required
Source code in src/jmetal/problem/singleobjective/unconstrained.py
def __init__(self, C: int, W: list):
    """The goal is to find a subset S of W whose elements sum is closest to (without exceeding) C.

    This is a single-objective problem where we want to:
    1. Maximize the sum of selected elements (without exceeding C)

    Args:
        C: The target sum (large integer)
        W: List of non-negative integers to select from
    """
    super().__init__()
    self.C = C
    self.W = np.array(W, dtype=float)  # Convert to numpy array for vectorized operations

    self.number_of_bits = len(self.W)
    self.obj_directions = [self.MAXIMIZE]
    self.obj_labels = ["Sum"]

knapsack

Knapsack(number_of_items=50, capacity=1000, weights=None, profits=None, from_file=False, filename=None)

Bases: BinaryProblem

Class representing Knapsack Problem.

Source code in src/jmetal/problem/singleobjective/knapsack.py
def __init__(
    self,
    number_of_items: int = 50,
    capacity: float = 1000,
    weights: list = None,
    profits: list = None,
    from_file: bool = False,
    filename: str = None,
):
    super().__init__()

    if from_file:
        self.__read_from_file(filename)
    else:
        self.capacity = capacity
        self.weights = weights
        self.profits = profits
        self.number_of_bits = number_of_items

    self.obj_directions = [self.MAXIMIZE]

tsp

TSP(instance=None)

Bases: PermutationProblem

Backward-compatible wrapper for single-objective TSP.

This class delegates to MultiObjectiveTSP internally, created with a single filename. It preserves the original API (number_of_objectives() == 1, evaluate, create_solution) so existing code can switch to it with minimal changes.

Source code in src/jmetal/problem/singleobjective/tsp.py
def __init__(self, instance: str = None):
    super().__init__()

    if instance is None:
        raise FileNotFoundError("Filename can not be None")

    self._multi = MultiObjectiveTSP([instance])
    # keep compatibility attributes
    self.distance_matrix = self._multi.distance_matrices[0]
    self.number_of_cities = self._multi.number_of_cities
    self.obj_directions = [self.MINIMIZE]