Skip to content
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

Normed constraint, stupid question #124

Open
sdrap opened this issue Jul 8, 2024 · 2 comments
Open

Normed constraint, stupid question #124

sdrap opened this issue Jul 8, 2024 · 2 comments

Comments

@sdrap
Copy link

sdrap commented Jul 8, 2024

First of all many thanks for the outstanding library.

I have a short mathematical question concerning the mathematical problem with soc.

I would like to understand the mathematical translation in terms of second order cone for the following problem

$$ \inf x^\top P x + q^\top x $$

under the constraint

$$ ||x||_1 =\sum |x_k| \leq 1 $$

It is clear that it can be transformed with $n$ second order constraints $||x_k||_2 \leq t_k$ and $\sum t_k \leq 1$. However I don't get how to define this auxiliary variable in terms of the matrix $A$ and vector $b$ as well as the vector of cones.

Many thanks in advance for answering this trivial question.

@goulart-paul
Copy link
Member

Better to upper and lower bound each element of $x$ with some auxiliary variable $y$ using a pair of inequalities, i.e. $-y \le x \le y$, and then put a constraint $\sum_k y_k \le 1$. The first constraint ensures that $y$ will be nonnegative, so there is no need to impose that constraint directly.

@sdrap
Copy link
Author

sdrap commented Jul 9, 2024

I understand but in that case, from the problem setting, it also means that I have to extend the objective function by a zero upper matrix block and zero upper vector q right? It also mean that I have to modify also all the other constraints to take into account the additional dimensions isn't it? This apparently can not be done directly in the constraints.

My issue is that I have a generic objective and optional constraints, so depending on the constraints I have to provide a way to slice the result to recover $x$ exactly and not the auxiliary variable, and also modify recursively each previous constraint.
I will try to figure out how to do.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants