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