Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Query variable values after fixing variable to current value via setLB/UB?

    Posted 03/23/12 10:13 AM

    Originally posted by: MatthiasWalter


    Dear Cplex community,

    I have a question regarding the cplex.getValue() statement for an IloNumVar object (C++).
    In my application I solve a linear program, then I query the value of the variables x[i] via cplex.getValue(x[i]) for i=1,…I. If the value of x[i] is equal to 0, I fix the variable to 0 via x[i].setUB(0.0). After this operation, when I query the value of the next variable xi+1, Cplex will issue the error message „Cplex Error 1217: No solution exists“. Obviously, Cplex has to reoptimize the (modified) problem, before another query is possible.

    I avoid the Error by first recording all the variables I want to fix and by fixing them after having queried all (and recorded some) variables.

    I am wondering if it is possible to fix a variable to its current value (!) without loosing the possibility to query the values of this or other variables.
    In some special applications such a possibility would save myself an extra call of cplex.solve().

    I would be grateful for any advice.

    Kind regards
    Matthias Walter
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Query variable values after fixing variable to current value via setLB/UB?

    Posted 03/23/12 05:45 PM

    Originally posted by: SystemAdmin


    I would use the getValues() method to query all the variables I cared about, store their values in my code's memory space, and query that copy (rather than CPLEX) until I was ready to call solve() (at which time I might zero out those values or set a flag to indicate they are no longer to be trusted).

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Query variable values after fixing variable to current value via setLB/UB?

    Posted 03/27/12 11:01 AM

    Originally posted by: MatthiasWalter


    Dear Paul,

    thanks for your helpful suggestion.

    Best regards
    Matthias
    #CPLEXOptimizers
    #DecisionOptimization