Add gmi_dual

This commit is contained in:
2024-06-02 05:10:33 -05:00
parent 1c204d765e
commit 00fe4d07d2
7 changed files with 349 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
# Copyright (C) 2020-2024, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details.
using HiGHS
function test_cuts_tableau_gmi_dual()
mps_filename = "$BASEDIR/../fixtures/bell5.mps.gz"
h5_filename = "$BASEDIR/../fixtures/bell5.h5"
stats = collect_gmi_dual(mps_filename, optimizer = HiGHS.Optimizer)
h5 = H5File(h5_filename, "r")
try
cuts_basis_vars = h5.get_array("cuts_basis_vars")
cuts_basis_sizes = h5.get_array("cuts_basis_sizes")
cuts_rows = h5.get_array("cuts_rows")
@test size(cuts_basis_vars) == (15, 402)
@test size(cuts_basis_sizes) == (15,4)
@test size(cuts_rows) == (15,)
finally
h5.close()
end
end

View File

@@ -20,6 +20,7 @@ include("components/test_cuts.jl")
include("components/test_lazy.jl")
include("Cuts/BlackBox/test_cplex.jl")
include("Cuts/tableau/test_gmi.jl")
include("Cuts/tableau/test_gmi_dual.jl")
include("problems/test_setcover.jl")
include("problems/test_stab.jl")
include("problems/test_tsp.jl")

View File

@@ -33,7 +33,7 @@ function test_cuts()
comp = MemorizingCutsComponent(clf = clf, extractor = extractor)
solver = LearningSolver(components = [comp])
solver.fit(data_filenames)
stats = solver.optimize(
model, stats = solver.optimize(
data_filenames[1],
data -> build_stab_model_jump(data, optimizer = SCIP.Optimizer),
)

View File

@@ -36,7 +36,7 @@ function test_lazy()
comp = MemorizingLazyComponent(clf = clf, extractor = extractor)
solver = LearningSolver(components = [comp])
solver.fit(data_filenames)
stats = solver.optimize(
model, stats = solver.optimize(
data_filenames[1],
data -> build_tsp_model_jump(data, optimizer = GLPK.Optimizer),
)