neurop.Problem.ILPProblem¶
- class neurop.Problem.ILPProblem(problem: Model, initializer=None)¶
Bases:
BaseProblem
General integer linear programming (ILP) problem.
ILPs are defined by a set of (in)equality constraints and an objective function over integer variables. The ILP can be formulated using the optlang package.
- __init__(problem: Model, initializer=None)¶
Initializes the ILP problem.
- Parameters:
problem (OptProblem) – the problem in optlang.Model format
initializer (_type_, optional) – function to initialize the parameters of the problem. Defaults to None, which means that parameters will be randomly initialized.
Methods
__init__
(problem[, initializer])Initializes the ILP problem.
evaluate_constraints
(params)Evaluates the constraints of the problem for a given set of (binary) parameter values.
evaluate_objective
(params)Evaluates the objective function of the problem for a given set of (binary) parameter values.
supports_model
(model_type)Attributes
constraints
objective
variables
- evaluate_constraints(params: ndarray) Iterable[bool] ¶
Evaluates the constraints of the problem for a given set of (binary) parameter values.
- evaluate_objective(params: ndarray) float ¶
Evaluates the objective function of the problem for a given set of (binary) parameter values.