Data based problem

If the problem to be optimized has already been solved for a representation of its’ Pareto efficient front, it can be defined as a ScalarDataProblem.

Suppose we have a problem with 2 decision variables and 4 objectives. In this case, it is the river pollution problem as defined in https://ieeexplore.ieee.org/document/35354

The computed Pareto efficient solutions and the corresponding objective vector values have been computed in the file ‘riverpollution.dat’. There is a total of 500 entries. Begin by importing relevant classes and laoding the data.

[1]:
# NOTE: This will soon be depreciated.
from desdeo_problem import ScalarDataProblem

import numpy as np

data = np.loadtxt("./data/riverpollution.dat")

The first 2 entries of each row are the decision variables, and the last 4 the objective function values.

[2]:
xs, fs = data[:, 0:2], data[:, 2:]

The problem can now be defined:

[3]:
problem = ScalarDataProblem(xs, fs)

That’s it. Now the problem is defined and can be further utilized. Notice that there are no constraints. It is assumed that all the entries in the data file are feasible. The warning has to do with the fact, that the data is discrete, therefore the evaluations for specific decision variable values have to be approximated somehow. At the moment, the closest pair of decision variables is searched for in the data. Later on, a surrogate model for the data might be build to have a better approximation.

[4]:
print("N of objectives:", problem.n_of_objectives)
print("N of variables:", problem.n_of_variables)

print("Single decision vector evaluaion:", problem.evaluate([0.4, 0.5]))
N of objectives: 4
N of variables: 2
Single decision vector evaluaion: (array([-5.6304735 , -2.87892556, -7.06008234,  0.05013393]),)
[ ]: