Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The documentation shows many examples with two variables, but in fact there is no restriction on the number of variables or constraints. Example with three variables and three constraints:

A = ([1, 1, 0], [3, 1, 0], [0, 0, 1])
b = (1000, 1500, 20)
c = (10, 5, 1)
P = InteractiveLPProblem(A, b, c, ["C", "B", "A"], variable_type=">=")
show(P)
P = P.standard_form()
P.run_simplex_method()

Three variables and two constraints:

A = ([1, 1, 0], [3, 1, 0])
b = (1000, 1500)
c = (10, 5, 1)
P = InteractiveLPProblem(A, b, c, ["C", "B", "A"], variable_type=">=")
show(P)
P = P.standard_form()
P.run_simplex_method()

Etc.