Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7076

Re: LinearProgramming[]

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: LinearProgramming[]
Date 2011-12-10 12:33 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jbvjjd$j0a$1@smc.vnet.net> (permalink)
References <201112091058.FAA03920@smc.vnet.net>

Show all headers | View raw


> We know all constraints in LinearProgramming[] involve ">=" or "<=".

No, == is also allowed.

Here are three possibilities, using Solve. (Solve converts to a  
matrix-based LP problem so we don't have to.)

Minimize[{2 x + 3 y + 4 z, x + 2 y - z >= 0, x + y - z >= 60,
   y + 2 z >= 12, x >= 0, y >= 0 , z >= 1}, {x, y, z}]

{136, {x -> 51, y -> 10, z -> 1}}

or

Minimize[{2 x + 3 y + 4 z, x + 2 y - z > 0, x + y - z > 60,
   y + 2 z > 12, x > 0, y > 0 , z > 1}, {x, y, z}, Integers]

{143, {x -> 54, y -> 9, z -> 2}}

or

g = 1/10; (* granularity *)
Minimize[{g (2 x + 3 y + 4 z),
   g (x + 2 y - z) > 0, g (x + y - z) > 60, g (y + 2 z) > 12, x > 0,
   y > 0 , g z > 1}, {x, y, z}, Integers]
{N@First@%, g {x, y, z} /. Last@% // N}

{1367/10, {x -> 513, y -> 99, z -> 11}}

{136.7, {51.3, 9.9, 1.1}}

The first version cannot use > or < constraints, because minimums exist  
only on the boundaries.

Bobby

On Fri, 09 Dec 2011 04:58:02 -0600, 道 厚 <shlwell1988@gmail.com> 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.
>


-- 
DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: LinearProgramming[] DrMajorBob <btreat1@austin.rr.com> - 2011-12-10 12:33 +0000

csiph-web