RoboticExplorationLab/ReLUQP-py

Half inequality constraint (Ax<= b or a<= Ax)?

mao1756 opened this issue · 1 comments

It seems to me that currently, the software only supports the constraint of the form $a\leq Ax \leq b$. Is there any way to use the constraint of the form $a\leq Ax$ or $Ax \leq b$?

Context:
I am implementing a program that finds a projection of a given point to a given convex hull, and writing the problem as a QP, we have the following problem:

$\textrm{minimize} \quad \frac{1}{2}\lambda ^T XX^T \lambda -(Xy)^T \lambda$
$\textrm{subject to} \quad \lambda\geq 0, \sum_{i}\lambda_i = 1$

where $X\in \mathbb{R}^{n\times d}$ contains points constructing the convex hull as row vectors (d dimensional), and $y$ is the point we want to calculate the projection.

I don't have an issue to write $\sum_{i}\lambda_i = 1$ in the form $a\leq A\lambda \leq b$ since I can write $1 \leq (1_{n})^T \lambda \leq 1$ where $1_n$ is the n dimensional vector of ones, but I am not sure about the positivity constraint $\lambda \geq 0$. Are there any tricks we can use to implement this problem?

hello, and thanks for your question!
we use a similar interface to osqp. if you only care about one side of the inequality, you can set the other side to Inf or -Inf. there are relevant examples on the osqp website.