I wish to kindly ask for help on how to linearize the following anded condition
thank you in advance asked 19 Apr '16, 12:24 nardinebasta 
If answered 19 Apr '16, 15:43 ocramz the idea is that in some cases all the elements in R are zeros thus the maximum value in this case is zero. I want to exclude this case from the solution. i.e. c =0 if m = 0 even if r=m
(19 Apr '16, 15:52)
nardinebasta

Setting \(c=1\) if and only if \(r=m\) can only be done approximately, meaning setting \(c=1\) if \(r\) is within some nonzero tolerance of \(m\). I posted a solution for that a while back. Notational conversion: \(x, y, m\) in my post would be \(c, r  m, 0\) respectively for you. You also specified the condition \(m>0\), which again can only be handled to within some tolerance. Let me relabel the binary variable in the previous part \(c_1\). Introduce a second binary variable \(c_2\) with the constraints \(\epsilon c_2 \le m \le 100c_2\). Now you want a constraint that says that \(c\) is the conjunction of \(c_1\) and \(c_2\), which is easy: \(c \le c_1, c \le c_2, c \ge c_1 + c_2  1\). answered 19 Apr '16, 15:53 Paul Rubin ♦♦ thank you so much for your help. I am sorry I find difficulty in understanding the notations. so c is my c or is c1 is my c? what does c1 and c2 stands for? my r and m are not integers May I kindly ask you to put it in my notations so I can understand the solution. thank you again so much
(19 Apr '16, 16:17)
nardinebasta
Your \(c\) is \(c_1\) AND \(c_2\). \(c_1\) indicates whether \(r = m\); \(c_2\) indicates whether \(m > 0\) (more precisely, whether \(m \ge \epsilon\)).
(19 Apr '16, 16:35)
Paul Rubin ♦♦
Hello, a problem popped up with some data after applying the above constraints. in some cases my maximum variable is altered to have the value of 100 while in fact it should not be 100. m= max(y) y is a vector of doubles in [0,100] i am calculating the max through the following constraint m>=y(i) "the actual constraints looks as follows maximumAttraction(v,t) >= SocialAttrPerLoc(v,e,t)" what might be the reason?
(13 Jul '16, 00:24)
nardinebasta
If neither the constraints nor the objective function apply pressure on \(m\) to be as small as possible, and particularly if the objective function rewards larger values of \(m\), the model will be free (and perhaps encouraged) to overstate \(m\). In such a case, you need to use binary variables (the number of binaries equaling the dimension of \(y\)) to enforce that \(m\) actually equals the maximum.
(13 Jul '16, 14:46)
Paul Rubin ♦♦

it seems that my constraints are not reliable, as with some data i receive the message that the model is not reliable. also with some data the variable are given values so that r has the minimum values they could have! I will be thankful to now what is wrong with my constraints i am using the following set of constrains to manage the maximum where m is the maximum and z3 is a binary where r in[0,100]:
i am using the following constrains to manage if(r=m)c1=1 else c1 =0, where z1,z2 are binaries r in[0,100] and m is the maximum.
to manage that if(m=0)c2=0 (with this i mean if r = m c should be 1 however if m =r=0, c should be zero)
to manage the conjunction of c1 and c 2
to manage that i have only one chosen location c per vehicle v i added:
my objective function is to maximize the following:
the variable to optimize are in the calculation of r(v,e,t)values. many thanks answered 14 Jul '16, 23:19 nardinebasta Just to be clear, when you write a constraint such as \(9c(v,e,t) \le c1(v,3,6)\), are you subtracting something from 9 on the left side, or is \(9\) just an equation number (in which case I would strongly urge you not to number things in such a confusing way in the future)?
(23 Jul '16, 13:52)
Paul Rubin ♦♦
This is the equation number. I will put this in mind when posting. My apologies
(23 Jul '16, 15:21)
nardinebasta

Presumably \(r\), \(m\) and \(c\) are all variables in an optimization model. Are \(r\) and \(m\) continuous, general integer or binary?
yes they are all variables. c is binary {0,1} r and m are in [0,inf) theoretically but technically the upper bound won't exceed 100.
r stands for a set of attraction values, m is the maximum value, the statement is trying to replace the argmax by finding the element(s) that has the maximum value.
Thank you :)