Do large implied variable ranges in nonlinear terms affect numerical stability, or only explicit coefficients and rhs matter?
I have a question about numerical scaling guidelines in Gurobi.
The documentation emphasizes keeping matrix coefficients, RHS values, and bounds within reasonable ranges as shown here. However, I am unsure whether this guideline applies only to the explicit coefficients in the model, or also to the magnitude of expressions implied by variable bounds.
Consider the following example:
x * y + z^2 <= 10
x = a^2
z = b^2
with bounds (still within the range in the guideline):
0 <= a <= 1000, 0 <= b <= 1000, 0 <= y <= 1000
From this, we can derive:
0 <= x <= 10^6
0 <= z <= 10^6
and therefore:
0 <= x * y <= 10^9
0 <= z^2 <= 10^12
Even though the constraint x*y + z^2 <= 10 has coefficients equal to 1 and a small RHS (10), the magnitudes of the terms inside the constraint can become very large.
My question is:
Do these large implied ranges (e.g., x*y or z^2 reaching up to 10^9 or 10^12) affect numerical stability and solver performance, or do Gurobi’s scaling guidelines mainly concern the explicit coefficients and RHS values in the model?
In other words, should we also try to control the range of nonlinear or auxiliary expressions?
I would like to confirm whether I am misunderstanding the guideline or missing an important aspect of numerical scaling.
-
You're not misreading it - the implied ranges matter too, not just explicit coefficients and RHS. Gurobi's recommended ranges apply to variable bounds as well, and for a bilinear or general nonlinear term the magnitude is driven by the bounds of the variables entering it: if x and y can each reach 1e6, then x*y has an implied range up to 1e12, and that range shows up in the relaxations the solver builds even though no coefficient you wrote down is large. Presolve does bound strengthening, but it can only use what's in the model - it can't see what you know about realistic operating ranges, so a variable left with an infinite or 1e9 bound keeps a huge implied domain even if the real solution lives in [0, 100]. The fix is tight finite bounds on every variable appearing in a nonlinear term, including auxiliaries you introduce for products/powers, plus rescaling units so quantities sit within a few orders of magnitude of each other. NumericFocus helps once that's done, but on its own it's a band-aid rather than a fix for bad scaling. Worth reading: https://docs.gurobi.com/projects/optimizer/en/current/concepts/numericguide/tolerances_scaling.html plus the Help Center article you linked on large matrix coefficient range / bounds. If you post the reported coefficient and bound ranges, it's usually easy to spot which block is the offender.
0
Please sign in to leave a comment.
Comments
1 comment