-
Notifications
You must be signed in to change notification settings - Fork 2
Constraints
Currently there are implemented the following constraints:
- Less or equal
- Greater or equal
- Equal
- Multiple of
- Less than
- Greater than
- Not equal
This is the basic constraint used to implement other base constraints.
IMilpManager manager;
IVariable variable;
IVariable bound;
...
variable.Set(ConstraintType.LessOrEqual, bound);
or
manager.Set(ConstraintType.LessOrEqual, variable, bound);
Adds constraint that in the final solution variable
is less or equal to bound
. Works for every type of variable.
Implemented as a Less or equal constraint with bounds swapped.
IMilpManager manager;
IVariable variable;
IVariable bound;
...
variable.Set(ConstraintType.GreaterOrEqual, bound);
or
manager.Set(ConstraintType.GreaterOrEqual, variable, bound);
Adds constraint that in the final solution variable
is greater or equal to bound
. Works for every type of variable. Implemented as:
bound.Set(ConstraintType.LessOrEqual, variable);
Implemented as two Less or equal constraints.
IMilpManager manager;
IVariable variable;
IVariable bound;
...
variable.Set(ConstraintType.Equal, bound);
or
manager.Set(ConstraintType.Equal, variable, bound);
Adds constraint that in the final solution variable
is equal to bound
. Works for every type of variable. Implemented as:
variable.Set(ConstraintType.LessOrEqual, bound);
bound.Set(ConstraintType.LessOrEqual, variable);
Makes sure that one variable is a multiple of second variable.
IMilpManager manager;
IVariable variable;
IVariable divider;
...
variable.Set(ConstraintType.MultipleOf, divider);
or
manager.Set(ConstraintType.MultipleOf, variable, divider);
Adds constraint that in the final solution variable
is a multiple of divider
. Works for every type of variable even for non-integer variables.
Makes sure that variable is less than bound. Uses implementation of comparisons.
IMilpManager manager;
IVariable variable;
IVariable bound;
...
variable.Set(ConstraintType.LessThan, bound);
or
manager.Set(ConstraintType.LessThan, variable, bound);
Adds constraint that in the final solution variable
is less than bound
. Depends on IsLessThan
operation.
Makes sure that variable is greater than bound. Uses implementation of comparisons.
IMilpManager manager;
IVariable variable;
IVariable bound;
...
variable.Set(ConstraintType.GreaterThan, bound);
or
manager.Set(ConstraintType.GreaterThan, variable, bound);
Adds constraint that in the final solution variable
is greater than bound
. Depends on IsGreaterThan
operation.
Makes sure that variable is not equal to bound.
IMilpManager manager;
IVariable variable;
IVariable bound;
...
variable.Set(ConstraintType.NotEqual, bound);
or
manager.Set(ConstraintType.NotEqual, variable, bound);
Adds constraint that in the final solution variable
is greater than bound
. Depends on IsNotEqual
operation.