optiprofiler.problem_libs.s2mpj.s2mpj_load

Contents

optiprofiler.problem_libs.s2mpj.s2mpj_load#

optiprofiler.problem_libs.s2mpj.s2mpj_load(problem_name, *args)[source]#

Convert an S2MPJ problem name to a Problem instance.

Parameters:
problem_namestr

Name of the problem in the S2MPJ collection. More details about S2MPJ can be found at the official repository.

Returns:
optiprofiler.Problem

A Problem instance corresponding to the named problem.

See also

s2mpj_select

Select problems from S2MPJ by criteria.

Notes

There are two ways to obtain the problem_name you want:

  1. Use s2mpj_select to get the problem names that satisfy your criteria.

  2. Look for the CSV file probinfo_python.csv in the same directory as this module. It contains information about all problems in S2MPJ.

The problem name may appear in the form 'PROBLEMNAME_n_m' where n is the dimension and m is the number of linear and nonlinear constraints. This happens when a problem accepts extra arguments to change its dimension or number of constraints. This information is stored in the probinfo_python.csv file.

Examples

from optiprofiler.problem_libs.s2mpj import s2mpj_load

problem = s2mpj_load('ROSENBR')
print(problem.n)  # 2