Skip to content

Commit 84f4bb5

Browse files
committed
Add single presolve option to MIP race
1 parent 7d4c8be commit 84f4bb5

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

highs/mip/HighsMipSolverData.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,8 +1400,9 @@ bool HighsMipSolverData::addIncumbent(const std::vector<double>& sol,
14001400
get_transformed_solution ? transformNewIntegerFeasibleSolution(
14011401
sol, possibly_store_as_new_incumbent)
14021402
: 0;
1403-
/*
1403+
const bool highs_solution_report = true;
14041404
if (solution_source == kSolutionSourceHighsSolution
1405+
&& highs_solution_report
14051406
//&& possibly_store_as_new_incumbent
14061407
) {
14071408
highsLogUser(mipsolver.options_mip_->log_options, HighsLogType::kInfo,
@@ -1414,7 +1415,6 @@ bool HighsMipSolverData::addIncumbent(const std::vector<double>& sol,
14141415
transformed_solobj < upper_bound ? "T" : "F");
14151416
fflush(stdout);
14161417
}
1417-
*/
14181418
if (possibly_store_as_new_incumbent) {
14191419
solobj = transformed_solobj;
14201420
if (solobj >= upper_bound) return false;
@@ -2729,20 +2729,19 @@ void HighsMipSolverData::queryExternalSolution(
27292729
// Reduced solution can be infeasible if restart has been
27302730
// performed
27312731
if (!checkSolution(reduced_instance_solution)) {
2732-
/*
2733-
highsLogUser(
2734-
mipsolver.options_mip_->log_options, HighsLogType::kWarning,
2735-
"Solution from instance %2d is not feasible for instance %2d\n",
2736-
int(instance), int(mip_race.my_instance));
2737-
*/
2732+
const bool feasibility_warning = true;
2733+
if (feasibility_warning) {
2734+
highsLogUser(mipsolver.options_mip_->log_options, HighsLogType::kWarning,
2735+
"Solution from instance %2d is not feasible for instance %2d\n",
2736+
int(instance), int(mip_race.my_instance));
2737+
}
27382738
continue;
27392739
}
2740-
2741-
2742-
double reduced_instance_objective_value = 0;
2740+
HighsCDouble reduced_instance_quad_objective_value = 0;
27432741
for (HighsInt iCol = 0; iCol < mipsolver.model_->num_col_; iCol++)
2744-
reduced_instance_objective_value +=
2745-
mipsolver.colCost(iCol) * reduced_instance_solution[iCol];
2742+
reduced_instance_quad_objective_value +=
2743+
mipsolver.colCost(iCol) * reduced_instance_solution[iCol];
2744+
double reduced_instance_objective_value = double(reduced_instance_quad_objective_value);
27462745
addIncumbent(reduced_instance_solution, reduced_instance_objective_value,
27472746
kSolutionSourceHighsSolution);
27482747
}

0 commit comments

Comments
 (0)