Problems

Author:

Antonio J. Nebro

Date:

2026-6-12

All the problems in jMetal implement the Problem interface:

package org.uma.jmetal.problem;

/**
 * Interface representing a multi-objective optimization problem
 *
 * @author Antonio J. Nebro
 *
 * @param <S> Encoding
 */
public interface Problem<S> extends Serializable {
  /* Getters */
  int numberOfVariables() ;
  int numberOfObjectives() ;
  int numberOfConstraints() ;
  String name() ;

  /* Methods */
  void evaluate(S solution) ;
  S createSolution() ;
}

Every problem is characterized by the number of decision variables, the number of objective functions and the number of constraints, so getter methods for returning those values have to be defined. The genetic type S allows to determine the encoding of the solutions of the problem. This way, a problem must include a method for evaluating any solution of class S as well as providing a createSolution() method for creating a new solution. A class named AbstractGenericProblem containing setter and getter method implementations for the problem fields is provided.

If a problem has side constraints, it is assumed that the overall constraint degree of a given solution is computed inside the evaluate() method. The values stored in the constraints() array of the solutions must follow the jMetal sign convention: a value lower than 0.0 means that the corresponding constraint is violated, and the overall constraint violation degree is the (negative) sum of the values of the violated constraints. Problems whose constraints have non-standard semantics can precompute the number of violated constraints and the overall violation degree as solution attributes by using the setter methods of the ConstraintHandling utility class (see Constraint handling); in that case, the precomputed degree must be negative for infeasible solutions and 0.0 for feasible ones.

Among the constrained benchmarks included in jmetal-problem, the org.uma.jmetal.problem.multiobjective.cf package contains the CF1-CF16 problem suite defined in “Constrained Multiobjective Optimization: Test Problem Construction and Performance Evaluations” (Y. Xiang et al., IEEE TEVC, 2021), which is scalable in the number of objectives; CF9-CF16 precompute their constraint violation attributes due to their band-type constraints. The reference fronts of these problems (three-objective formulations) are located in the resources/referenceFrontsRSG directory. The org.uma.jmetal.problem.multiobjective.cdtlz package provides the C-DTLZ problems (C1_DTLZ1, C1_DTLZ3, C2_DTLZ2, C3_DTLZ1, C3_DTLZ4) proposed in the NSGA-III paper.

jMetal provides currently the following interfaces representing types of problems (all of them extending Problem), and the available implementations of them:

  • BinaryProblem

    • AbstractBinaryProblem: Each problem variable is a bit string, and the class includes methods such as getBitsFromVariable(int index) and getTotalNumberOfBits().

  • IntegerProblem

    • AbstractIntegerProblem: The problem variables are integer values in a given range defined by a lower and upperbound. This means that this class is not adequate for combinatorial problems based on integer values.

  • DoubleProblem

    • AbstractDoubleProblem: The problem variables are double values in a given range defined by a lower and upperbound.

    • ComposableDoubleProblem: This class allows to define a double problem in a dynamic way, as shown in this code snippet:

    ComposableDoubleProblem problem = new ComposableDoubleProblem()
    .setName("Srinivas")
    .addVariable(-20.0, 20.0)
    .addVariable(-20.0, 20.0)
    .addFunction((x) -> 2.0 + (x[0] - 2.0) *  (x[0] - 2.0) + (x[1] - 1.0) * (x[1] - 1.0))
    .addFunction((x) -> 9.0 * x[0] - (x[1] - 1.0) * (x[1] - 1.0))
    .addConstraint((x) -> 1.0 - (x[0] * x[0] + x[1] * x[1]) / 225.0)
    .addConstraint((x) -> (3.0 * x[1] - x[0]) / 10.0 - 1.0)) ;
    
    • DummyDoubleProblem: This class is intended to be used in unit testing code (to avoid having to define it many times).

  • PermutationProblem

  • SequenceProblem

All the problems provided by jMetal are included in the org.uma.jmetal.problem package located in the jmetal-problem sub-project. The package includes the sub-packages multiobjective and singleobjective, which contains the codes of the problems. You can find both individual problems (e.g., Kursawe, Sphere, etc.) and benchmarks suites (such as ZDT, DTLZ or LZ09).

The lists of single- and multi-objective problems are included in the next figures:

Single-objective problems.
Multi-objective problems.