python-mip
python-mip copied to clipboard
Status: "INT_INFEASIBLE" expected | Status: "INFEASIBLE" observed
Describe the bug According to the docs:
INT_INFEASIBLE = 4 A feasible solution exist for the relaxed linear program but not for the problem with existing integer variables
i would expect that after solving a problem which is LP-feasible and IP-infeasible:
- A: i receive status
INT_INFEASIBLE
- B: be able to call
objective_bound
to get the bound from the LP-relaxation- (not sure if that's to be expected; would help in my use-case as i would save one additional
relax=True
solve step)
- (not sure if that's to be expected; would help in my use-case as i would save one additional
Until now, i never saw INT_INFEASIBLE
, but every time observe INFEASIBLE
, even when the LP-relaxation is feasible.
To Reproduce Minimal example:
from mip import *
model = Model(sense=MINIMIZE, solver_name=CBC)
model.verbose = True
x = model.add_var(var_type=BINARY, obj=1.0)
model += 3 <= 10 * x
model += 10 * x <= 5
print('--------')
print('Solve IP')
status_ip = model.optimize()
print(' status: {}'.format(status_ip))
print('----------------')
print('Solve relaxed IP')
status_relaxed_ip = model.optimize(relax=True)
print(' status: {}'.format(status_relaxed_ip))
Output:
--------
Solve IP
Welcome to the CBC MILP Solver
Version: devel
Build Date: Nov 15 2020
Starting solution of the Linear programming relaxation problem using Primal Simplex
Coin0506I Presolve 0 (-2) rows, 0 (-1) columns and 0 (-2) elements
Clp0000I Optimal - objective value 0.3
Coin0511I After Postsolve, objective 0.3, infeasibilities - dual 0 (0), primal 0 (0)
Clp0032I Optimal objective 0.3 - 0 iterations time 0.002, Presolve 0.00, Idiot 0.00
Starting MIP optimization
Cgl0000I Cut generators found to be infeasible! (or unbounded)
Total time (CPU seconds): 0.00 (Wallclock seconds): 0.00
status: OptimizationStatus.INFEASIBLE
----------------
Solve relaxed IP
Clp0000I Optimal - objective value 0.3
status: OptimizationStatus.OPTIMAL
Desktop (please complete the following information):
- Operating System, version: Ubuntu 20.04.1 LTS
- Python version: Python 3.8.2 (default, Jul 16 2020, 14:00:26)
- Python-MIP version (we recommend you to test with the latest version): '1.13.0'