-
Notifications
You must be signed in to change notification settings - Fork 52
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
Quadratic constraints #216
Comments
I assume you convex quadratic constraints. If yes, then we might be interested in contributing a Mosek interface if is possible, Also maybe you should look at conic optimization because that is likely easier to add to your language and you can support a much richer set of convex nonlinearities e.g. ln() and exp(). |
@Midnighter The main reason it was not implemented was that there was no need for it at the time. Optlang itself imposes no restrictions on the nature of the constraints, so it is only a question of whether solvers support a given type of constraints, and then implementing the functions to translate the expression into whatever format the solver needs. |
I also need quadratic terms. Please support this in optlang. |
I'm in the process of adding quadratic constraints to the cplex interface. The minimal version is shown below. So far it's possible to pass constraints like (x1^2 + x2^2) and (x1*x2 + x2*x3), but the second type is usually nonconvex and can't be solved. Any suggestions on what else to do or comments regarding the code?
|
@A2P2 I've been working with a similar workaround for gurobi. So far I've found that you need to modify the _get_expression method for constraints, since its build for linear expression only. If you are working with cobrapy, you wiĺl also find a bug with summary methods but i have not dig enough as to find the source of it. the code i use for gurobi is this: `
` |
@A2P2 Your code looks very promising. I tried it but I get the following error: CPLEX Error 1031: Not available for QCP. I would greatly appreciate if you could share how you avoided this error? |
Within a short amount of time, I have heard from three different developers that they require quadratic constraints. @KristianJensen you probably have the best idea why those were not implemented yet. Can you give a rough idea of the scope of adding this to optlang?
The text was updated successfully, but these errors were encountered: