-
Notifications
You must be signed in to change notification settings - Fork 98
Add complementarity constraints #913
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #913 +/- ##
==========================================
+ Coverage 95.2% 95.27% +0.07%
==========================================
Files 82 83 +1
Lines 8751 9059 +308
==========================================
+ Hits 8331 8631 +300
- Misses 420 428 +8
Continue to review full report at Codecov.
|
frapac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @odow for adding this in MOI!
|
If at some point we define
In MOI, we don't currently have a set for which the type is a special case of the type of another one so I think 1. would make more sense. |
|
Note that our definition of complements isn't
Sure we do: |
|
Really, there is nothing stopping us from interpreting the current The current definition is just a relation between |
Bridging currently assume that we can treat each constraint independently so it will be easy to bridge I prefer |
Sure. I envisaged a one-way Since we have two solvers that currently support |
|
We also need to add it to |
|
Before merging, we should wait for @xhub to sign-off. |
Once complementarity constraints defined inside Knitro, the solver forces the lower-bounds of the variables to be equal to 0. |
So Knitro.jl will throw an error of the variable lower are nonzero and if the upper bound is not +infinity ? |
|
If the variable LB is lower than 0, no error is returned (Knitro should set automatically the lower bound equal to 0, but it appears that the control checks have been updated). If the variable LB is greater than 0, then Knitro returns: |
* Test: add QP complementarity test * Add Mock test for QP complementarity test * Fix with comments in PR#918
xhub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review. That looks very good. I just had a few suggestions about the wording in the doc.
|
I am not sure I followed the discussion of One just has to see how to educate the user about the need to specify the set |
|
@odow Thanks for making the changes. I am really happy with @blegat I am not sure what I was thinking of a case where the user does the following in a variational inequality problem definition @constraint(model, [A*x + b; x] in MOI.VariationalInequalities(H, k, MOI.Nonnegatives))
@constraint(model, x[2] >= 5)Then, the full definition of |
It should be |
Yeah, it's easier to change to be more general later on. |
This PR adds the set
Complements(dimension)which defines a mixed complementarity constraint.The main targets are
VectorOfVariables-in-Complements(cc @frapac)VectorQuadraticFunction-in-ComplementsandVectorAffineFunction-in-Complements, implementing both allows us to short-circuit the Jacobian evaluation the affine case.VectorOfVariables-in-Complementswill be handled by bridges.Closes #771
I've left more obscure complementarity constraints, like conic constrained
xcompared tolb <= x <= ub, un-mentioned. @frapac does KNITRO just look at the bounds? Or does it do something different?cc @xhub