Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: LinearProgramming[]
Replies: 1   Last Post: Dec 11, 2011 3:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Virgil Stokes

Posts: 77
Registered: 3/16/06
Re: LinearProgramming[]
Posted: Dec 11, 2011 3:24 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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 :-)




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.