Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Get the list of fixed variables in callback function

    Posted 06/04/13 02:05 AM

    Originally posted by: MohsenReisi


    Hi.

    I am wondering how is it possible to get the list of fixed variable in user cut callback function? The list includes all variables that are fixed from root to the current node by presolving, branching, or heuristics. In fact, their value are not changed  in the sub-tree.

    Thanks,


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Get the list of fixed variables in callback function

    Posted 06/04/13 04:27 AM

    Originally posted by: TobiasAchterberg


    You would just query the lower and upper bounds at the current node and then check for which of the variables you have lb[j] == ub[j]. I don't think that there is a more efficient way of getting the list of fixed variables.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Get the list of fixed variables in callback function

    Posted 06/04/13 05:22 AM

    Originally posted by: MohsenReisi


    Thanks. You mean Cplex update the upper and lower bound at each level. (after branching or heuristics.) I also think I should check if | ub[j] - lb[j] | < 0.000001 for example. 


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Get the list of fixed variables in callback function

    Posted 06/04/13 06:46 AM

    Originally posted by: TobiasAchterberg


    Yes, sure. You can query the local bounds of the variables through CPLEX API methods. In the C API, for example, you would call CPXXgetcallbacknodelb() and CPXXgetcallbacknodeub() (or the CPX versions, if you are still using the old style C API).


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Get the list of fixed variables in callback function

    Posted 06/05/13 08:25 AM

    Originally posted by: MohsenReisi


    I am using Concert Technology. In ILOUSERCUTCALLBACK function I use getUB(var) and getLB(var) to get the lower and upper bound of each variable. Is that the right way? 


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Get the list of fixed variables in callback function

    Posted 06/10/13 05:51 AM

    Originally posted by: TobiasAchterberg


    Yes, exactly. From the docs of the getLB method:

    This method returns the lower bound of var at the current node. This bound is likely to be different from the bound in the original model because an instance of IloCplex tightens bounds when it branches from a node to its subnodes. The corresponding solution value from getValue may violate this bound at a node where a new incumbent has been found because the bound is tightened when an incumbent is found.

    Tobias


    #CPLEXOptimizers
    #DecisionOptimization