Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  not positive semi-definite

    Posted 04/10/12 11:29 PM

    Originally posted by: SystemAdmin


    Hello,all,
    I'm very confused to get the error while trying to run my code:
    CPLEX Error 5002:Q in 'id27' is not positive semi-definite.
    Here is the part of the model which is related to the error:

    cons2:
    forall ( i in pathes) {
    forall ( j in all_pass_amountid : j > sf[i][1] && j <= sf[i][2] ){
    b[j] == bj-1*( 1-y[ passj-1] [i] ) + alpha * y[ passj-1] [i] - d[ passj-1] [passj];
    }
    }

    I know this is related to the convexity of the problem ,but I still can't solve the prolem:
    Do I have to reformulate the problem?
    I've attached my model file.Would really appreciate any help!
    Thanks,
    Alexander
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: not positive semi-definite

    Posted 04/13/12 12:51 PM

    Originally posted by: EdKlotz


    > Alexanderwilliams wrote:
    > Hello,all,
    > I'm very confused to get the error while trying to run my code:
    > CPLEX Error 5002:Q in 'id27' is not positive semi-definite.
    > Here is the part of the model which is related to the error:
    >
    > cons2:
    > forall ( i in pathes) {
    > forall ( j in all_pass_amountid : j > sf[i][1] && j <= sf[i][2] ){
    > b[j] == bj-1*( 1-y[ passj-1] [i] ) + alpha * y[ passj-1] [i] - d[ passj-1] [passj];
    > }
    > }
    >
    > I know this is related to the convexity of the problem ,but I still can't solve the prolem:
    > Do I have to reformulate the problem?
    > I've attached my model file.Would really appreciate any help!
    > Thanks,
    > Alexander
    Generally speaking, any time you have a quadratic expression where you have the product of two variables in the expression, but you don't have a multiple of the squares of those variables, your quadratic is nonconvex. That is the case in
    the above constraint, so the 5002 error comes as no surprise. However, there are certain situations where you can convexify a nonconvex quadratic expression.
    One involves products of binary variables; CPLEX automatically does the convexification in such cases. In your attached model, the product of
    variables involves b and y, with b integer and y binary. You can adjust the
    formulation by introducing a new variable z that linearizes this expression.
    One way involves using the logical constraints available from all of CPLEX object oriented interfaces, including the OPL modeling language that you are
    using. So, if you want to create a new integer variable z that equals b*y, you can do it with the constraints

    y == 0 --> z = 0
    y == 1 --> z = b

    Or, if you have a reasonable upper bound U on the integer variable b, you can
    do it with

    c1: z <= b
    c2: z <= U*y
    c3: z - b >= -U(1 - y)

    So, if y = 0, c2 forces z = 0, while c3 is nonbinding. If y = 1, c3 forces
    z >= b, which means c1 then implies z = b. Meanwhile c2 is nonbinding.
    So, in either case, z = b*y. After adding these constraints, substitute z
    for your quadratic terms of b*y. You've added constraints that linearize
    your quadratic expression.

    For additional info and tools to diagnose this type of here, try the technote
    available at

    http://www-01.ibm.com/support/docview.wss?uid=swg21400047

    While you can obviously find all sorts of information about positive definite matrices in various text books, I find a good quick place to start is the link
    in the above technote:

    http://www.math.northwestern.edu/~clark/240/2001/pos-def.pdf
    #CPLEXOptimizers
    #DecisionOptimization