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

Preprocessing algorithm will be replaced by Presolve #728

Merged
merged 2 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
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
7 changes: 1 addition & 6 deletions src/Algorithm/Algorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ include("basic/cutcallback.jl")
include("colgenstabilization.jl")
include("colgen.jl")
include("benders.jl")
include("preprocessing.jl")

# Presolve
include("presolve/interface.jl")
Expand Down Expand Up @@ -83,7 +82,7 @@ export getterminationstatus, setterminationstatus!,

# Algorithms
export TreeSearchAlgorithm, ColCutGenConquer, ColumnGeneration, BendersConquer, BendersCutGeneration, SolveIpForm, RestrictedMasterIPHeuristic,
SolveLpForm, PreprocessAlgorithm, NoBranching, Branching, StrongBranching, AbstractSelectionCriterion,
SolveLpForm, NoBranching, Branching, StrongBranching, AbstractSelectionCriterion,
FirstFoundCriterion, MostFractionalCriterion, SingleVarBranchingRule

# Algorithm's types
Expand All @@ -93,8 +92,4 @@ export AbstractOptimizationAlgorithm,
# Types of optimizers
export MoiOptimize, UserOptimizer

# Units
export PreprocessingUnit


end
11 changes: 6 additions & 5 deletions src/Algorithm/conquer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ Parameters :
stages::Vector{ColumnGeneration} = [ColumnGeneration()]
primal_heuristics::Vector{ParameterizedHeuristic} = [ParamRestrictedMasterHeuristic()]
node_finalizer::Union{Nothing, NodeFinalizer} = nothing
preprocess = PreprocessAlgorithm()
preprocess = nothing
cutgen = CutCallbacks()
max_nb_cut_rounds::Int = 3 # TODO : tailing-off ?
run_preprocessing::Bool = false
opt_atol::Float64 = stages[1].opt_atol # TODO : force this value in an init() method
opt_rtol::Float64 = stages[1].opt_rtol # TODO : force this value in an init() method
end
Expand All @@ -120,7 +119,9 @@ function get_child_algorithms(algo::ColCutGenConquer, reform::Reformulation)
push!(child_algos, (colgen, reform))
end
push!(child_algos, (algo.cutgen, getmaster(reform)))
algo.run_preprocessing && push!(child_algos, (algo.preprocess, reform))
if !isnothing(algo.preprocess)
push!(child_algos, (algo.preprocess, reform))
end
for heuristic in algo.primal_heuristics
push!(child_algos, (heuristic.algorithm, reform))
end
Expand Down Expand Up @@ -256,7 +257,7 @@ Returns `true` if conquer algorithm should continue;
`false` otherwise (in the case where preprocessing finds the formulation infeasible).
"""
function run_preprocessing!(::ColCutGenContext, preprocess_algo, env, reform, node_state)
preprocess_output = run!(preprocess_algo, env, reform, PreprocessingInput())
preprocess_output = run!(preprocess_algo, env, reform, nothing)
if isinfeasible(preprocess_output)
setterminationstatus!(node_state, INFEASIBLE)
return false
Expand Down Expand Up @@ -314,7 +315,7 @@ function run_colcutgen_conquer!(ctx::ColCutGenContext, env, reform, input)
node_state = get_opt_state(node)

# TODO: check time limit of Coluna
if ctx.params.run_preprocessing
if !isnothing(ctx.params.preprocess)
run_conquer = run_preprocessing!(ctx, ctx.params.preprocess, env, reform, node_state)
!run_conquer && return
end
Expand Down
Loading