Adds native IIS support#79
Conversation
|
Oh, wow, why do these tests take 5 hours here? |
|
They shouldn't 😢 Seems like it's stuck in your |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #79 +/- ##
==========================================
+ Coverage 98.39% 98.42% +0.02%
==========================================
Files 14 14
Lines 1437 1527 +90
==========================================
+ Hits 1414 1503 +89
- Misses 23 24 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@odow would you review this? Do you want me to improve the coverage further? |
Yes please, we should always aim for 100% coverage. |
| function _analyze_native_iis(model::MOI.ModelLike, optimizer) | ||
| # Instantiate solver with bridges so that constraint types the solver | ||
| # doesn't natively support (e.g. Interval) are automatically transformed. | ||
| solver = MOI.instantiate(optimizer; with_bridge_type = Float64) |
There was a problem hiding this comment.
Hmm. Okay. Open question.
I had envisaged calling compute_conflict on model, but maybe this is okay.
There was a problem hiding this comment.
Should I new_model=JuMP.copy_model(model) and JuMP.set_optimizer(new_model, optimizer)?
There was a problem hiding this comment.
I meant
function _analyze_native_iis(model::MOI.ModelLike)
MOI.compute_conflict!(model)
# do stuff...
endThere was a problem hiding this comment.
But this is also okay. I'm still not super happy with the Infeasibility module. It's an open question what the best approach is from a user's perspective.
There was a problem hiding this comment.
If it's just looking for an IIS, there's already copy_conflict at the JuMP level: https://jump.dev/JuMP.jl/stable/api/JuMP/#copy_conflict
There was a problem hiding this comment.
I kinda see IIS being orthogonal to MathOptAnalyzer. We have MathOptIIS for packages that want to add an IIS (like HiGHS.jl does now).
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
|
Wuhu, green! |
| index_map = MOI.copy_to(solver, model) | ||
| reverse_map = _reverse_index_map(index_map) | ||
|
|
||
| MOI.optimize!(solver) # make sure model is infeasible |
There was a problem hiding this comment.
Should we remove that? It can be very costly.
There was a problem hiding this comment.
Why is it here? HiGHS.jl implements compute_conflict! but via MathOptIIS, which stalls on a feasible model. Maybe other solvers do too.
There was a problem hiding this comment.
I think most solvers need an infeasible model before they call compute_conflict!. We need to call optimize! here because we instantiated the new solver.
|
@odow can you have a look again? |
It is
try-catchbased.Adds option
native_iis::Bool = falseto opt-out of this. Should the default betrue?There is a test with
HiGHSwith hascompute_conflict!implemented.Closes #63