FisSal2011: Large LP: Add cuts in small batches

fs11_01
Alinson S. Xavier 2 months ago
parent e2906a0a7e
commit 9713873a34

@ -608,7 +608,7 @@ function collect_gmi_FisSal2011(
end
@timeit "Computing cut violations" begin
violations = (pool.lb' - (sol_frac' * pool.lhs))'
violations = pool.lb - pool.lhs' * sol_frac
end
@timeit "Sorting cut violations" begin
@ -619,11 +619,15 @@ function collect_gmi_FisSal2011(
break
end
@timeit "Add constraint to the model" begin
push!(selected_idx, σ[1])
cut_lhs = pool.lhs[:, σ[1]]
@timeit "Add constraints to the model" begin
ncuts = min(max(1, sum(violations .> 1e-6) ÷ 10), length(σ))
for i in 1:ncuts
if violations[σ[i]] <= 1e-6
break
end
cut_lhs = pool.lhs[:, σ[i]]
cut_lhs_value = 0.0
cut_lb = pool.lb[σ[1]]
cut_lb = pool.lb[σ[i]]
cut_expr = AffExpr()
for offset in 1:nnz(cut_lhs)
var_idx = cut_lhs.nzind[offset]
@ -635,9 +639,11 @@ function collect_gmi_FisSal2011(
cut_lhs_value += sol_frac[var_idx] * cut_lhs.nzval[offset]
end
cut_constr = @constraint(model_s, cut_expr >= cut_lb)
push!(selected_idx, σ[i])
push!(selected_contrs, cut_constr)
end
end
end
@timeit "Find dual values for all selected cuts" begin
multipliers_curr .= 0

Loading…
Cancel
Save