From 39434cc0d5c7f1e6a12df88a258b7305a816d50f Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 8 Sep 2026 09:33:07 +0200 Subject: [PATCH] docs(scaling): note that scaling shifts solver tolerance meaning Add a caveat to the numerical-scaling notebook explaining that solver feasibility and optimality tolerances apply to the scaled problem, so a fixed tolerance maps to different absolute tolerances in original units. --- examples/numerical-scaling.ipynb | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/examples/numerical-scaling.ipynb b/examples/numerical-scaling.ipynb index ac0b1c48..9894c208 100644 --- a/examples/numerical-scaling.ipynb +++ b/examples/numerical-scaling.ipynb @@ -300,22 +300,7 @@ "cell_type": "markdown", "id": "15", "metadata": {}, - "source": [ - "## Notes and caveats\n", - "\n", - "- **Scaling never changes the answer.** It is a pure change of units. Solutions,\n", - " duals and the objective are always reported in your original units.\n", - "- **Discrete columns stay discrete.** For binary and integer variables the\n", - " scaling factor is stored and round-tripped, but the solver column is left as an\n", - " ordinary integer column — scaling a discrete variable would break integrality.\n", - "- **Choosing factors.** Aim to bring each variable's magnitude and each row's\n", - " coefficients near 1. A good rule of thumb is to divide by the typical absolute\n", - " value you expect. There is no single correct choice; different solvers and\n", - " algorithms react differently (barrier methods care least; simplex and crossover\n", - " benefit most).\n", - "- **This is manual scaling.** You provide the factors. An automatic strategy that\n", - " picks them for you is a natural follow-up built on top of this mechanism." - ] + "source": "## Notes and caveats\n\n- **Scaling never changes the answer.** It is a pure change of units. Solutions,\n duals and the objective are always reported in your original units.\n- **Scaling shifts what solver tolerances mean.** A solver applies its\n feasibility and optimality tolerances to the numbers it sees — the scaled\n problem — not to your original units. A fixed tolerance therefore maps to a\n different absolute tolerance per row and column once you scale. That is usually\n the point (it spreads the tolerances more evenly across the model), but it\n means a scaled and an unscaled run agree only up to solver tolerance, not\n bit-for-bit. Rescale if a solver reports numerical trouble, and re-check the\n tolerances if you rely on tight ones.\n- **Discrete columns stay discrete.** For binary and integer variables the\n scaling factor is stored and round-tripped, but the solver column is left as an\n ordinary integer column — scaling a discrete variable would break integrality.\n- **Choosing factors.** Aim to bring each variable's magnitude and each row's\n coefficients near 1. A good rule of thumb is to divide by the typical absolute\n value you expect. There is no single correct choice; different solvers and\n algorithms react differently (barrier methods care least; simplex and crossover\n benefit most).\n- **This is manual scaling.** You provide the factors. An automatic strategy that\n picks them for you is a natural follow-up built on top of this mechanism." } ], "metadata": {