12. Solvers¶
12.1. miplearn.solvers.abstract¶
-
class
miplearn.solvers.abstract.
AbstractModel
¶ Bases:
abc.ABC
-
abstract
add_constrs
(var_names: numpy.ndarray, constrs_lhs: numpy.ndarray, constrs_sense: numpy.ndarray, constrs_rhs: numpy.ndarray, stats: Optional[Dict] = None) → None¶
-
abstract
extract_after_load
(h5: miplearn.h5.H5File) → None¶
-
abstract
extract_after_lp
(h5: miplearn.h5.H5File) → None¶
-
abstract
extract_after_mip
(h5: miplearn.h5.H5File) → None¶
-
abstract
fix_variables
(var_names: numpy.ndarray, var_values: numpy.ndarray, stats: Optional[Dict] = None) → None¶
-
abstract
optimize
() → None¶
-
abstract
relax
() → miplearn.solvers.abstract.AbstractModel¶
-
abstract
set_warm_starts
(var_names: numpy.ndarray, var_values: numpy.ndarray, stats: Optional[Dict] = None) → None¶
-
abstract
write
(filename: str) → None¶
-
abstract
12.2. miplearn.solvers.gurobi¶
-
class
miplearn.solvers.gurobi.
GurobiModel
(inner: gurobipy.Model, find_violations: Optional[Callable] = None, fix_violations: Optional[Callable] = None)¶ Bases:
object
-
add_constrs
(var_names: numpy.ndarray, constrs_lhs: numpy.ndarray, constrs_sense: numpy.ndarray, constrs_rhs: numpy.ndarray, stats: Optional[Dict] = None) → None¶
-
extract_after_load
(h5: miplearn.h5.H5File) → None¶ Given a model that has just been loaded, extracts static problem features, such as variable names and types, objective coefficients, etc.
-
extract_after_lp
(h5: miplearn.h5.H5File) → None¶ Given a linear programming model that has just been solved, extracts dynamic problem features, such as optimal LP solution, basis status, etc.
-
extract_after_mip
(h5: miplearn.h5.H5File) → None¶ Given a mixed-integer linear programming model that has just been solved, extracts dynamic problem features, such as optimal MIP solution.
-
fix_variables
(var_names: numpy.ndarray, var_values: numpy.ndarray, stats: Optional[Dict] = None) → None¶
-
optimize
() → None¶
-
relax
() → miplearn.solvers.gurobi.GurobiModel¶
-
set_time_limit
(time_limit_sec: float) → None¶
-
set_warm_starts
(var_names: numpy.ndarray, var_values: numpy.ndarray, stats: Optional[Dict] = None) → None¶
-
write
(filename: str) → None¶
-
12.3. miplearn.solvers.learning¶
-
class
miplearn.solvers.learning.
LearningSolver
(components: List[Any], skip_lp=False)¶ Bases:
object
-
fit
(data_filenames)¶
-
optimize
(model: Union[str, miplearn.solvers.abstract.AbstractModel], build_model=None)¶
-