Skip to main content

Setting a a given precision (of decimal places) for a variable

Answered

Comments

1 comment

  • Maliheh Aramon
    • Gurobi Staff Gurobi Staff

    Hi, 

    Gurobi has a parameter named ScaleFlag that automatically scales the model. Automatic scaling implicitly changes feasibility tolerance values.

    • The internal substitution of \(x\) with \(0.1x^{\prime}\) implicitly multiplies the feasibility tolerance for bounds of \(x^{\prime}\) by 10.
    • The internal substitution of \(x\) with \(10x^{\prime}\) implicitly divides the feasibility tolerance for bounds of \(x^{\prime}\) by 0.1.

    By setting the ScaleFlag parameter to 0, you can turn the automatic scaling off. 

    • If the smallest meaningful value in your model is in the order of 1e-8, the rule of thumb is to set the feasibility tolerance to a value which is at least one order of magnitude smaller, i.e., 1e-9. 
    • Another idea is for the user to substitute \(x\) by \(0.001x^{\prime}\) where the default feasibility tolerance of 1e-6 for variable \(x^{\prime}\) means a feasibility tolerance of 1e-9 for variable \(x\).

    Best regards,

    Maliheh

    1

Please sign in to leave a comment.