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


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

Re: A problem with Maximize/Minimize

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: A problem with Maximize/Minimize
Date 2011-06-17 09:52 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <itf85j$23j$1@smc.vnet.net> (permalink)
References <201106170409.AAA28843@smc.vnet.net>

Show all headers | View raw


Yeah, that's definitely a bug. The Integer program gets a correct {x, y,  
z} but the wrong objective value:

problem =
   max[{30 x + 20 y + 15 z, x >= 0, y >= 0, z >= 0,
     7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}];
problem /. Last[problem /. max -> Maximize]

max[{450, True, True, True, True, True}, {10, 0, 10}]

problem =
   max[{30 x + 20 y + 15 z, x >= 0, y >= 0, z >= 0,
     7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}, Integers];
problem /. Last[problem /. max -> Maximize]

max[{450, True, True, True, True, True}, {10, 0, 10}, Integers]

Bobby

On Thu, 16 Jun 2011 23:09:34 -0500, Gary Wardall <gwardall@gmail.com>  
wrote:

> A problem with Maximize/Minimize:
>
> Clear[x, y, z]
>
> Maximize[{30 x + 20 y + 15 z, x >= 0, y >= 0, z >= 0,
>   7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}]
>
> {450, {x -> 10, y -> 0, z -> 10}}
>
> Maximize[{30 x + 20 y + 15 z, x >= 0, y >= 0, z >= 0,
>   7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}, Integers]
>
> {490, {x -> 10, y -> 0, z -> 10}}
>
> I think the problem is obvious or am I confused? I'm using Mathematica
> 8 on an Apple Power Book  10.5.6
>
> A similar problem exist with Minimize.
>
> Minimize[{-30 x - 20 y - 15 z, x >= 0, y >= 0, z >= 0,
>   7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}]
>
> {-450, {x -> 10, y -> 0, z -> 10}}
>
> Minimize[{-30 x - 20 y - 15 z, x >= 0, y >= 0, z >= 0,
>   7 x + 7 y + 3 z <= 100, 3 x + y + 2 z <= 50}, {x, y, z}, Integers]
>
> {-490, {x -> 10, y -> 0, z -> 10}}
>
>
> Gary Wardall
>


-- 
DrMajorBob@yahoo.com

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


Thread

Re: A problem with Maximize/Minimize DrMajorBob <btreat1@austin.rr.com> - 2011-06-17 09:52 +0000

csiph-web