Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

fixing a variable: constraint or setBounds?

  • 1.  fixing a variable: constraint or setBounds?

    Posted Mon November 17, 2014 08:44 PM

    Originally posted by: LeandroCC


    If I am able to tell CPLEX the value of a variable in the optimal solution, should I add a new constraint (model.add(var == value)), or use setBounds (var.setBounds(value,value))?

    Is there any difference between these two approaches? If so, in which case one is preferred over the other?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: fixing a variable: constraint or setBounds?

    Posted Tue November 18, 2014 12:28 AM

    The differences between the two approaches are rather minor, the slightly better one is to explicitly fix the variable using setBounds().


    #CPLEXOptimizers
    #DecisionOptimization