Skip to main content

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

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • Maliheh Aramon
    • 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

Post is closed for comments.