Make cut aggressiveness configurable

This commit is contained in:
2023-01-25 12:04:43 -06:00
parent 339b20309a
commit 64101c495c
2 changed files with 7 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ using HDF5
Base.@kwdef struct CplexBlackBoxCuts Base.@kwdef struct CplexBlackBoxCuts
threads::Int = 1 threads::Int = 1
aggressive::Bool = false
end end
function _add_mip_start!(env, lp, x::Vector{Float32}) function _add_mip_start!(env, lp, x::Vector{Float32})
@@ -56,9 +57,11 @@ function collect(
CPXsetintparam(env, CPX_PARAM_THREADS, method.threads) CPXsetintparam(env, CPX_PARAM_THREADS, method.threads)
# Parameter: Make cutting plane generation more aggresive # Parameter: Make cutting plane generation more aggresive
CPXsetintparam(env, CPX_PARAM_FRACCUTS, 2) if method.aggressive
CPXsetintparam(env, CPX_PARAM_MIRCUTS, 2) CPXsetintparam(env, CPX_PARAM_FRACCUTS, 2)
CPXsetintparam(env, CPX_PARAM_ZEROHALFCUTS, 2) CPXsetintparam(env, CPX_PARAM_MIRCUTS, 2)
CPXsetintparam(env, CPX_PARAM_ZEROHALFCUTS, 2)
end
# Load problem # Load problem
lp = CPXcreateprob(env, status_p, "problem") lp = CPXcreateprob(env, status_p, "problem")

View File

@@ -17,5 +17,5 @@ function test_cuts_blackbox_cplex()
h5 = Hdf5Sample(h5_filename) h5 = Hdf5Sample(h5_filename)
rhs = h5.get_array("cuts_cpx_rhs") rhs = h5.get_array("cuts_cpx_rhs")
h5.file.close() h5.file.close()
@test length(rhs) == 22 @test length(rhs) > 0
end end