Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to increase the computational accuracy

    Posted 10/04/17 09:16 AM

    Originally posted by: mik14


    Hi,

    I try to solve a LP in Java with CPLEX. Although the status states it is optimal and feasible I found out that the solution violates some boundaries. The reason seems to be the computational accuracy. The violation is in the range of 1e-7. The following questions come up, especially number 2):

    1) If I relax my problem and adjust the parameters by hand I can solve it to be optimal. Is there a presolving parameter available to improve numerical robustness?

    2) Is there a way to change the accuracy of CPLEX to get the correct solution. Unfortunately, I only found parameters for the barrier algorithm in the parameter list. The best results I got so far are with the barrier algoritm and disabled crossover (=-1). 


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How to increase the computational accuracy

    Posted 10/04/17 04:26 PM

    The default value for the feasibility tolerance parameter (EpRHS) is 1e-6, so what you consider a "boundary" (bound? constraint?) violation, CPLEX does not (at least not with default settings). You can set EpRHS to something smaller and see if that fixes the problem. If the error proves stubborn, you might also turn on the NumericalEmphasis parameter, which will cause CPLEX to expend more effort on numerical precision (and, consequently, may slow it down).


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How to increase the computational accuracy

    Posted 10/04/17 06:07 PM

    Originally posted by: mik14


    Thank you. EpRHS is exactly what I was looking for. I already tested NumericalEmphasis but this doesn't change the result.

     

    As I now need a EpRHS value of 1e-8  for a correct result and some of my problems might be require even a lower value, is there a automatic function to adjust constraint's parameter to improve numerical accuracy (question 1)?


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: How to increase the computational accuracy

    Posted 10/04/17 08:43 PM

    Originally posted by: EdKlotz


    As with all of CPLEX's APIs, there are functions to set any of CPLEX parameters.    In Java, you will use the IloCplex.setParam method.   All parameters appear in the Parameters section in the documentation.   For the numerical emphasis parameter in Java, you identify it with the boolean parameter IloCplex.Param.Emphasis.Numerical.   You can also see how parameters are set by looking at various Java example programs that come with your CPLEX distribution.

    Let me mention one thing about the feasibility tolerance that Paul pointed out.   The feasibility tolerance defines the amount by which a constraint (measured by the slack variable bound) or variable bound can be violated without CPLEX considering it infeasible.    That differs slightly from relaxing the constraint by that tolerance amount.   When you relax a problem you truly relax the constraints, and a violation of the original constraint by the relaxation is considered feasible.   With the feasibility tolerance, CPLEX doesn't  relax the constraint by the tolerance amount.   However, if simplex method calculations result in a violation of structural or slack variable bounds within the tolerance amount, the associated solution is accepted as feasible.  

    For example, consider a really simple LP:

    min x s.t.

    x >= 0

    With CPLEX's default feasibility tolerance (or any other value you set for it), CPLEX will report an optimal solution of x=0.    The calculations of the variables are trivial here, so there's no issue of accuracy, and no error in the solution.    Contrast this with relaxing the right hand side by the default feasibility tolerance of 1e-6; that relaxed problem has an optimal solution of x = -1e-6.  


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: How to increase the computational accuracy

    Posted 10/05/17 04:46 AM

    Originally posted by: mik14


    Thank you for your additional remarks but  unfortunately they don't address my issue. Probably I wasn't clear in my statements.

    I know how to set parameters for CPLEX and I don't want to relax my problem. I just relaxed my problem to find my numerical problem and of course the result of my relaxed problem differs from my original one. EpRHS is exactly the parameter I was looking for although it unfortunately only allows a value of 1e-9.

     

    Regarding my question 1): What I mean with improving numerical robustness is, e.g. that I have the following problem:

    min x+y
    s.t. 0.00003 x+0.00006 y <=0.0001

    which I want to transform into

    min x+y
    s.t. 3 x+6 y <=10


    My question is, if there are such preprocessing steps available in CPLEX.
     


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: How to increase the computational accuracy

    Posted 10/10/17 04:04 AM

    The scaling parameter may be what you are looking for. This being said, it might be better to scale your model yourself in case you know good scaling factors. Here is why: If you submit a number like 0.000003 to CPLEX then this number is not exactly representable as IEEE double precision number. So you will already have some marginal error for representing that number. If you instead pass 3, that is perfectly representable.

     


    #CPLEXOptimizers
    #DecisionOptimization