! An example model with data inaccuracies and
redundant constraints;
! Keywords: Roundoff error;
MAX = Z;
[C1] X - 6*Z = 1;
[C2] 0.33333333*X - 2*Z = 0.33333333;
![C2A] 0.3333333*X - 2*Z = 0.3333333;
![C2B] X/3 - 2*Z = 1/3;
@BIN( Z);
! Roundoff error, redundacies, etc.
Many optimization models contain minor data inaccuracies and/or
minor redundancies.
These may cause solution reports that contain numbers like -0.60E-07 .
There are several ways for avoiding such solution reports:
1) Easy way: Change the reporting precision by clicking on:
Solver | Options | Interface | Show as 0 | 0.000001
Solver | Options | Interface | Precision | 6
Then instead of getting a solution report like this:
Variable Value Reduced Cost
Z 1.000000 -1.000000
X 7.000000 0.000000
Row Slack or Surplus Dual Price
1 1.000000 1.000000
2 -0.6000000E-07 0.000000
3 0.000000 0.000000
you will get one like this:
Variable Value Reduced Cost
Z 1.00000 -1.00000
X 7.00000 0.00000
Row Slack or Surplus Dual Price
1 1.00000 1.00000
2 0.00000 0.00000
3 0.00000 0.00000
2) Better way: Improve the precision of the input.
It seems clear that constraint [C2B] is a more precise
statement of [C2]. If you replace [C2] by [C2B] you get:
Variable Value Reduced Cost
Z 1.000000 -1.000000
X 7.000000 0.000000
Row Slack or Surplus Dual Price
1 1.000000 1.000000
C1 0.000000 0.000000
C2B 0.000000 0.000000
3) Better yet, remove redundancies. If you multiply [C2B]
by 3, we see it is identical to [C1], so it can be dropped.
If you have two constraints that are almost redundant, but not
quite because of data inaccuracies, this is a challenge for
the solver and you may get surprising answers.
If, for example, you replace [C2] and [C2B] by [C2A], you get:
Variable Value Reduced Cost
Z 0.000000 -1.000000
X 1.000000 0.000000
Row Slack or Surplus Dual Price
1 0.000000 1.000000
C1 0.000000 0.000000
C2A 0.000000 0.000000
i.e., the solution with Z = 1 is no longer considered feasible to tolerances.
4) Another way, loosen or tighten tolerances of the solver,
e.g., click on either/both:
Solver | Options | Integer solver | Integrality ...
Solver | Options | Linear solver | Final feasibility ...
Setting tolerances tighter may: a) increase solve time,
b) cause solver to reject a solution you
consider acceptable.
Setting tolerances looser may: a) reduce solve time,
b) cause solver to give a solution you do not
consider feasible.;
|