Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  reg: ILOFLOAT

    Posted 11/17/11 01:15 PM

    Originally posted by: JDalal


    I am facing an interesting situation. When I declare some decision variable x>=0 as:

    1) IloNumVar x(env,ILOFLOAT);

    2) IloNumVar x(env);

    there is a significant difference in result! Any suggestion or right declaration? Thanks in advance.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: reg: ILOFLOAT

    Posted 11/17/11 03:10 PM

    Originally posted by: SystemAdmin


    > 1) IloNumVar x(env,ILOFLOAT);

    This will result in the creation of a continuous variable with a lowerbound of 2 (x>=2).
    This is because the ILOFLOAT is an enum which gets assigned a value of 2 since its Type=Float
    The compiler will then try to match the closest constructor for IloNumVar and since the
    second argument there is the lowerbound value, hence the result.

    > 2) IloNumVar x(env);

    This will result in the creation of a continuous variable with a lowerbound of 0 (x>=0).
    When no bounds are explicitly mentioned, as in this case, CPLEX assigns a lowerbound of 0
    and an upperbound of +IloInfinity. An equivalent call would be IloNumVar x(env,0,IloInfinity,ILOFLOAT);

    I would suggest you to use ILOFLOAT only after explicitly specifying the LB and UB values to avoid mismatches.
    Also, it might be a good idea to assign a name to the variable for tracking purposes, if you were to
    export the model to a human readable LP/MPS format instead of the engine assigning names default names.
    One such declaration could look like the following:

    IloNumVar x(env,0,IloInfinity,ILOFLOAT,"x");
    


    Hope this helps.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: reg: ILOFLOAT

    Posted 11/17/11 03:19 PM

    Originally posted by: JDalal


    Thanks a lot. It answers my doubt. In fact for my specific problem instance, I was trying hard to find why x is taking 2 when it should be 0 !
    #CPLEXOptimizers
    #DecisionOptimization