Skip to content

Possibility to run ColumnGeneration as the top algorithm #1132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/Algorithm/colgen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ function _colgen_optstate_output(result, master)
return optstate
end

# run!() function to be called from the ColGenConquer algorithm
function run!(algo::ColumnGeneration, env::Env, reform::Reformulation, input::AbstractConquerInput)
# We build
C = _colgen_context(algo)
Expand All @@ -264,3 +265,31 @@ function run!(algo::ColumnGeneration, env::Env, reform::Reformulation, input::Ab
master = getmaster(reform)
return _colgen_optstate_output(result, master)
end

# run!() function to be called from optimize!(), i.e. when ColumnGeneration is the top Coluna algorithm
function run!(
algo::ColumnGeneration, env::Env, reform::Reformulation, input_state::OptimizationState
)
C = _colgen_context(algo)
ctx = _new_context(C, reform, algo)
result = ColGen.run!(
ctx, env, GlobalPrimalBoundHandler(
reform;
ip_primal_bound = get_ip_primal_bound(input_state)
)
)

master = getmaster(reform)
output_state = _colgen_optstate_output(result, master)

# if !isnothing(get_global_primal_sol(space.inc_primal_manager))
# add_ip_primal_sol!(space.optstate, get_global_primal_sol(space.inc_primal_manager))
# end

if ip_gap_closed(output_state, rtol = algo.opt_rtol, atol = algo.opt_atol)
setterminationstatus!(output_state, OPTIMAL)
else
setterminationstatus!(output_state, OTHER_LIMIT)
end
return output_state
end