Professional Documents
Culture Documents
Question 3
Question 3
m = gp.Model()
m.setObjective(objective, gp.GRB.MINIMIZE)
# Capacity constraints
# Demand constraints
# Non-negativity constraints
m.optimize()
if m.status == gp.GRB.Status.OPTIMAL:
for i in range(2):
for j in range(4):
x[0, 2] = 3.0
x[0, 3] = 1.0
x[1, 0] = 2.0
x[1, 1] = 1.0
x[1, 2] = 1.0
x[1, 3] = 2.0
This is the optimal solution to the IP problem, which minimizes the total cost of
meeting the demands of the four customers at a total cost of 23.