failure with infinite cost handling in LP resolve at MIP root
Closed this issue · 6 comments
With HiGHS 1.6.0, I get
Running HiGHS 1.6.0: Copyright (c) 2023 HiGHS under MIT licence terms
Number of BV entries in BOUNDS section is 2
18 |cost| values greater than or equal to 1e+20 are treated as Infinity
MIP infcost has 44 rows; 109 cols; 249 nonzeros; 2 integer variables
Presolving model
41 rows, 86 cols, 206 nonzeros
37 rows, 78 cols, 190 nonzeros
Solving MIP model with:
37 rows
78 cols (0 binary, 0 integer, 0 implied int., 78 continuous)
190 nonzeros
Nodes | B&B Tree | Objective Bounds | Dynamic Constraints | Work
Proc. InQueue | Leaves Expl. | BestBound BestSol Gap | Cuts InLp Confl. | LpIters Time
0 0 0 0.00% -0.7494863234 inf inf 0 0 0 0 0.0s
highs: HiGHS/src/lp_data/Highs.cpp:828: HighsStatus Highs::run(): Assertion `model_.lp_.hasInfiniteCost(options_.infinite_cost)' failed.
Aborted (core dumped)
with infcost.mps.txt
I know the objective coefficients are bad (DICOPT does not take care of the penalty terms it generates).
But with asserts disabled, I get a segfault on windows and on Linux valgrind complains because iCol is out of range in Highs::restoreInfCost()
. So it would be nice if that could be handled better somehow.
I can see what's causing this. Simple fix
Not such a simple fix!
Note to self: still need the following in fix-1446
- Method to identify whether an LP needs mods - to return error from
Highs::presolve()
- Method to identify whether there are any mods - for assert in
Highs::postsolve()
- Track whether mods are made in run(), and pass truth of this to
Highs::returnFromRun()
so that undoing of mods is done or not done.
Thank you! Looks good.
It's only recently that HiGHS has been able to handle infinite costs. There's no guarantee that a solution is found, as all HiGHS does is fix the variable at the bound corresponding to the sign of the infinite cost and sense of optimization. If the modified problem is infeasible, then a warning is returned and the model status is kUnknown
.
I note that Gurobi finds your model to be infeasible or unbounded, observing
Model contains large objective coefficients
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
That's fine. It's good that HiGHS prints a warning there.
The MIP was generated by DICOPT when doing an outer-approximation for a MINLP. It adds linearizations of nonlinear constraints to the MIP as "soft-constraints", i.e., violation is allowed by a penalty term. The penalty coefficient is derived from the dual solution of the NLP. In this case, Ipopt was solving the NLP and seemed to have had some problem (solve to acceptable level only), which may have resulted in an awkward dual solution. It's pretty bad that DICOPT does not check the dual solution of the NLP, but just blindly uses it to augment the MIP objective function. So, I don't care so much whether that MIP is solved correct in any interpretation, but a segfault was something that made our tests fail and I cannot easily argue that it should be ignored :).