Skip to content

flixopt.solvers

This module contains the solvers of the flixopt framework, making them available to the end user in a compact way.

Classes

GurobiSolver dataclass

Python
GurobiSolver(mip_gap: float = (lambda: CONFIG.Solving.mip_gap)(), time_limit_seconds: int = (lambda: CONFIG.Solving.time_limit_seconds)(), log_to_console: bool = (lambda: CONFIG.Solving.log_to_console)(), extra_options: dict[str, Any] = dict())

Bases: _Solver

Gurobi solver configuration.

Parameters:

Name Type Description Default
mip_gap float

Acceptable relative optimality gap in [0.0, 1.0]; mapped to Gurobi MIPGap.

(lambda: mip_gap)()
time_limit_seconds int

Time limit in seconds; mapped to Gurobi TimeLimit.

(lambda: time_limit_seconds)()
log_to_console bool

If False, no output to console.

(lambda: log_to_console)()
extra_options dict[str, Any]

Additional solver options merged into options.

dict()

Attributes

options property
Python
options: dict[str, Any]

Return a dictionary of solver options.

HighsSolver dataclass

Python
HighsSolver(mip_gap: float = (lambda: CONFIG.Solving.mip_gap)(), time_limit_seconds: int = (lambda: CONFIG.Solving.time_limit_seconds)(), log_to_console: bool = (lambda: CONFIG.Solving.log_to_console)(), extra_options: dict[str, Any] = dict())

Bases: _Solver

HiGHS solver configuration.

Attributes:

Name Type Description
mip_gap float

Acceptable relative optimality gap in [0.0, 1.0]; mapped to HiGHS mip_rel_gap.

time_limit_seconds int

Time limit in seconds; mapped to HiGHS time_limit.

log_to_console bool

If False, no output to console.

extra_options dict[str, Any]

Additional solver options merged into options.

threads int | None

Number of threads to use. If None, HiGHS chooses.

Attributes

options property
Python
options: dict[str, Any]

Return a dictionary of solver options.