Skip to content

Commit

Permalink
dev termination of preprocessing (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
guimarqu authored Sep 27, 2022
1 parent a11158d commit 37de91c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1,123 deletions.
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

0 comments on commit 37de91c

Please sign in to comment.