discrete optimization using pulp

62 Views Asked by At
prob = pulp.LpProblem('C and T', pulp.LpMaximize)
C = pulp.LpVariable("C", lowBound = 0, cat = pulp.LpInteger )
T = pulp.LpVariable('T', lowBound = 0, cat = pulp.LpInteger)
prob += 25*T + 10*C
prob += 5*T + 2 *C <= 30
prob += C >= 3*T 
prob.solve()

After solving this optimization I want to see the variables' value. what is the command for this?

1

There are 1 best solutions below

0
Erwin Kalvelagen On
print(f"C={C.value()},T={T.value()}")