coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
527 stars 92 forks source link

Model without constraints + upper bounds #65

Closed pmla closed 4 years ago

pmla commented 4 years ago

This is a valid MIP model that doesn't work with python-mip:

ub = 14  # any positive integer
m = Model("upper_bounds")
x = m.add_var(var_type=INTEGER, ub=ub)
m.objective = maximize(x)
m.optimize()
assert m.status == OptimizationStatus.OPTIMAL
assert round(m.objective_value) == ub

It fails on two levels:

pmla commented 4 years ago

This works now. I think I was not running on the current master. Sorry! I have added a test for it in #67