0
votes

I am implementing a version of the bin packing problem in cplex and I had to introduce the following constraint, where y and x are boolean decision variables:

forall(i in itens) sum(j in bins) y[i][j] * x[j] == 1;

The problem is that when I run the model cplex give me the following error: "cplex can't extract the expression y[i][j] * x[j].

Does anyone know how to run this properly?

2

2 Answers

0
votes

if x and y are boolean decision variables, then in order to say

z==x*y

you may write

z<=x; z<=y; z>=x+y-1;

0
votes

I think it should be y[i][j] * x[j] = 1not y[i][j] * x[j] == 1