-
Notifications
You must be signed in to change notification settings - Fork 87
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
Discuss implementing all constraint types #213
Comments
What about |
This is an inherent tension in the design of MOI. The current answer is, if you want users to be able to model with these constraints, then the solver wrapper must support it. The OSQP wrapper could choose to support only ScalarAffineFunction-in-Interval, but this would imply that variable bounds and one-sided constraints like OSQP is not the kind of solver where users would typically expect to model with vector-valued constraints, so I'd say that support for VectorAffineFunction-in-Zeros/Nonnegatives/Nonpositives is less pressing. However, someone will want it eventually, and if it's not implemented they could choose to reformulate or implement support for it. Documentation is important here, as you mentioned. Support for different function-set combinations can be either through bridges or on an ad-hoc basis. It's up to the package author to decide. It will take some time and experience to develop best practices. |
I wouldn't be against adding a bridge for that. I think some solvers might want deal with every constraint type directly to try to have minimal memory/time footprint for each of them (typically LP solvers, there has even been talk about caching constraints to submit them in bunch to the solvers to allow better performance) but for other solvers, the reasoning is that this is completely negligible and bridges are an appropriate way to make solvers support everything with minimal duplicate work (typically convex solvers). I like to think that MOI thrives for both type of solvers and allows them to be seamlessly available through the same API. |
Raised by @tkoolen:
I added the following to the docs, however when I attempted to use the web editor I clicked
merge into master
rather thanmake a PR
. Commit is 51c8f72. I can revert if people want changes.With this in mind, developers should attempt to support as many constraint types as possible if it makes sense on the solver side. For example, if the solver only supports constraints of the form
l <= f(x) <= u
, wherel
oru
can beinf
or-inf
, the wrapper should supportScalarAffineFunction
-in-LessThan
/GreaterThan
/EqualTo
instead of justInterval
.The text was updated successfully, but these errors were encountered: