Re: LinearProgramming[]
- To: mathgroup at smc.vnet.net
- Subject: [mg123551] Re: LinearProgramming[]
- From: Virgil Stokes <vs at it.uu.se>
- Date: Sun, 11 Dec 2011 03:45:45 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201112101226.HAA19172@smc.vnet.net>
On 10-Dec-2011 13:26, é?? å?? wrote: > We know all constraints in LinearProgramming[] involve ">=" or "<=". > > How can I solve the following problem with LinearProgramming[]: > > Assuming x+2y-z>0,x+y-z>=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 :-)
- References:
- LinearProgramming[]
- From: é å <shlwell1988@gmail.com>
- LinearProgramming[]