Professional Documents
Culture Documents
Simplex Method
Simplex Method
==================
The file SIMPLEX.MTH contains functions that perform the minimization and
maximization of linear functions, under linear constraints:
MINIMIZE(C(x),[u1(x),...,um(x)])
--> [minC,x=xmin,v]
MAXIMIZE(C(x),[u1(x),...,um(x)])
--> [maxC,x=xmax,v]
One can inspect the simplex tables (preceded by the row and column of the pivot),
which are contained in the variable simplextable, generated after each call to
MINIMIZE or MAXIMIZE. The generation of these tables is omitted if simplextables is
set to hold a nonvector value (for example simplextable:= ). Use the assignment
simplextables:=[]
if you are interested in such intermediate results, because by default
simplextables is not assigned and the tables are not generated.
or,
SIMPLEXCALL([0,1,-2;1,1,1;1,-2,1;1,-2,0],1,2,1,[5,1,7,1],[1,1,0,-10])
(note the order of the constraints!)
In the first case one obtains [11, x=1 AND y=0 AND z=6, [17, 6, 0, 0]], and in the
second one the result is [11, [1, 0, 6], [17, 6, 0, 0]], meaning that the minimum
is 11 and it is obtained for x=1, y=0, z=6; the rest of the values (17,6,0,0)
correspond to the so called "artificial variables" which are associated to each
constraint.
When working in approximate mode, the variable eps_ (which is by default 0) can be
set to a (small) positive value; in this case all the entries in the simplex tables
which are in absolute value less or equal to eps_ are set to 0.
eps_ should be modified only with great care!
For other examples, please load and run the demo file SIMPLEX.DMO.