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

GurobiSolver(mip_gap: float, time_limit_seconds: int, 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.

required
time_limit_seconds int

Time limit in seconds; mapped to Gurobi TimeLimit.

required
extra_options dict[str, Any]

Additional solver options merged into options.

dict()

Attributes

options property
options: dict[str, Any]

Return a dictionary of solver options.

HighsSolver dataclass

HighsSolver(mip_gap: float, time_limit_seconds: int, 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.

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
options: dict[str, Any]

Return a dictionary of solver options.