Skip to content

Commit d57aaa6

Browse files
committed
Better infeasibility detection
1 parent 9f7beea commit d57aaa6

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

highs/ipm/hipo/ipm/Solver.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -997,18 +997,27 @@ bool Solver::checkBadIter() {
997997
// check for infeasibility
998998
bool mu_is_large =
999999
it_->best_mu > 0.0 ? it_->mu > it_->best_mu * kDivergeTol : false;
1000-
bool pobj_is_large =
1001-
it_->pobj < -std::max(std::abs(it_->dobj) * kDivergeTol, 1.0);
1002-
bool dobj_is_large =
1003-
it_->dobj > std::max(std::abs(it_->pobj) * kDivergeTol, 1.0);
1004-
1005-
if (too_many_bad_iter || mu_is_large) {
1006-
if (pobj_is_large) {
1000+
bool pobj_is_very_large =
1001+
it_->pobj <
1002+
-std::max(std::abs(it_->dobj) * kDivergeTol * kDivergeTol, 1.0);
1003+
bool dobj_is_very_large =
1004+
it_->dobj >
1005+
std::max(std::abs(it_->pobj) * kDivergeTol * kDivergeTol, 1.0);
1006+
bool clearly_infeasible =
1007+
iter_ > 5 && (pobj_is_very_large || dobj_is_very_large);
1008+
1009+
if (too_many_bad_iter || mu_is_large || clearly_infeasible) {
1010+
bool pobj_is_larger =
1011+
it_->pobj < -std::max(std::abs(it_->dobj) * kDivergeTol, 1.0);
1012+
bool dobj_is_larger =
1013+
it_->dobj > std::max(std::abs(it_->pobj) * kDivergeTol, 1.0);
1014+
1015+
if (pobj_is_larger) {
10071016
// problem is likely to be primal unbounded, i.e. dual infeasible
10081017
logH_.print("=== Dual infeasible\n");
10091018
info_.status = kStatusDualInfeasible;
10101019
terminate = true;
1011-
} else if (dobj_is_large) {
1020+
} else if (dobj_is_larger) {
10121021
// problem is likely to be dual unbounded, i.e. primal infeasible
10131022
logH_.print("=== Primal infeasible\n");
10141023
info_.status = kStatusPrimalInfeasible;

0 commit comments

Comments
 (0)