Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Re: A problem with Maximize/Minimize

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119700] Re: A problem with Maximize/Minimize
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Fri, 17 Jun 2011 05:52:58 -0400 (EDT)
  • References: <201106170409.AAA28843@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

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


  • Prev by Date: Re: capacitor equation solution not working
  • Next by Date: Re: How to Do a Replacement with Two Conditions
  • Previous by thread: A problem with Maximize/Minimize
  • Next by thread: Re: A problem with Maximize/Minimize