Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  C API: How to define quadratic objective function

    Posted 07/18/19 08:30 AM

    Originally posted by: ops1234


    Hi,

    when I'm declaring a new variable with CPXXnewcols(...), I can also give the objective function coefficient of that new variable. But how can I declare that this variable should enter quadratically in my obj. function, e.g. x^2 (there are no mixed terms like x1*x2, only x1^2 or x2^2).

    Thanks in advance.

     

    Best,

    ops

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: C API: How to define quadratic objective function

    Posted 07/18/19 08:39 AM

    Hi,

    have you had a look at the example

    qpex1.c

    ?

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: C API: How to define quadratic objective function

    Posted 07/18/19 08:59 AM

    Originally posted by: ops1234


    The thing is, my problem is not created once in the beginning, but over time new variables are added with CPXXnewcols(...) and new constraints by CPXXaddrows(...). So I don't really have the whole problem neatly written down like in the example. For example after some time my algorithm will add a new variable x, which should go into the objective as 3x^2. Is there not an easy way to do that?

    Or how would this case look like when we follow the example? Is that even possible?

     

    Best regards,

    ops


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: C API: How to define quadratic objective function

    Posted 07/22/19 02:02 AM

    You can use function CPXchgqpcoef() to change an arbitrary coefficient in the coefficient matrix. That should do the trick for you.


    #CPLEXOptimizers
    #DecisionOptimization