@@ -1774,7 +1774,6 @@ HighsStatus Highs::getPrimalRayInterface(bool& has_primal_ray,
17741774 this ->getOptionValue (" allow_unbounded_or_infeasible" ,
17751775 allow_unbounded_or_infeasible);
17761776 solve_unboundedness_problem = true ;
1777- lp.integrality_ .clear ();
17781777 this ->setOptionValue (" presolve" , kHighsOffString );
17791778 this ->setOptionValue (" solve_relaxation" , true );
17801779 this ->setOptionValue (" allow_unbounded_or_infeasible" , false );
@@ -1835,14 +1834,21 @@ HighsStatus Highs::getPrimalRayInterface(bool& has_primal_ray,
18351834 return_status = HighsStatus::kOk ;
18361835 }
18371836 }
1837+ const bool is_mip = this ->model_ .isMip ();
18381838 if (solve_unboundedness_problem) {
1839+ if (is_mip) {
1840+ // Unboundedness LP has been solved, but that will give dual
1841+ // solution status kInfeasible which, for a MIP is not correct
1842+ this ->info_ .dual_solution_status = SolutionStatus::kSolutionStatusNone ;
1843+ this ->info_ .invalidateDualKkt ();
1844+ }
18391845 // Restore the option values
18401846 this ->setOptionValue (" presolve" , presolve);
18411847 this ->setOptionValue (" solve_relaxation" , solve_relaxation);
18421848 this ->setOptionValue (" allow_unbounded_or_infeasible" ,
18431849 allow_unbounded_or_infeasible);
18441850 if (has_primal_ray) {
1845- assert (this ->info_ .num_dual_infeasibilities > 0 );
1851+ assert (is_mip || this ->info_ .num_dual_infeasibilities > 0 );
18461852 assert (this ->model_status_ == HighsModelStatus::kUnbounded );
18471853 }
18481854 }
@@ -2602,7 +2608,8 @@ HighsStatus Highs::lpKktCheck(const std::string& message) {
26022608 primal_dual_errors, get_residuals);
26032609 // highsLogUser(options.log_options, HighsLogType::kInfo,
26042610 // "Highs::lpKktCheck: %s\n", message.c_str());
2605- reportLpKktFailures (model_.lp_ , options, info, " LP" );
2611+ if (this ->model_status_ == HighsModelStatus::kOptimal )
2612+ reportLpKktFailures (model_.lp_ , options, info, " LP" );
26062613 // get_residuals is false when there is a valid basis, since
26072614 // residual errors are assumed to be small, so
26082615 // info.num_primal_residual_errors = -1, since they aren't
0 commit comments