Re: [R] lpSolve: how to allow variables to become negative

2009-07-02 Thread Rob Helpert
Sorry. Of course, I meant the DIFFERENCE of two non-negative variables. So, for example, write b1 = b1p - b1n, where both b1p and b1n are non-negative. On Thu, Jul 2, 2009 at 4:18 PM, Rob Helpert wrote: > Hi Alicia, > > I think the trick may be to split b1 into the sum of two non-negative > varia

Re: [R] lpSolve: how to allow variables to become negative

2009-07-02 Thread Rob Helpert
Hi Alicia, I think the trick may be to split b1 into the sum of two non-negative variables. You will then also have to alter your constraints and objective to include the two new variables with negative values in appropriate places, but I believe that this will solve the problem. On Thu, Jul 2,

[R] lpSolve: how to allow variables to become negative

2009-07-02 Thread Alicia Perez-alonso
Dear all, I am interested in solving a MIP problem with binary outcomes and continuous variables, which ARE NOT RESTRICTED TO BE NEGATIVE. In particular, Max {z1,z2,z3,b1} z1 + z2 + z3 (s.t.) # 7 z1 + 0 z2 + 0 z3 + b1 <= 5 # 0 z1 + 8 z2 + 0 z3 - b1 <= 5 # 0 z1 + 0 z2 + 6 z3 + b1 <=