MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: LinearProgramming[]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123525] Re: LinearProgramming[]
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Sat, 10 Dec 2011 07:28:21 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201112091058.FAA03920@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

> 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 at 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 at yahoo.com



  • Prev by Date: Re: NDSolve[]
  • Next by Date: Re: NDSolve[]
  • Previous by thread: LinearProgramming[]
  • Next by thread: Re: LinearProgramming[]