Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Binary variables are assigned a negative value during solving a MIP problem

    Posted 03/10/13 07:45 PM

    Originally posted by: bqt


    Hi all,

    I am solving a MIP problem, where binary decision variables are declared as follows

    IloArray<IloIntVarArray> x(env, n); //Variables
    for(i = 0; i < n; i++){
    x[i] = IloIntVarArray(env, n, 0, 1);
    }
    }

    In the UserCutCallback, I show assigned value of the binary variables in using the method getValues(x[i]). As the results, some variables are assigned negative values.

    Someone could please give me an advice to fix this bug ?

    Thanks,

    bqt
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Binary variables are assigned a negative value during solving a MIP problem

    Posted 03/10/13 11:31 PM

    Originally posted by: SystemAdmin


    What is the magnitude (absolute value) of the negative variables?

    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: Binary variables are assigned a negative value during solving a MIP problem

    Posted 03/11/13 04:10 AM

    Originally posted by: bqt


    Hi Paul,

    Some variables are signed to -1.4, -0.65 ..

    bqt
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Binary variables are assigned a negative value during solving a MIP problem

    Posted 03/11/13 04:31 AM

    Originally posted by: SystemAdmin


    That looks like a bug in either CPLEX or your model. Could you call cplex.exportModel("model.sav") right before doing cplex.solve() and attach the generated .sav file here?
    Maybe also try calling getLB() and getUB() on the variables that have negative values in the callback to double check that the bounds are as expected.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Binary variables are assigned a negative value during solving a MIP problem

    Posted 03/11/13 04:49 AM

    Originally posted by: bqt


    Thanks Daniel,

    I am doing a research, posting source code on the forum is not good. I have just tried calling getLB() and getUB() on the variables that have negative values, as result, they are always 0 and 1. It means that their bounds are correct.

    bqt
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Binary variables are assigned a negative value during solving a MIP problem

    Posted 03/11/13 05:06 AM

    Originally posted by: bqt


    I tested my code on some different instances. My code run well on almost of instances. Few of instances, it presents the bug
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Binary variables are assigned a negative value during solving a MIP problem

    Posted 03/11/13 05:16 PM

    Originally posted by: SystemAdmin


    Try collecting kappa statistics to see if CPLEX is encountering unstable bases (which would indicate numerical instability).

    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


  • 8.  Re: Binary variables are assigned a negative value during solving a MIP problem

    Posted 03/15/13 11:25 AM

    Originally posted by: bqt


    Thank you for your reply. I found the reason, it is a floating error.
    bqt
    #CPLEXOptimizers
    #DecisionOptimization