Originally posted by: Mark L. Stone
I am trying to understand the convexity requirements on the objective function and constraints for the MATLAB toolbox function cplexqcp in CPLEX 12.6.0.1. Specifically, what are the requirements for the matrix H for the quadratic objective term and (each) matrix Q for the quadratic constraint term(s) as to whether they need be positive semi-definite? I thought that at least H need not be positive semi-definite if solutiontarget is set to 2, but this does not appear to be the case.
It appears to be the case that if there is a quadratic constraint (Q is not empty), then H needs to be positive semi-definite, regardless of the value of solutiontarget. Is this correct? Is there some other parameter or way of formulating the problem which allows a non positive semi-definite H (presuming there is a non-empty Q) and even perhaps allows non positive semi-definite Q?
Consider the following toy problem with non-convex H and convex Q
>> cplex_options = cplexoptimset('solutiontarget',2);
>> [x,fval,exitflag,output]=cplexqcp([1 0;0 -1],[2 ;3],[],[],[],[],zeros(2,1),[1 0;0 1],1,[-1;-1],[1;;1],[0;0],cplex_options)
Error using cplexqcp (line 649)
CPLEX Error 5002: Q in %s is not positive semi-definite.
Now change H to be positive definite, and the problem is solved (no surprise here)
>> [x,fval,exitflag,output]=cplexqcp([1 0;0 1],[2 ;3],[],[],[],[],zeros(2,1),[1 0;0 1],1,[-1;-1],[1;;1],[0;0],cplex_options)
x =
-0.5547
-0.8321
fval =
-3.1056
exitflag =
1
output =
cplexstatus: 1
cplexstatusstring: 'optimal'
iterations: 0
algorithm: 4
time: 0
message: 'Function converged to a solution x.'
Or go back to the original problem with non-convex H and eliminate Q (so it now is a QP) and is solved (without resorting to cplexqp)
>> [x,fval,exitflag,output]=cplexqcp([1 0;0 -1],[2 ;3],[],[],[],[],[],[],[],[-1;-1],[1;1],[0;0],cplex_options)
x =
-1
-1
fval =
-5
exitflag =
1
output =
cplexstatus: 1
cplexstatusstring: 'optimal'
iterations: 0
algorithm: 4
time: 0
message: 'Function converged to a solution x.'
Even eliminating the quadratic term in the objective doesn't allow non-convex constraint:
>> [x,fval,exitflag,output]=cplexqcp([],[2 ;3],[],[],[],[],zeros(2,1),[1 0;0 -1],1,[-1;-1],[1;;1],[0;0],cplex_options)
Error using cplexqcp (line 649)
CPLEX Error 5002: Q in %s is not positive semi-definite.
I suggest the documentation be beefed up to make these matters clearer. Thanks.
#CPLEXOptimizers#DecisionOptimization