Suppose we have a two-dimensional binary variable x. Let, for example, be two-dimensional with n x m rows and columns.
a) How can I express, in linear terms, a constraint of the following type?
# sum(x[1,:])== 5 => sum(x[3,:])==2
is something like this okay?
sum(x[1,:])== 5 --> {sum(x[3,:])==2}
or do we need something like this (maybe done better)?
# s>=0 ; y in {0,1}
# sum(x[3,:]) + s ==2
# sum(x[1,:]) - 3y >= s+(1-y)*3
# y==1 => s==0 => sum(x[3,:])==2
# y==0 => (0 <= s <= 2) => 2 >= sum(x[3,:]) >=0
# maybe this one is better?
# sum(x[1,:]) - 5y >= s-(1-y)*(m-5)
# y==0 => (0 <= s <= m) => m >= sum(x[3,:]) >=0
b) Can I impose a nonlinear objective function? A quadratic one, for example?
I hope the question is well posed, even if I didn’t specify the context well.