How this is a homogeneous problem?

Uncategorized
Jan 12, 2021
K

I am solving this problem but it gives homogeneous problem detected and it gives the optimal value as 0. Why is it the case? Any help would be highly appreciated.

Here X{p} is a vector.

cvx_begin
variable x§

         f = dot(alpha_v,X{p}.^2) + dot(beta_v,X{p})+transpose(v)*X{p}+rho/2*(norm(Nabla{p}*X{p}))^2; 
         
         minimize f
         subject to
         l(p) <= norm(X{p},1) <= u(p)
       cvx_end

Homogeneous problem detected; solution determined analytically.
Status: Solved
Optimal value (cvx_optval): +0

M

Can you show a complete, but minimally-sized, reproducible example? Apparently, the problem is simplified enough by CVX’s processing that it does not need to call the solver.

I don’t understand why l(p) <= norm(X{p},1) would be accepted by CVX, because it si a non-convex constraint. Even if l(p) were zero, CVX still would reject it, even though in that case it would be a vacuous constraint which some optimization modeling system could eliminate, but CVX does not.

I am very dubious that the output you show corresponds to the program you show. So my question is, how is this program accepted by CVX?

K

Yes you are right. When I do it as a separate cvx example, it gives the following error:
Disciplined convex programming error:
Invalid constraint: {constant} <= {convex}
Though I don’t understand how it is a non-convex constraint? Moreover, it does not accept norm(x)^2 too in the objective function. Why is that?

K
Replying to #2

This is my reproduceable example:

`clear
clc
l = [0;0;0;0;0];
u = [6.77;5.17;7.88;5.14;3.07];
alpha_v = [0.084 0.084 0.084 0.084 0.084];
beta_v = [5.21 5.21 5.21 5.21 5.21];
Nabla = [0 0 0 0 0
0 0 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 0];
v = [0;0;0;0;0];
n = 5;
rho = 0.5;
%%**********************************************************
cvx_begin
variable x(n)

         f = dot(alpha_v,x.^2) + dot(beta_v,x)+transpose(v)*x+rho/2*(norm(Nabla*x)^2); 
         
         minimize f
         subject to
         l(1) <= norm(x,1) <= u(1);

cvx_end`

E
Replying to #4

@Mark_L_Stone will tell you that the problem is nonconvex and hence it is not solvable by cvx.

M

This is actually a convex problem. Or more specifically, with this input data, can be rewritten as a convex problem.

First of all, norm.(..)^2 needs to be replaced by square_pos(norm(...)) .

Second of all, as I wrote in my previous reply:

I don’t understand why l(p) <= norm(X{p},1) would be accepted by CVX, because it si a non-convex constraint. Even if l(p) were zero, CVX still would reject it, even though in that case it would be a vacuous constraint which some optimization modeling system could eliminate, but CVX does not.

Indeed, CVX does not accept this. But given that l is the zero vector, that constraint can be removed as vacuous. Therefore, the problem can be rewritten as below, and it is successfully solved. But it is not a homogeneous problem; and CVX solves it by calling a solver. not analytically.

cvx_begin
    variable x(n)

             f = dot(alpha_v,x.^2) + dot(beta_v,x)+transpose(v)*x+rho/2*square_pos(norm(Nabla*x)); 
             
             minimize f
             subject to
             norm(x,1) <= u(1);

    cvx_end`

In the future, please make sure that the output you show corresponds to the program you show, which obviously was NOT the case in your post.

K
Replying to #6

Thanks for the elaborative reply Mark! I will be careful next time!

E
Replying to #6

I just saw constant <= convex. Should be more careful another time.