when set constraint, code
m.addconstr(binary_var.prod(cost_con) <= budget[k])
binary_var
variable name, cost_con
coefficients of variables. constraint linear expression,
cost_con[0]*binary_var[0]+cost_con[1]*binary_var[1]+cost_con[2]*binary_var[2]+....
here problem. since number of variables large, 5000. code binary_var.prod(cost_con)
costs lot of time. please tell me if have better solutions decrease running time?
thanks
Comments
Post a Comment