diff --git a/src/Algorithm/colgen/printer.jl b/src/Algorithm/colgen/printer.jl index 0d5fdfabf..6cf3a5c88 100644 --- a/src/Algorithm/colgen/printer.jl +++ b/src/Algorithm/colgen/printer.jl @@ -119,6 +119,7 @@ end function _colgen_iter_str( colgen_iteration, colgen_iter_output::ColGenIterationOutput, phase::Int, sp_time::Float64, mst_time::Float64, optim_time::Float64 ) + phase_string = " " if phase == 1 phase_string = "# " @@ -126,7 +127,13 @@ function _colgen_iter_str( phase_string = "##" end iteration::Int = colgen_iteration - + + if colgen_iter_output.new_cut_in_master + return @sprintf( + "%s - new essential cut in master", + phase_string, iteration, optim_time + ) + end if colgen_iter_output.infeasible_master return @sprintf( "%s - infeasible master", diff --git a/src/ColGen/interface.jl b/src/ColGen/interface.jl index a37ad3652..d943de5ce 100644 --- a/src/ColGen/interface.jl +++ b/src/ColGen/interface.jl @@ -270,7 +270,7 @@ function run_colgen_iteration!(context, phase, env, ip_primal_sol) # memoization to calculate reduced costs and stabilization. new_ip_primal_sol, new_cut_in_master = check_primal_ip_feasibility!(mast_primal_sol, context, phase, get_reform(context), env) if new_cut_in_master - return new_iteration_output(O, is_min_sense, nothing, nothing, 0, true, false, false, false, false, false, nothing, ip_primal_sol, nothing) + return new_iteration_output(O, is_min_sense, nothing, nothing, 0, true, false, false, false, false, false, nothing, nothing, nothing) end if !isnothing(new_ip_primal_sol) && isbetter(new_ip_primal_sol, ip_primal_sol) ip_primal_sol = new_ip_primal_sol diff --git a/test/e2e_extra/gap/gap.jl b/test/e2e_extra/gap/gap.jl index 34552ae91..9c6171307 100644 --- a/test/e2e_extra/gap/gap.jl +++ b/test/e2e_extra/gap/gap.jl @@ -254,7 +254,7 @@ function gap_with_lazy_cuts() @test JuMP.objective_value(model) ≈ 75.0 @test JuMP.termination_status(model) == MOI.OPTIMAL end -register!(e2e_extra_tests, "gap", gap_with_lazy_cuts; x = true) +register!(e2e_extra_tests, "gap", gap_with_lazy_cuts) function gap_with_best_dual_bound() data = ClD.GeneralizedAssignment.data("play2.txt") diff --git a/test/unit/ColGen/colgen_printer.jl b/test/unit/ColGen/colgen_printer.jl index 96e547791..18bb0e055 100644 --- a/test/unit/ColGen/colgen_printer.jl +++ b/test/unit/ColGen/colgen_printer.jl @@ -134,9 +134,9 @@ register!(unit_tests, "colgen_printer", printer_colgen_iteration_pricing_unbound function printer_colgen_new_cuts_in_master() output = Coluna.Algorithm.ColGenIterationOutput( true, - 22.5, - 22.5 - 23/4, - 1, + nothing, + nothing, + 0, true, false, false, @@ -147,9 +147,8 @@ function printer_colgen_new_cuts_in_master() nothing, nothing ) - expected_str = " " + expected_str = " - new essential cut in master" str = Coluna.Algorithm._colgen_iter_str(1, output, 3, 0.12, 1.23, 2.34) @test expected_str == str end register!(unit_tests, "colgen_printer", printer_colgen_new_cuts_in_master) -