oxfordcontrol / Clarabel.rs

Clarabel.rs: Interior-point solver for convex conic optimisation problems in Rust.
Apache License 2.0
314 stars 24 forks source link

Normed constraint, stupid question #124

Open sdrap opened 2 months ago

sdrap commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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