We have a continuous variable:
u = m.addVars(items, vtype=GRB.CONTINUOUS, name ="U")
#Weights of the items
And we want to maximize this difference:
mayorU = max_(u)
menorU = min_(u)
m.setObjective(mayorU - menorU, GRB.MAXIMIZE)
This works. But, is the objective function non-linear? Could it be rewritten to be linear?
Please sign in to leave a comment.