0

first post on SO.

I'm working on a quadratic optimization problem.
I'm getting the following error:

Aeq = beq = sostype =sosind = soswt = [] % for my specific problem

The others paramers look like correctly define.

Error using cplexmiqp
CPLEX Error  5002: %s is not convex.
Error in MIP_CPLEX_OptL2_CstrL0 (line 78)
        [x,z,exitflag,output] = cplexmiqp(Hprim'*Hprim,(-y'*Hprim)',Aineq,bineq,Aeq,beq,sostype,sosind,soswt,lb,ub,ctype,z0,solveur);

I've already checked the properties of the matrix (it's semi-PSD).

The error only appears for a dimension greater than 600 variables (continuous and binary -> MIQP). Below this value, the model works correctly.

Anybody got any ideas? Thx a lot :)

lmbd_a
  • 3
  • 2
  • Welcome to stackoverflow. Please edit your question to include a [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example). – rkersh Mar 30 '20 at 13:30
  • The matrix `Q=Hprim'*Hprim` is not positive semi-definite (you probably need to print things with more decimals to see this). Instead of repairing Q you can can also reformulate the problem (see [link](https://yetanothermathprogrammingconsultant.blogspot.com/2018/01/least-squares-as-qp-convexity-issues.html) for an example). – Erwin Kalvelagen Mar 30 '20 at 16:47

1 Answers1

1

As the error message states, the problem is that your objective function is not convex. By default, CPLEX only handles convex objective functions in quadratic programs. You can however switch some parameters to make CPLEX accept (and solve for) non-convex objective functions.

You can find the details in the user manual in section CPLEX > User's Manual for CPLEX > Continuous optimization > Solving problems with a quadratic objective (QP).

In order to solve models with a non-convex quadratic objective, you have to set parameter Cplex.Param.optimalitytarget to 3 (find global optimum).

Daniel Junglas
  • 5,830
  • 1
  • 5
  • 22
  • Thank you for your answer. The problem obviously comes from the definition of the matrix, which must be positive defined and not semidefinite positive. Odd Cplex condition ! I work on sparse approximation which in fact allows me to establish a strong assumption on sub-matrices. I found a solution by modifying the objective function and adding an equality constraint in the model. @DanielJunglas Thank you again for your advices and your answer :) – lmbd_a Apr 01 '20 at 07:02