Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Changing object coefficient "invalidates" the whole problem object

  • 1.  Changing object coefficient "invalidates" the whole problem object

    Posted 01/20/12 08:19 PM

    Originally posted by: tavs


    I'm using CPLEX 11 C callable library through a wrapper which allows me to use glpk as well, by choosing either of them at compile time.

    To set the objective coefficient of the jth column to k I have a routine of such wrapper that just performs
    CPXchgobj(env,lp, 1, &j, &k);
    


    This, together with the rest of the wrapper, work like a charm to create the problem object, as I can see from the lp file I print after the problem creation routine.

    Then I have to change the coefficients again, using the same routine, but when I solve the problem I get an error (CPXgetstat returns 0). If I print the lp file after the coefficients' change I see the "empty model"
    Problem name:

    Minimize
     obj: - ? x1
    End
    


    If I print it just before the loop that changes the coefficients, instead, I get exactly the initial correct model.

    So maybe I screwed something in that loop. However the code worked under glpk so I don't see where the eventual bug could come from.

    Valgrind doesn't have anything to complain about.

    Do you have any idea on how to fix this?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Changing object coefficient "invalidates" the whole problem object

    Posted 01/23/12 02:55 AM

    Originally posted by: SystemAdmin


    What is the exact version of CPLEX you are using? I tried to reproduce the problem with CPLEX 11.2 but everything works correct with that version here.
    Do you properly check the return values of all CPLEX functions you invoke? Is it possible that some of your coefficients are NaNs? Could you show us the part of the code that does the coefficient changes and invalidates the model?
    #CPLEXOptimizers
    #DecisionOptimization