Skip to content
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

Possibility to run ColumnGeneration as the top algorithm #1132

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 @@
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 @@
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!(

Check warning on line 270 in src/Algorithm/colgen.jl

View check run for this annotation

Codecov / codecov/patch

src/Algorithm/colgen.jl#L270

Added line #L270 was not covered by tests
algo::ColumnGeneration, env::Env, reform::Reformulation, input_state::OptimizationState
)
C = _colgen_context(algo)
ctx = _new_context(C, reform, algo)
result = ColGen.run!(

Check warning on line 275 in src/Algorithm/colgen.jl

View check run for this annotation

Codecov / codecov/patch

src/Algorithm/colgen.jl#L273-L275

Added lines #L273 - L275 were not covered by tests
ctx, env, GlobalPrimalBoundHandler(
reform;
ip_primal_bound = get_ip_primal_bound(input_state)
)
)

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

Check warning on line 283 in src/Algorithm/colgen.jl

View check run for this annotation

Codecov / codecov/patch

src/Algorithm/colgen.jl#L282-L283

Added lines #L282 - L283 were not covered by tests

# 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)

Check warning on line 290 in src/Algorithm/colgen.jl

View check run for this annotation

Codecov / codecov/patch

src/Algorithm/colgen.jl#L289-L290

Added lines #L289 - L290 were not covered by tests
else
setterminationstatus!(output_state, OTHER_LIMIT)

Check warning on line 292 in src/Algorithm/colgen.jl

View check run for this annotation

Codecov / codecov/patch

src/Algorithm/colgen.jl#L292

Added line #L292 was not covered by tests
end
return output_state

Check warning on line 294 in src/Algorithm/colgen.jl

View check run for this annotation

Codecov / codecov/patch

src/Algorithm/colgen.jl#L294

Added line #L294 was not covered by tests
end
Loading