Example 1 from web page
max z = x1 +4x2
such that x1 +2x2 <= 5
-2x1 -x2 >= -5
x1, x2 >= 0 .
lets say
1 -1 -4 = 0
-1 -2 5 => 0
-2 -1 5 => 0
or x1 x2 z s1 s2 COST
1 4 -1 = 0
1 2 1 = 5
2 1 1 = 5
is now assumed the proper setup
1.00 4.00 -1.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00
1.00 2.00 0.00 1.00 0.00 5.00 0.00 1.00 0.00 0.00 0.00 0.00
2.00 1.00 0.00 0.00 1.00 5.00 0.00 0.00 1.00 0.00 0.00 0.00
0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 1.00 0.00 0.00
0.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 1.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1.00
for solution
1.00 0.00 0.00 0.00 0.00 1.67 0.00 -0.33 0.67 0.33 -0.67 -1.67
0.00 1.00 0.00 0.00 0.00 1.67 0.00 0.67 -0.33 -0.67 0.33 -1.67
0.00 0.00 1.00 0.00 0.00 8.33 -1.00 2.33 -0.67 -2.33 0.67 -8.33
0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 1.00 0.00 0.00
0.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 1.00 0.00
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1.00
x1 = 1.67, x2 = 1.67, max z = 8.33
so lets check
max z = x1 +4x2 = 1.67 + 4 * 1.67 = 5 * 1.67 = 8.35
such that x1 +2x2 <= 5 or 3 * 1.67 = 5.01 <= 5 ok?
-2x1 -x2 >= -5 or -3 * 1.67 = -5.01 => -5 ok?
x1, x2 >= 0 ok
This does not look as good as a trial by error, with a little
help from these results, that x1 = 1 and x2 =2 might do a better
job. z = 1+8 = 9, 1+4 = 5, -2-2 = -4 > -5
Looks like the solution. Changing some internal code from integer
to floating point still did not change the results.
Further use and validation is required.