Tiny difference in Z when I was expecting none

24 views
Skip to first unread message

Ellen Fowler

unread,
Sep 2, 2021, 4:22:39 PM9/2/21
to AMPL Modeling Language
Hello AMPL world,

I have a large continuous LP: about 42 million variables (none integer) and 32 million constraints. Its objective value is in the neighbourhood of 1.5 billion.

A  new version of the model is under development and I have added one unit of production to the current four (these units of production are all different) but I have made the values of the parameters that characterize the fifth unit such that it is effectively removed from the model. This is to ensure that the old version of the model with four units and the new version with five units of which one is "out of commission" produce equivalent solutions, after which I will fully implement the fifth unit of production.

The two objective values are 16 apart. That is, the new model with the non-functioning fifth unit gives me 16 less objective value. Out of 1.5 billion, that's 0.00000104% less.

Is this difference likely due only to rounding error during all the algorithm's arithmetic and is it therefore safe to assume my models are equivalent? Or is there still a genuine difference in the models that is hiding from me?

Thank you,
Ellen

Ellen Fowler

unread,
Sep 3, 2021, 11:13:39 AM9/3/21
to AMPL Modeling Language
Forgot to mention, if it matters, that I am solving with Cplex.
Ellen

AMPL Google Group

unread,
Sep 3, 2021, 11:46:12 AM9/3/21
to AMPL Modeling Language
A difference of 16 in an objective value of about 1.5 x 10^9 would not normally be considered significant. Most likely, both solutions could be shown to be optimal to both versions of the model to within CPLEX's optimality tolerance.

The only exception I can think of is where the terms summed in the objective function are vastly different in scale, so that a change of one term from, say, 10 to 26 might reflect a significant difference in the solution, even though it represents a negligible difference in the overall objective. You can check for this case by looking separately at the values of different parts of the objective (which is easy to do with "display" statements).


--
Robert Fourer
am...@googlegroups.com
{#HS:1620048988-106153#}
On Fri, Sep 3, 2021 at 3:13 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Forgot to mention, if it matters, that I am solving with Cplex.
Ellen

Ellen Fowler

unread,
Sep 3, 2021, 12:58:26 PM9/3/21
to AMPL Modeling Language
Just so I'm sure I understand, Bob, when you say it wouldn't be considered significant, are you also saying the cause of the difference would be floating point error?

The amount certainly isn't practically significant to my model but I want to be sure it isn't caused by differences in the models.

Ellen Fowler

unread,
Sep 3, 2021, 1:35:35 PM9/3/21
to AMPL Modeling Language
Again I forgot to say . . .
The terms of the objective function are of similar magnitude.

On Thursday, 2 September 2021 at 13:22:39 UTC-7 Ellen Fowler wrote:

AMPL Google Group

unread,
Sep 7, 2021, 3:19:51 PM9/7/21
to AMPL Modeling Language
I guess the root cause of the difference is floating-point inaccuracy (sometimes called rounding error). However, that inaccuracy has led solver designers to incorporate tolerances for feasibility and optimality. Thus the immediate cause of the difference may be that there are multiple very-close solutions that are optimal within the tolerances; then, because the problems conveyed to CPLEX were equivalent but not exactly the same, CPLEX could have ended up at two slightly different solutions that could both be accepted as optimal.

It's hard to absolutely rule out that there's something actually wrong with the new version that's causing the very slight different in the objective. I would say that this is the least likely cause, however. To reassure yourself, you could compare the optimal values of the variables to see whether there are any values out of line in the new version.


--
Robert Fourer
am...@googlegroups.com
{#HS:1620048988-106153#}
On Fri, Sep 3, 2021 at 5:35 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Again I forgot to say . . .
The terms of the objective function are of similar magnitude.

On Fri, Sep 3, 2021 at 4:58 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Just so I'm sure I understand, Bob, when you say it wouldn't be considered significant, are you also saying the cause of the difference would be floating point error?

The amount certainly isn't practically significant to my model but I want to be sure it isn't caused by differences in the models.

On Fri, Sep 3, 2021 at 3:34 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
A difference of 16 in an objective value of about 1.5 x 10^9 would not normally be considered significant. Most likely, both solutions could be shown to be optimal to both versions of the model to within CPLEX's optimality tolerance.

The only exception I can think of is where the terms summed in the objective function are vastly different in scale, so that a change of one term from, say, 10 to 26 might reflect a significant difference in the solution, even though it represents a negligible difference in the overall objective. You can check for this case by looking separately at the values of different parts of the objective (which is easy to do with "display" statements).


--
Robert Fourer
am...@googlegroups.com
On Fri, Sep 3, 2021 at 3:13 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Forgot to mention, if it matters, that I am solving with Cplex.
Ellen

Reply all
Reply to author
Forward
0 new messages