-
Notifications
You must be signed in to change notification settings - Fork 15
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
Infeasibility for basic QP #1
Comments
If I replace the np.inf in h with something reasonable then I get the same solutions in osqp and piqp. This makes me think there's a bug on the piqp end. |
Unfortunately, this is a limitation of interior-point methods in general. The inequality constraints are reformulated using slack variables, i.e., the constraints become To deal with this issue, normally one would pre-filter the problems, i.e., remove the infinity/inactive inequality constraints. This is currently not happening internally in PIQP for general inequality constraints, only for box constraints. The reason for this is that I designed PIQP to be used for solving the same kind of problem over and over (control applications). PIQP allocates memory only ones in the setup step. If the active inequalities changed (e.g. one bound is changed from inf to something finite), the sparsity pattern would change, which would result in allocating new memory (which I try to avoid). I have been thinking about this for a while, since it causes problems for people who don't know this (like you) and hence is not really user-friendly. I could add the preprocessing step internally, which can be disabled for people who really know what they are doing to get maximum performance and no subsequent allocations. This should fix the problem for the average user. What do you think? In the meantime, try to avoid using inf constraints in the general inequalities... Also, instead of passing a
|
OK that makes sense! In that case I have a follow-up question. When I “update” the problem for solving something over and over again, which vectors can I update without allocating new memory? There’s c, h, b, x_lb and x_ub. You’re making me thing I can’t update h without new memory allocation? |
You can update everything, but you should not change the sparsity pattern, i.e., only the values of sparse matrices are updated but not the structure. This means you can also update P, A and G as long as the sparsity pattern doesn't change. For example, if you want to update A, h, and x_ub you can do this using But if I have to filter out inequality constraints based on the values in h, I have to remove/add rows from G internally which would change the sparsity pattern of the KKT matrix, requiring allocating new memory for the KKT matrix and its factorization. |
This issue has been resolved with the latest release (v0.4.2). |
Hi, I tried using the library and am getting infeasibility, so I got things down to a small working example. I can't understand why this solution is yielding infeasibility. Any help would be greatly appreciated. Here's the code I have:
The text was updated successfully, but these errors were encountered: