Commit 1ab4b4a3 authored by Rémi's avatar Rémi
Browse files

Add more checks for presolve

parent 5d1265cc
......@@ -33,6 +33,16 @@ function presolve_a!(model::Model; presolve_time_sec_for_each_coef::Float64=Inf,
@objective(model, Max, model[:a][m])
optimize!(model)
time_for_presolve_a += solve_time(model)
if !has_values(model)
if termination_status(model) == MOI.INFEASIBLE
model[:infeasibility_proven] = true
end
model[:success_presolve] = false
unset_silent(model)
tmp_time_limit -= time_for_presolve_a
set_time_limit_sec(model, tmp_time_limit)
return model
end
a_upper_bound = 0
if termination_status(model) == MOI.TIME_LIMIT
a_upper_bound = round(Int, objective_bound(model))
......@@ -109,6 +119,16 @@ function presolve_b!(model::Model; presolve_time_sec_for_each_coef::Float64=Inf,
@objective(model, Max, model[:b][m])
optimize!(model)
time_for_presolve_b += solve_time(model)
if !has_values(model)
if termination_status(model) == MOI.INFEASIBLE
model[:infeasibility_proven] = true
end
model[:success_presolve] = false
unset_silent(model)
tmp_time_limit -= time_for_presolve_a
set_time_limit_sec(model, tmp_time_limit)
return model
end
b_upper_bound = 0
if termination_status(model) == MOI.TIME_LIMIT
b_upper_bound = round(Int, objective_bound(model))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment