ERGO-Code / HiGHS

Linear optimization software
MIT License
956 stars 176 forks source link

TEST: optimality of scaled and unscaled models #494

Closed mckib2 closed 2 years ago

mckib2 commented 3 years ago

A quick scan did not reveal the case of mismatched scaled_model_status and model_status is being tested, i.e. that the correct statuses are returned and feasibility tolerances recommended. The HiGHS runner does check for this case and prints infeasibilities when it occurs.

We recently encountered this issue and found that the LP formulation of least absolute deviation (LAD) regression problems reliably recreates these sorts of models. I will attach one with random costs and constraints here if it is of interest.

model_mismatch.mps.txt

When I run with this dual simplex, it recommends re-runing with different tolerances which, when re-run, do indeed solve the unscaled model to optimality:

INFO   : Possibly re-solve with feasibility tolerances of 5e-08 primal and 1e-07 dual

Please close if this is already under test or if it's not an interesting thing to test.

jajhall commented 3 years ago

Taking action when the scaled model is solved to optimality but the unscaled model has infeasibilities is a known issue, and something that I'll look at. There's an important related issue when the scaled LP is found to be infeasible/unbounded, but there is no test of whether the same is true of the unscaled model.

mckib2 commented 2 years ago

This no longer produces the model mismatch we observed in an earlier version of the dual simplex solver. Is HiGHS now checking for this condition or did the solver just get good enough to solve this particular example without scaling issues?

jajhall commented 2 years ago

After solving the scaled LP, if there are infeasibilities in the unscaled LP, HiGHS now performs simplex iterations on the unscaled LP (using scaled numerical linear algebra) to remove the infeasibilities. Hence the issue has disappeared! 🙂

mckib2 commented 2 years ago

Fantastic, we can remove these checks from our end then and close this issue