Page 1 sur 1

simplex_reduce

Publié : mer. août 07, 2013 3:06 pm
par Harrie Hendriks
simplex_reduce is a useful command.
Unfortunately there is a bug in it, if not more.
Maximize x+y
subject to
x+y+z <= 3
x,y,z >= 0
yields the solution
x=3,y=3,z=0
but then x+y+z=3+3+0=6 > 3.
See
simplex_reduce([[1,1,1]],[3],[1,1,0]);

The problem seems to be that the code does not know how to handle the two
"vertex" solutions {x=3,y=0,z=0} and {x=0,y=3,z=0}.

Re: simplex_reduce

Publié : ven. août 09, 2013 7:20 pm
par parisse
The optimum returned is 3, it is correct, the solution returned is bugged because it's a degenerated problem, there are in fact infinitely many solutions on the segment joining (3,0,0) to (0,3,0). I don't know if I can easily fix that... you can get a correct solution as soon as you modify a little bit one coefficient e.g.
simplex_reduce([[1,1,1]],[3],[1,1.0001,0]);
or
simplex_reduce([[1,1,1]],[3],[1.0001,1,0]);