Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7076 > unrolled thread
| Started by | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| First post | 2011-12-10 12:33 +0000 |
| Last post | 2011-12-10 12:33 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: LinearProgramming[] DrMajorBob <btreat1@austin.rr.com> - 2011-12-10 12:33 +0000
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Date | 2011-12-10 12:33 +0000 |
| Subject | Re: LinearProgramming[] |
| Message-ID | <jbvjjd$j0a$1@smc.vnet.net> |
> 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 top | Article view | comp.soft-sys.math.mathematica
csiph-web