1

Why is cvxpy.square(x) >= 0 in the constraints not DCP (disciplined convex programming; explicit rules can be found here), whereas the expression cvxpy.square(x) as an objective is DCP?

A more general question would be: what role does >= play in the automatic curvature analysis? / what does the "curvature" of an inequality/equality expression mean?

Rodrigo de Azevedo
  • 1,097
  • 9
  • 17
whoknowsnot
  • 131
  • 1
  • 4
  • You should add "as an objective in a minimization problem", because you could not maximize it, which is the same reason you cannot use it on the left of > (minimizing f(x) is the same as writing t>=f(x), maximizing f(x) is the same as writing f(x)>=t). On the left hand side of > you must have a concave expression, on the right a convex expression. – Michal Adamaszek Jun 17 '22 at 12:55
  • @MichalAdamaszek Thanks. But isn't "minimizing x^2 subject to x^2 >= 0" the same as just "minimizing x^2" because the constraint is already met for any real x? In any case, I'd like to know the *DCP rules* for constraints, which is more about the implementation than the math, I guess. – whoknowsnot Jun 17 '22 at 13:55
  • 1
    You know the constraint is met, but how can CVXPY know that? You could maybe expect cvxpy to know that x^2 is nonnegative (actually maybe it does) but then it would effectively have to skip this constraint (since the solver won't accept it) which would be even more confusing. DCP rules for constraints are in https://www.cvxpy.org/tutorial/dcp/#dcp-problems – Michal Adamaszek Jun 17 '22 at 14:15
  • @MichalAdamaszek Thank you! That's tremendously helpful. – whoknowsnot Jun 17 '22 at 14:16
  • This is not a programming question. It is a mathematical question. – Rodrigo de Azevedo Jun 20 '22 at 15:44

0 Answers0