contents.gifprev1.gifnext0.gif

Using Integer Constraints

Integer constraints can only be applied to cells which are decision variables; hence the cells selected on the left hand side of the constraint must be a subset (or all) of the cells in the By Changing Cells edit box, or the Variable Cell list box. Integer constraints specify that the selected variable cells must have solution values which are integers, such as -1, 0 or 2, to within a small tolerance. Variable cells which have binary integer constraints must be either 0 or 1 at the optimal solution.

You specify an integer or binary constraint by selecting the "int" or "bin" choice from the Relation dropdown list in the Add/Change Constraint dialog. The Solver displays such constraints in the Constraint list box in the form "A1..A10 = integer" or "A1..A10 = binary". A binary integer constraint is exactly equivalent to three other constraints: One of the form "A1..A10 = integer", another of the form "A1..A10 >= 0" and a third of the form "A1..A10 <= 1".

Be sure that you select "int" or "bin" from the Relation dropdown list. If you select = from the dropdown list and type the word "integer" or "binary" on the right hand side, the Solver will not recognize this as an integer constraint, and clicking on Solve will probably result in the error message "Solver encountered an error value in a target or constraint cell".