Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict report #276

Merged
merged 8 commits into from
Sep 9, 2023
Merged

Conflict report #276

merged 8 commits into from
Sep 9, 2023

Conversation

matbesancon
Copy link
Member

Adding support for a conflict report based on solving an auxiliary problem with superindicators

@matbesancon
Copy link
Member Author

@odow I didn't see any supports added on Gurobi, this isn't necessary to trigger tests for conflicts?

@matbesancon
Copy link
Member Author

@pfetsch for information. I had to use a bit of a weird hack to get the violations by the names generated for the binary variables, but that should work

@odow
Copy link
Contributor

odow commented Sep 7, 2023

The conflict tests have a check for if they can get ConflictStatus and skip if not:
https://github.com/jump-dev/MathOptInterface.jl/blob/fdf2559261a0697196f7758f78048952c9ffac09/src/Test/test_solve.jl#L902-L908

# we need names for all constraints
for (F, S) in MOI.get(o, MOI.ListOfConstraintTypesPresent())
for (idx, c_index) in enumerate(MOI.get(o, MOI.ListOfConstraintIndices{F,S}()))
if MOI.get(o, MOI.ConstraintName(), c_index) == ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work for VariableIndex constraints

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are currently excluded, because SCIP treats these as variable information and not as constraints, will need further adaptation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adapted the code to convert all variable constraints to scalar affine functions to be able to compute their infeasibility too

end
end
end
success = Ref{LibSCIP.SCIP_Bool}(333)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 333? Perhaps SCIP.FALSE?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this was as a flag value to indicate that it hasn't been touched

@pfetsch
Copy link

pfetsch commented Sep 8, 2023

@pfetsch for information. I had to use a bit of a weird hack to get the violations by the names generated for the binary variables, but that should work

Yes, cons_indicator is using such hacks as well. I suppose that they cannot always be avoided.

@matbesancon
Copy link
Member Author

indeed. The last thing holding this back is that the superindicator transformation is not handling bound constraints if I understand the logic correctly.
@svigerske suggested adding varbound constraints for these to also be able to analyze which ones contribute to the infeasibility

@matbesancon
Copy link
Member Author

okay thinking about it a bit more, the definition of the SCIP subset of constraints and the minimal subsystem of MOI diverge:

Computes a minimal subset of constraints such that the model with the other constraint removed is still infeasible.

while SCIP provides a set of constraints which had to be relaxed to obtain a feasible solution

@matbesancon
Copy link
Member Author

So if K constraints are in conflict and removing any of them resolves it, only one of them will be reported as infeasible by SCIP

@odow
Copy link
Contributor

odow commented Sep 8, 2023

MOI's compute_conflict is really a synonym for Irreducible Infeasible Subsystem (IIS). It sounds like SCIP doesn't compute an IIS, so I don't know if it's appropriate to wrap this part of the MOI API.

@matbesancon
Copy link
Member Author

Indeed, the definitions diverge too much. There could be a way to compute an IIS by gradually re-imposing the constraints, but this will be for another time.

@svigerske
Copy link
Member

When you look for a point that minimizes a measurement on the infeasibility (max/sum/number), then this is usually called feasibility relaxation (CPLEX feasopt, COPT feasrelax).

@matbesancon
Copy link
Member Author

that's true it might be a better name

@matbesancon matbesancon merged commit a6b1462 into master Sep 9, 2023
8 checks passed
@matbesancon matbesancon deleted the conflict branch September 9, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants