Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
Expand all | Collapse all

CPLEX quadratic constraint programming error

  • 1.  CPLEX quadratic constraint programming error

    Posted Tue September 12, 2017 08:07 PM

    Originally posted by: Ji.She


    Hi everyone,

    I am trying to use cplex to solve a quadratic constraint programming problem. To test how to do this, I formulated a small problem in python 2.7 and attached the script here. The problem itself is very simple and I present it here:

    Max c

    s.t. Q1: c^2 = a^2 + b^2

          0 <= a <= 10

          0 <= b <= 20

    I got an error message when calling the solver, which was: "CPLEX Error  5002: 'Q1' is not convex.

    However, from my understanding, this constraint is definitely convex so I don't know why I still get this error. Would anyone please look at it a bit to see if you may identify the error? Any help is greatly appreciated.

     

    Thank you,

    Ji


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX quadratic constraint programming error

    Posted Wed September 13, 2017 01:22 AM

    A quadratic equality constraint can never be convex, see also this section in the manual.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX quadratic constraint programming error

    Posted Wed September 13, 2017 02:17 AM

    Originally posted by: Ji.She


    Hi Daniel,

    Thank you so much for your reply and clarification. It's embarrassing I didn't see this by myself when formulating my problem. So, does this mean cplex cannot solve the problem I presented above? The real problem I want to solve has multiple constraints including a quadratic equality constraint.

     

    Thank you,

    Ji


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: CPLEX quadratic constraint programming error

    Posted Tue September 19, 2017 01:42 AM

    Often equality constraints can be turned into inequality. For example, in your case 'c^2 ==' is the same as 'c^2 <=' since you are maximizing c. Unfortunately, that is still not good since the constraint is still not convex (note that the reverse constraint c^2 >= a^2 + b^2 is a second order cone constraint which CPLEX can handle, see here for some other non-psd constraint types CPLEX can handle).

    For you model at hand, I'm afraid you will have to reformulate before you can solve with CPLEX.


    #CPLEXOptimizers
    #DecisionOptimization