Bin packing constraints
[Using integer variables and constraints]
Functions | |
void | Gecode::binpacking (Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntConLevel icl=ICL_DEF) |
Post propagator for bin packing. |
Function Documentation
void Gecode::binpacking | ( | Home | home, | |
const IntVarArgs & | l, | |||
const IntVarArgs & | b, | |||
const IntArgs & | s, | |||
IntConLevel | icl = ICL_DEF | |||
) |
Post propagator for bin packing.
The variables in l are the loads for each bin, whereas the variables in b define for each item into which bin it is packed. The integer values s define the size of the items.
It is propagated that for each with the constraint holds and that for each with the constraint holds.
The propagation follows: Paul Shaw. A Constraint for Bin Packing. CP 2004.
Throws the following exceptions:
- Of type Int::ArgumentSizeMismatch if b and s are not of the same size.
- Of type Int::ArgumentSame if l and b share unassigned variables.
- Of type Int::OutOfLimits if s contains a negative number.