optiprofiler.problem_libs.s2mpj.s2mpj_load

Contents

optiprofiler.problem_libs.s2mpj.s2mpj_load#

optiprofiler.problem_libs.s2mpj.s2mpj_load(problem_name, *args, library_options=None)[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.

library_optionsdict, optional

Validated S2MPJ options supplied by OptiProfiler. They currently affect problem selection rather than loading, but accepting the same mapping keeps selector and worker behavior explicit.

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.

Invalid native metadata fails closed: wrong shapes, NaN entries and impossible or crossed bounds raise ValueError, and a linear constraint whose values or Jacobian cannot be read at x0 raises RuntimeError with the original cause. No constraint is dropped and no NaN matrix is built. Problems without linear constraints need no Jacobian probe at load time.

Examples

from optiprofiler.problem_libs.s2mpj import s2mpj_load

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