Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing `Model.sense` makes (feasible) relaxation infeasible

See original GitHub issue

Issue Description

I am trying to determine whether the feasibility region of an MIP-relaxation is bounded or not. To do that, I pick a random objective and both minimize and maximize it, checking whether one of the problems is unbounded. Unfortunately, python-mip tells me during minimization that an optimal solution has been found, during maximization it tells me that the problem is infeasible. I’m not sure why that would be the case. Is this a bug or is this somehow expected behavior?

To reproduce

I can reproduce this problem with instances from MIPLIB, e.g. dano3mip:

# `model` is an MIP from MIPLIB, with the original objective etc.
status_min = model.optimize(relax=True) # OptimizationStatus.OPTIMAL
model.sense = mip.MAXIMIZE
status_max = model.optimize(relax=True) # OptimizationStatus.INFEASIBLE

I am happy to provide a complete minimal working example if that should be necessary.

System info

I am running:

  • Ubuntu 20.04.4 LTS
  • python 3.8.10
  • python-mip 1.13.0

Issue Analytics

  • State:open
  • Created 8 months ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

odowcommented, Jul 4, 2022

I know the answer to this, because it has bitten me before. This is the problem: For LPs isProvenInfeasible can mean dual infeasible.

Here’s what we do in Cbc.jl:

Markus28commented, Jun 30, 2022

I don’t know whether the maximization problem is actually unbounded, that’s what I want to find out (it might also be optimal, which occurs for some MIPLIB instances). But maximization being infeasible while minimization is optimal makes no sense.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infeasibility, Unboundedness and Instability - FICO
Discrete or integer infeasibility is where a MIP problem has a feasible relaxation (a relaxation of a MIP is the problem we get...
Read more >
14.2 Automatic Repair of Infeasible Problems - Mosek
MOSEK provides an automatic repair tool for infeasible linear problems which we cover in this section. Note that most infeasible models are so...
Read more >
Identifying infeasibility constraint and relaxing/removing it in ...
If the linear relaxation is feasible, then deactivate each constraint once. Frequently you find some obvious constraints being infeasible, such ...
Read more >
Constraint Relaxation - Gurobi Support Portal
If the model turns out infeasible then I want Gurobi to change the RHS of Con1 for feasibility. However RHS of Con2 can't...
Read more >
Gurobi finishes with 'infeasible' although optimal solution exists
I tried enforcing these values by adding them as additional equality constraints, but this still leaves the model infeasible without relaxation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found