lib_scipy_milp module¶
SciPy linear programming library wrapper.
- class gemseo.algos.opt.lib_scipy_milp.ScipyMILP[source]
Bases:
OptimizationLibrary
SciPy Mixed Integer Linear Programming library interface.
See OptimizationLibrary.
With respect to scipy milp function, this wrapper only allows continuous or integer variables.
Notes
The missing current values of the
DesignSpace
attached to theOptimizationProblem
are automatically initialized with the methodDesignSpace.initialize_missing_current_values()
.Constructor.
Generate the library dictionary that contains the list of algorithms with their characteristics.
- LIB_COMPUTE_GRAD = True
- OPTIONS_MAP: ClassVar[dict[int, str]] = {'max_iter': 'node_limit'}
The names of the options in GEMSEO mapping to those in the wrapped library.
- descriptions: dict[str, AlgorithmDescription]
The description of the algorithms contained in the library.
- internal_algo_name: str | None
The internal name of the algorithm used currently.
It typically corresponds to the name of the algorithm in the wrapped library if any.
- opt_grammar: JSONGrammar | None
The grammar defining the options of the current algorithm.
- problem: OptimizationProblem
The optimization problem the driver library is bonded to.
- class gemseo.algos.opt.lib_scipy_milp.ScipyMILPAlgorithmDescription(algorithm_name, internal_algorithm_name, library_name='SciPy', description='', website='', handle_integer_variables=True, require_gradient=False, handle_equality_constraints=True, handle_inequality_constraints=True, handle_multiobjective=False, positive_constraints=False, problem_type=ProblemType.LINEAR)[source]
Bases:
OptimizationAlgorithmDescription
The description of a MILP optimization algorithm from the SciPy library.
- Parameters:
algorithm_name (str) –
internal_algorithm_name (str) –
library_name (str) –
By default it is set to “SciPy”.
description (str) –
By default it is set to “”.
website (str) –
By default it is set to “”.
handle_integer_variables (bool) –
By default it is set to True.
require_gradient (bool) –
By default it is set to False.
handle_equality_constraints (bool) –
By default it is set to True.
handle_inequality_constraints (bool) –
By default it is set to True.
handle_multiobjective (bool) –
By default it is set to False.
positive_constraints (bool) –
By default it is set to False.
problem_type (ProblemType) –
By default it is set to “linear”.
- algorithm_name: str
The name of the algorithm in GEMSEO.
- handle_equality_constraints: bool = True
Whether the optimization algorithm handles equality constraints.
- handle_inequality_constraints: bool = True
Whether the optimization algorithm handles inequality constraints.
- handle_integer_variables: bool = True
Whether the optimization algorithm handles integer variables.
- internal_algorithm_name: str
The name of the algorithm in the wrapped library.
- library_name: str = 'SciPy'
The name of the wrapped library.
- problem_type: ProblemType = 'linear'
The type of problem (see
OptimizationProblem.ProblemType
).