diff --git a/ortools/sat/cp_model_presolve.cc b/ortools/sat/cp_model_presolve.cc index d13fc71b19..35e0a2a9dc 100644 --- a/ortools/sat/cp_model_presolve.cc +++ b/ortools/sat/cp_model_presolve.cc @@ -13707,6 +13707,7 @@ namespace { void UpdateHintInProto(PresolveContext* context) { CpModelProto* proto = context->working_model; if (!proto->has_solution_hint()) return; + if (context->ModelIsUnsat()) return; // Extract the new hint information from the context. auto* mutable_hint = proto->mutable_solution_hint(); diff --git a/ortools/sat/scheduling_cuts.cc b/ortools/sat/scheduling_cuts.cc index ff61542625..cee4ec0ab5 100644 --- a/ortools/sat/scheduling_cuts.cc +++ b/ortools/sat/scheduling_cuts.cc @@ -718,6 +718,7 @@ CutGenerator CreateCumulativeTimeTableCutGenerator( TopNCuts top_n_cuts(5); std::vector events; const auto& lp_values = manager->LpValues(); + if (lp_values.empty()) return true; // No linear relaxation. const double capacity_lp = capacity.LpValue(lp_values); // Iterate through the intervals. If start_max < end_min, the demand