13. Solvers#
13.1. miplearn.solvers.abstract#
- class miplearn.solvers.abstract.AbstractModel#
Bases:
ABC- WHERE_CUTS = 'cuts'#
- WHERE_DEFAULT = 'default'#
- WHERE_LAZY = 'lazy'#
- abstract add_constrs(var_names: ndarray, constrs_lhs: ndarray, constrs_sense: ndarray, constrs_rhs: ndarray, stats: Dict | None = None) None#
- abstract fix_variables(var_names: ndarray, var_values: ndarray, stats: Dict | None = None) None#
- lazy_enforce(violations: List[Any]) None#
- abstract optimize() None#
- abstract relax() AbstractModel#
- set_cuts(cuts: List) None#
- abstract set_warm_starts(var_names: ndarray, var_values: ndarray, stats: Dict | None = None) None#
- abstract write(filename: str) None#
13.2. miplearn.solvers.gurobi#
- class miplearn.solvers.gurobi.GurobiModel(inner: Model, lazy_separate: Callable | None = None, lazy_enforce: Callable | None = None, cuts_separate: Callable | None = None, cuts_enforce: Callable | None = None)#
Bases:
AbstractModel- add_constr(constr: Any) None#
- add_constrs(var_names: ndarray, constrs_lhs: ndarray, constrs_sense: ndarray, constrs_rhs: ndarray, stats: Dict | None = None) None#
- extract_after_load(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: 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: 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: ndarray, var_values: ndarray, stats: Dict | None = None) None#
- optimize() None#
- relax() GurobiModel#
- set_time_limit(time_limit_sec: float) None#
- set_warm_starts(var_names: ndarray, var_values: ndarray, stats: Dict | None = None) None#
- write(filename: str) None#
13.3. miplearn.solvers.learning#
- class miplearn.solvers.learning.LearningSolver(components: List[Any], skip_lp: bool = False)#
Bases:
object- fit(data_filenames: List[str]) None#
- optimize(model: str | AbstractModel, build_model: Callable | None = None) Tuple[AbstractModel, Dict[str, Any]]#