
Re: LinearProgramming[]
Posted:
Dec 11, 2011 3:24 AM


On 10Dec2011 13:26, é å wrote: > We know all constraints in LinearProgramming[] involve ">=" or "<=". > > How can I solve the following problem with LinearProgramming[]: > > Assuming x+2yz>0,x+yz>=60,y+2z>12,x>0,y>0 and z>1 > > we want to get the minimum of 2x+3y+4z in the abrove constraints. > > Note that there are ">" other than">=" in the constraints we have > given. > IMHO the following kluge solves your problem (finds the minimum of your objective function and satisfies all of your constraints) using LinearProgramming,
epsilon = 1/10^20; (* fudge factor *) m = {{1, 2, 1}, {1, 1, 1}, {0, 1, 2}}; b = {epsilon, 60, 12 + epsilon}; s = {1, 1, 1}; c = {2, 3, 4}; bs = Transpose[{b, s}]; dv = LinearProgramming[c, m, bs, {epsilon, epsilon, 1 + epsilon}] N[%, 24] (* Value of objective function *) c.dv N[%, 24] (* Check that the constraint equations are satisfied *) m[[1]].dv > 0 m[[2]].dv >= 60 m[[3]].dv > 12 (* Check that the decision variables are in range *) dv[[1]] > 0 dv[[2]] > 0 dv[[3]] > 1
Note, Mathematica 8.0.4.0 was used and I apologize for the lack of elegance :)

