In [1]:
import pulp
In [2]:
z = pulp.LpProblem('problem x', pulp.LpMaximize)
x1 = pulp.LpVariable('x1', lowBound=0)
x2 = pulp.LpVariable('x2', lowBound=0)
In [3]:
z += 5*x1 + 4*x2
In [4]:
z += 1*x1 + 1*x2 <= 5
z += 10*x1 + 6*x2 <= 45
In [5]:
z
Out[5]:
In [6]:
pulp.LpStatus[z.solve()]
Out[6]:
In [7]:
pulp.value(x1), pulp.value(x1), pulp.value(z.objective)
Out[7]: