MathGroup Archive 2009

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

Search the Archive

Re: bug in LinearProgramming

  • To: mathgroup at smc.vnet.net
  • Subject: [mg95545] Re: [mg95487] bug in LinearProgramming
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Wed, 21 Jan 2009 06:46:12 -0500 (EST)
  • References: <200901201044.FAA16664@smc.vnet.net>
  • Reply-to: drmajorbob at longhorns.com

I get the same result as you (in version 7) and it doesn't look right to  
me!

Bobby

On Tue, 20 Jan 2009 04:44:23 -0600, Veit Elser <ve10 at cornell.edu> wrote:

> This is a re-post because the original did not draw any comments.
> The data
> c = {1, 1};
> m = {{1, 0}, {1, -2}, {-1, 1}};
> b = {{1, 0}, {0, 1}, {0, 1}};
> lu = {{0, 1}, {0, 1}};
> d = {Reals, Reals};
> used in
> LinearProgramming[c, m, b, lu, d]
> corresponds to the problem
> minimize x1+x2
> subject to the constraints
> x1 == 1, x1-2*x2 >= 0, -x1+x2 >= 0
> with real variables in the ranges
> 0 <= x1 <= 1, 0 <= x2 <= 1
> It's clear that this problem has no solution, and Mathematica
> recognizes this fact.
> But when the domain of x2 is changed to Integers, Mathematica returns
> the "solution"
> x1 == 1., x2 == 1
> This violates the constraint x1-2*x2 >= 0.
>
> **** earlier posting ****
> Here is a simple linear programming problem:
>
> c = {1, 1};
> m = {{1, 0}, {1, -2}, {-1, 1}};
> b = {{1, 0}, {0, 1}, {0, 1}};
> lu = {{0, 1}, {0, 1}};
> d = {Reals, Reals};
>
> sol = LinearProgramming[c, m, b, lu, d]
>
> Mathematica 6 returns:
>
> LinearProgramming::"lpsnf" :  "No solution can be found that
> satisfies the constraints."
>
> which is obviously correct. But if I change the domain of the second
> variable,
>
> d = {Reals, Integers};
>
> then Mathematica gives the solution
>
> sol = {1., 1}. The problem is that
>
> m.sol = {1., -1., 0.}
>
> violates the bound vector b (second component should be greater than 0).
> Is there a bug, or am I getting the syntax wrong?
>
> Veit Elser
>



-- 
DrMajorBob at longhorns.com


  • Prev by Date: Re: Fitting problem
  • Next by Date: Re: Re: Multiple PDF Pages using Export
  • Previous by thread: bug in LinearProgramming
  • Next by thread: Re: bug in LinearProgramming