optiprofiler.problem_libs.s2mpj.s2mpj_select

Contents

optiprofiler.problem_libs.s2mpj.s2mpj_select#

optiprofiler.problem_libs.s2mpj.s2mpj_select(options, library_options=None)[source]#

Select problems from S2MPJ that satisfy given criteria.

Parameters:
optionsdict

A dictionary containing selection criteria. More details about S2MPJ can be found at the official repository. Supported keys:

  • ptype (str) – Type of problems to select. A string consisting of any combination of 'u' (unconstrained), 'b' (bound constrained), 'l' (linearly constrained), and 'n' (nonlinearly constrained), such as 'b', 'ul', 'ubn'. Default is 'ubln'.

  • mindim (int) – Finite minimum dimension. Default is 1.

  • maxdim (int or positive infinity) – Maximum dimension. Default is float('inf').

  • minb (int) – Minimum number of bound constraints. Default is 0.

  • maxb (int or positive infinity) – Maximum number of bound constraints. Default is inf.

  • minlcon (int) – Minimum number of linear constraints. Default is 0.

  • maxlcon (int or positive infinity) – Maximum number of linear constraints. Default is inf.

  • minnlcon (int) – Minimum number of nonlinear constraints. Default is 0.

  • maxnlcon (int or positive infinity) – Maximum number of nonlinear constraints. Default is inf.

  • mincon (int) – Minimum total number of linear and nonlinear constraints. Default is 0.

  • maxcon (int or positive infinity) – Maximum total number of linear and nonlinear constraints. Default is inf.

  • oracle (int) – Oracle provided by the problem. 0 means zeroth-order, 1 means first-order, 2 means second-order. Default is 0.

  • excludelist (list of str) – List of problem names to exclude. Default is [].

library_optionsdict, optional

S2MPJ-specific options. Supported keys are variable_size and test_feasibility_problems. If omitted, package configuration and environment-level defaults are used.

Returns:
list of str

Problem names that satisfy the given criteria.

See also

s2mpj_load

Load a problem from S2MPJ.

optiprofiler.get_plib_config

Read the current configuration.

optiprofiler.set_plib_config

Override configuration at runtime.

Notes

Supply finite integer lower limits: mindim >= 1 and the other min* >= 0. Each upper limit is an integer at least its lower limit, or positive infinity (no upper cutoff). NaN and negative infinity are not valid selection limits. OptiProfiler validates this contract for benchmark calls; direct selector callers must supply valid criteria.

  1. All information about the problems can be found in the CSV file probinfo_python.csv in the same directory as this module.

  2. The problem name may appear in the form 'PROBLEMNAME_n_m' where n is the dimension and m is the number of constraints. This happens when a problem accepts extra arguments to change its dimension or number of constraints.

  3. There is a file config.txt in the same directory as this module. It can be used to set the options variable_size and test_feasibility_problems. See the comments in config.txt for details. You can also override these options at runtime using set_plib_config or by setting environment variables S2MPJ_VARIABLE_SIZE and S2MPJ_TEST_FEASIBILITY_PROBLEMS. Environment variables take precedence over config.txt. An explicit library_options mapping takes precedence over both and is used by benchmark(..., plib_options=...).

Examples

from optiprofiler.problem_libs.s2mpj import s2mpj_select

names = s2mpj_select({'ptype': 'u', 'maxdim': 2})