# Revision history [back]

I'm not entirely sure what you are looking for due to the vagueness of your question, but here is a response that might help.

One way to encode a linear programming problem is:

p=MixedIntegerLinearProgram()
x=p.new_variable()
p.set_objective(x[0]+2*x[1])


To display the objective function and constraints, use:

p.show()


To solve the LP problem, use:

p.solve()
p.get_values(x)


To display the feasible region in the 2d case, use:

p.polyhedron().show()


You can also enter the LP constraints using a matrix formulation as follows:

A=matrix([[-3,1],[0,1],[1,-1],[1,0]])
b=vector([2,11,3,6])
p=MixedIntegerLinearProgram()
x=p.new_variable()
p.set_objective(x[0]+2*x[1])