Filter Content By
Version
Text Search
${sidebar_list_label} - Back
Filter by Language



Next: Dealing with big-M constraints Up: Tolerances and user-scaling Previous: Advanced user scaling
Avoid hiding large coefficients
As we said before, a typical recommendation for improving numerics is to limit the range of constraint matrix coefficients. The rationale behind this guideline is that terms to be added in a linear expression should be of comparable magnitudes so that rounding errors are minimized. For example:
![\begin{eqnarray*}
x - 10^{6} y &\geq& 0 \
y&\in&[0,10]
\end{eqnarray*}](https://www.gurobi.com/wp-content/plugins/hd_documentations/documentation/8.0/refman/img205.png?x34984)
is usually considered a potential source of numerical instabilities due to the wide range of the coefficients in the constraint. However, it is easy to implement a simple (but useless) alternative:
![\begin{eqnarray*}
x - 10 y_1 &\geq& 0\
y_1 - 10 y_2 &=& 0\
y_2 - 10 y_3 &=& ...
... &=& 0\
y_4 - 10 y_5 &=& 0\
y_5 - 10 y &=& 0\
y&\in&[0,10]
\end{eqnarray*}](https://www.gurobi.com/wp-content/plugins/hd_documentations/documentation/8.0/refman/img206.png?x34984)
This form certainly has nicer values in the matrix. However, the solution

![\begin{eqnarray*}
x - 10^{6} y &\geq& 0 \
y&\in&[0,10]
\end{eqnarray*}](https://www.gurobi.com/wp-content/plugins/hd_documentations/documentation/8.0/refman/img205.png?x34984)
as
![\begin{eqnarray*}
x - 10^{3} y' &\geq& 0 \
y'&\in&[0,10^4]\
\end{eqnarray*}](https://www.gurobi.com/wp-content/plugins/hd_documentations/documentation/8.0/refman/img208.png?x34984)
where








Next: Dealing with big-M constraints Up: Tolerances and user-scaling Previous: Advanced user scaling








