Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Various problems with rounding errors in cplex

    Posted 06/12/12 04:50 AM

    Originally posted by: cplexforMatlabuser


    Good day,

    I use the cplex for Matlab API Academic Initiative Version 12.2 as well as 12.3 to solve Mixed Integer Linear Problems. I have encountered several problems with rounding errors in cplex.
    The first one is kind of easy to avoid, once you have figured it out. I would like to raise the problem here nevertheless so that maybe IBM can solve it in some newer versions:
    -Cplex sometimes doesn't accept it's own computed solution as feasible. E.g. Sometimes variables that should be larger than zero are rounded to - 10^-9 which produces an error when you try to restart with that value as initial value.

    The second problem I am kind of desperate about:
    I get an infeasibility message with the attached problem in Version 12.3 "rhs is less than lhs", but when I try to call cplex.refineConflict, it is not available. Therefore I tried using Version 12.2 and modified my problem to make it so easy that I myself can guess a feasible solution. I can then use cplex.refineConflict, but it indicates rows and columns as part of the Conflict, that I think are not the source of the problem. When I multiply the constraint Matrix A with my self-constructed feasible solution I get some values that are by 10^-4 larger than cplex.Model.rhs at rows that were not identified by cplex.refineConflict, so I guess the Matrix-multiplication gives rounding errors? What can I do about this?
    Thanks a lot in advance!

    P.S.: How could I also attach my self-constructed solution vector?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Various problems with rounding errors in cplex

    Posted 06/12/12 06:22 PM

    Originally posted by: SystemAdmin


    I opened your SAV file but, before attempting to solve it, looked at the problem statistics. That produced the following line:

    RHS nonzeros : Min : 2.263449e-306 Max : 4.615596e+281

    Do you really have nonzero right-hand side values with magnitudes that extreme?? If so, I'd suggest taking a close look at your model and asking whether you can rescale some things. For practical purposes, 1.26e-306 is 0, and 4.6e+281 is infinity.

    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: Various problems with rounding errors in cplex

    Posted 06/12/12 06:25 PM

    Originally posted by: SystemAdmin


    Just for the halibut, I tried identifying a conflict. CPLEX immediately identified the following:

    Subject To
    c32771: - x63746 + x63747 - x63843 - Rgc32771 = -14
    Bounds
    0 <= x63746 <= 1
    0 <= x63747 <= 1
    -Inf <= x63843 <= 1
    -Inf <= Rgc32771 <= 0
    Binaries
    x63746 x63747

    Given the variable bounds, c32771 clearly cannot be satisfied.

    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


  • 4.  Re: Various problems with rounding errors in cplex

    Posted 06/13/12 08:11 AM

    Originally posted by: cplexforMatlabuser


    Dear Paul,
    thank you for your quick response. I tried reading in the sav file as well, and ideed now my right hand side is infinity. But in the original problem it is not. In the original problem max(cplex.Model.rhs) gives me 4.65*10^4. So cplex seems to change the problem when it writes it to a .sav file.
    I once had strange things happening when I passed a matrix to cplex that had more empty (i.e. =[] and not =0 ) rows and columns than were needed. I didn't think this would cause trouble, because I thought cplex just ignores empty fields. However cplex used continuous linear optimization instead of mixed integer as was required (there were binary entries in cplex.Model.ctype) without giving a warning. Maybe this problem here has to do with such a "formal" error again?

    This time I attached the Matlab cplex objet as a matfile.

    Can you identify the problem?
    Thanks again!
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Various problems with rounding errors in cplex

    Posted 06/13/12 03:10 PM

    Originally posted by: cplexforMatlabuser


    I would like to come back to my first problem as well:

    I perform "rolling planning" in unit commitment, that is I optimize the schedules of power plants over a certain time horizon, e.g. 48 hours. In a second step, I take the optimal values computed for hour e.g. number 4 and do a second optimzation for the period hour 4 to hour 48+4. For hour 4 I fix certain initial values to values that were computed in the first optimization step for hour number 4. However these initial values computed by cplex sometimes violate constraints by just a little bit, e.g. 10^-5 (e-05). I get an infeasibility message from cplex when I want to start with the previously computed optimal values, i.e. cplex seems not to accept the quality of its own solution. Can you help me on that one as well?
    Would appreciate it very much, since I have had quite a bit of trouble with that recently...

    Thanks a lot in advance!

    P.S.: Attached is Matlab cplex object as an example of such a problem
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Various problems with rounding errors in cplex

    Posted 06/13/12 03:21 PM

    Originally posted by: cplexforMatlabuser


    here it is
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Various problems with rounding errors in cplex

    Posted 06/13/12 03:27 PM

    Originally posted by: cplexforMatlabuser


    for some reason I cannot upload the attachment... I try again
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Various problems with rounding errors in cplex

    Posted 06/15/12 07:42 PM

    Originally posted by: SystemAdmin


    You can try tightening CPLEX's feasibility parameter (EpRHS), or cranking up its numerical sensitivity (there are a couple of parameters for that). You might also try checking the final basis condition number (kappa value), assuming the MATLAB interface gives you access to that. It might be a problem with numerical instability of the model.

    First, though, I would try to find out why the SAV file had funky right hand side values. If either MATLAB or the CPLEX-MATLAB connector is mangling model coefficients, that could be the source of the imprecision.

    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


  • 9.  Re: Various problems with rounding errors in cplex

    Posted 06/15/12 07:37 PM

    Originally posted by: SystemAdmin


    I can't (not a MATLAB user); perhaps someone else can.

    Paul
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Various problems with rounding errors in cplex

    Posted 06/17/12 08:11 AM

    Originally posted by: SystemAdmin


    Like Paul said, you first should figure out why the model that is written to disk is dramatically different from the model that you (intent to) build up in matlab. Do the problems persist if you only give arrays with matching dimensions to CPLEX?
    #CPLEXOptimizers
    #DecisionOptimization