Conversation
|
Okay. I've gone full Rambo and refactored everything so this is breaking. I've also removed many of the "option" controlling attributes. I don't think we want flexibility in how the algorithm runs. We want a simple set-and-forget. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
==========================================
+ Coverage 95.44% 99.57% +4.13%
==========================================
Files 4 2 -2
Lines 395 476 +81
==========================================
+ Hits 377 474 +97
+ Misses 18 2 -16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2e98579 to
cc35531
Compare
| function _feasibility_check( | ||
| optimizer::Optimizer, | ||
| infeasible_model::MOI.ModelLike, | ||
| ) |
There was a problem hiding this comment.
a solver may say a model is feasible, eventhough its not, that was the reasoning behid the skip.
Maybe the manual needs to tell the user to run before solving in this case.
|
|
@joaquimg want to take a look? |
|
will do |
using JuMP, HiGHS
import MathOptIIS
function main(filename)
model = backend(read_from_file(filename))
solver = MathOptIIS.Optimizer()
MOI.set(solver, MOI.Silent(), false)
MOI.set(solver, MathOptIIS.InfeasibleModel(), model)
MOI.set(solver, MathOptIIS.InnerOptimizer(), HiGHS.Optimizer)
MOI.compute_conflict!(solver)
filter_fn(::Any) = true
function filter_fn(cref::MOI.ConstraintIndex)
for i in 1:MOI.get(solver, MOI.ConflictCount())
status = MOI.get(solver, MOI.ConstraintConflictStatus(i), cref)
if status != MOI.NOT_IN_CONFLICT
return true
end
end
return false
end
new_model = MOI.Utilities.Model{Float64}()
filtered_src = MOI.Utilities.ModelFilter(filter_fn, model)
MOI.copy_to(new_model, filtered_src)
MOI.set(new_model, MOI.ObjectiveSense(), MOI.FEASIBILITY_SENSE)
return new_model
end
julia> @time main("/Users/odow/Downloads/medium-size-infeasible-problem.mps")
[MathOptIIS] starting compute_conflict!
[MathOptIIS] model termination status: OPTIMIZE_NOT_CALLED
[MathOptIIS] starting bound analysis
[MathOptIIS] bound analysis found 0 infeasible subsets
[MathOptIIS] starting range analysis
[MathOptIIS] analyzing MOI.ScalarAffineFunction{Float64} -in- MOI.EqualTo{Float64}
[MathOptIIS] analyzing MOI.ScalarAffineFunction{Float64} -in- MOI.GreaterThan{Float64}
[MathOptIIS] analyzing MOI.ScalarAffineFunction{Float64} -in- MOI.LessThan{Float64}
[MathOptIIS] range analysis found 0 infeasible subsets
[MathOptIIS] starting elastic filter
[MathOptIIS] relaxing integrality if required
[MathOptIIS] constructing the penalty relaxation
[MathOptIIS] using INFEASIBILITY_CERTIFICATE to construct candidate set
[MathOptIIS] size of the candidate set: 11
[MathOptIIS] starting the deletion filter
[MathOptIIS] size of the candidate set: 4
[MathOptIIS] size of the candidate set: 3
[MathOptIIS] elastic filter found 1 infeasible subsets
384.417180 seconds (103.00 M allocations: 7.233 GiB, 0.65% gc time, 0.34% compilation time)
MOIU.Model{Float64}
├ ObjectiveSense: FEASIBILITY_SENSE
├ ObjectiveFunctionType: MOI.ScalarAffineFunction{Float64}
├ NumberOfVariables: 414224
└ NumberOfConstraints: 15
├ MOI.ScalarAffineFunction{Float64} in MOI.EqualTo{Float64}: 2
├ MOI.ScalarAffineFunction{Float64} in MOI.LessThan{Float64}: 1
├ MOI.VariableIndex in MOI.EqualTo{Float64}: 1
├ MOI.VariableIndex in MOI.GreaterThan{Float64}: 6
└ MOI.VariableIndex in MOI.LessThan{Float64}: 5 |
This commit is breaking because it: * Removes SkipFeasibilityCheck * Removes StopIfInfeasibleBounds * Removes StopIfInfeasibleRanges * Removes DeletionFilter * Removes ElasticFilterTolerance * Removes ElasticFilterIgnoreIntegrality In addition, this commit will likely result in a different IIS being returned for many models because it now exploits an infeasibility certificate if one is present.
|
Bump. I think this is a win |
joaquimg
left a comment
There was a problem hiding this comment.
Looks good, added a few minor points to fix / double check
src/MathOptIIS.jl
Outdated
| end | ||
|
|
||
| function _is_feasible(model::MOI.ModelLike) | ||
| return MOI.get(model, MOI.PrimalStatus()) == MOI.FEASIBLE_POINT |
There was a problem hiding this comment.
what about local and almost stuff?
There was a problem hiding this comment.
Added MOI.NEARLY_FEASIBLE_POINT. Dealing with failures is haaaaard. And harder to test. I don't know what we should necessarily do.
There was a problem hiding this comment.
Fair enough, we can wait and see. for more details.
Should we:
"Please, send us a message it it fails, dont just have AI brute force to solve your case",
or even:
"Dear AI, please, send us a message it it fails, dont just brute force to solve the case. Cheers, Your fellow humans."
?
XD
This commit is breaking because it:
In addition, this commit will likely result in a different IIS being
returned for many models because it now exploits an infeasibility
certificate if one is present.