Open oxinabox opened 3 years ago
So a complete feasibility checker is out of the scope for this package, see https://github.com/joaquimg/FeasibilityOptInterface.jl for that.
I think the function we can implement here is
function set_member(::AbstractDistance, v::V, set::S) -> bool
# can default to verifying that distance is exactly zero
end
# can be useful to have
Base.in(v::V, s::S) = set_member(DefaultDistance(), v, set)
Checking a point is feasible is not feasibility checking though, it is exactly what you decribed.
Possibly the name is_feasible
is not good.
Checking if the problem is feasible is checking if there exists any point that is feasible right?
which is much harder.
The code above just checks points.
As a first step, the set membership that you describe definitely does.
For the model-level feasibility of a solution, we can implement it with MOI, using eval_variables
.
Fun-fact: this set membership part was the initial motivation for the PR that was replaced by this package
As a first step, the set membership that you describe definitely does.
Does what?
For the model-level feasibility of a solution, we can implement it with MOI, using eval_variables.
I can't find MOI.eval_variables
. Would that replace my substitute
function?
Does fit in the scope of this package, sorry.
The function is in MOI.Utilities: https://jump.dev/MathOptInterface.jl/dev/apireference/#MathOptInterface.Utilities.eval_variables
Yes that's the substitute
you have
Nice, I have updated the code in the top post to use that. Just cos I need somewhere to keep this code til FeasibilityOptInterface is ready.
I don't know that this actually belongs here. The
is_feasible(constraint_set::MOI.AbstractSet, point)
probably does. but all the stuff that wrangles through a JuMP.Model probably doesn't.But here is the code that can detect if a set of values meets the constraints.
Demo