Skip to content

Commit 5ab516b

Browse files
committed
HiGHS: populate variable values when status is FEASIBLE
1 parent 821ce39 commit 5ab516b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ortools/linear_solver/proto_solver/highs_proto_solver.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ absl::StatusOr<MPSolutionResponse> HighsSolveProto(
282282
response.mutable_solve_info()->set_solve_user_time_seconds(
283283
absl::ToDoubleSeconds(user_timer.GetDuration()));
284284

285-
if (response.status() == MPSOLVER_OPTIMAL) {
285+
if (response.status() == MPSOLVER_OPTIMAL || response.status() == MPSOLVER_FEASIBLE) {
286286
double objective_value = highs.getObjectiveValue();
287287
response.set_objective_value(objective_value);
288288
response.set_best_objective_bound(objective_value);
@@ -302,7 +302,7 @@ absl::StatusOr<MPSolutionResponse> HighsSolveProto(
302302
}
303303
}
304304

305-
if (!has_integer_variables && model.general_constraint_size() == 0) {
305+
if (response.status() == MPSOLVER_OPTIMAL && !has_integer_variables && model.general_constraint_size() == 0) {
306306
response.mutable_dual_value()->Resize(model.constraint_size(), 0);
307307
for (int row = 0; row < model.constraint_size(); row++) {
308308
response.set_dual_value(row, highs.getSolution().row_value[row]);

0 commit comments

Comments
 (0)