FFFF
Skip to content
Draft
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
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "1.0.0-DEV"
BendersBase = "5d493250-739e-4f20-9003-5efb7f1b28da"
BendersLibrary = "c2345678-f90a-1234-5678-901234567890"
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

Expand Down
21 changes: 21 additions & 0 deletions experiments/1_test_sequential_typical/cfl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ using CPLEX
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Unified oracle" begin
@info "solving CFLP p$i - unified oracle - seq..."
master = Master(data; customize = customize_master_model!)
oracle = UnifiedOracle(data, master; customize = customize_sub_model!)
env = BendersSeq(master, oracle; param = benders_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Classic oracle with GBC" begin
@info "solving CFLP p$i - classical oracle with GBC - seq..."
master = Master(data; customize = customize_master_model!)
Expand All @@ -85,6 +95,17 @@ using CPLEX
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Pareto oracle" begin
@info "solving CFLP p$i - pareto oracle - seq..."
master = Master(data; customize = customize_master_model!)
param = ParetoOracleParam(fill(1.0, data.n_facilities))
oracle = ParetoOracle(data, master, param; customize = customize_sub_model!)
env = BendersSeq(master, oracle; param = benders_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end
21 changes: 21 additions & 0 deletions experiments/1_test_sequential_typical/scfl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ using CPLEX
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Unified oracle" begin
@info "solving SCFLP f25-c50-s64-r10-$i - unified oracle - seq..."
master = Master(data; customize = customize_master_model!)
oracle = SeparableOracle(data, master, UnifiedOracle(), data.n_scenarios; customize = customize_sub_model!, sub_oracle_param = UnifiedOracleParam())
env = BendersSeq(master, oracle; param = benders_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Classic oracle with GBC" begin
@info "solving SCFLP f25-c50-s64-r10-$i - classical oracle with GBC - seq..."
master = Master(data; customize = customize_master_model!)
Expand All @@ -86,6 +96,17 @@ using CPLEX
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Pareto oracle" begin
@info "solving SCFLP f25-c50-s64-r10-$i - pareto oracle - seq..."
master = Master(data; customize = customize_master_model!)
param = ParetoOracleParam(fill(1.0, data.n_facilities))
oracle = SeparableOracle(data, master, ParetoOracle(), data.n_scenarios; customize = customize_sub_model!, sub_oracle_param = param)
env = BendersSeq(master, oracle; param = benders_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end
21 changes: 21 additions & 0 deletions experiments/1_test_sequential_typical/snip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,27 @@ using JuMP
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Pareto oracle" begin
@info "solving SNIP instance-$instance snipno-$snipno budget-$budget - pareto oracle - seq..."
master = Master(data; customize = customize_master_model!)
param = ParetoOracleParam(fill(1.0, length(data.D)))
oracle = SeparableOracle(data, master, ParetoOracle(), data.num_scenarios; customize = customize_sub_model!, sub_oracle_param = param)
env = BendersSeq(master, oracle; param = benders_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Unified oracle" begin
@info "solving SNIP instance-$instance snipno-$snipno budget-$budget - unified oracle - seq..."
master = Master(data; customize = customize_master_model!)
oracle = SeparableOracle(data, master, UnifiedOracle(), data.num_scenarios; customize = customize_sub_model!, sub_oracle_param = UnifiedOracleParam())
env = BendersSeq(master, oracle; param = benders_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end
21 changes: 21 additions & 0 deletions experiments/1_test_sequential_typical/ufl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ using CPLEX
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Unified oracle" begin
@info "solving UFLP p$i - unified oracle - seq..."
master = Master(data; customize = customize_master_model!)
oracle = UnifiedOracle(data, master; customize = customize_sub_model!)
env = BendersSeq(master, oracle; param = benders_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Classic oracle with GBC" begin

@info "solving UFLP p$i - classical oracle with GBC - seq..."
2925 Expand Down Expand Up @@ -98,6 +108,17 @@ using CPLEX

# To test slim version, users can use # set_parameter!(oracle, "slim", true)
end

@testset "Pareto oracle" begin
@info "solving UFLP p$i - pareto oracle - seq..."
master = Master(data; customize = customize_master_model!)
param = ParetoOracleParam(fill(1.0, data.n_facilities))
oracle = ParetoOracle(data, master, param; customize = customize_sub_model!)
env = BendersSeq(master, oracle; param = benders_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end
21 changes: 21 additions & 0 deletions experiments/2_test_sequential_in_out_typical/cfl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ using CPLEX
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Unified oracle" begin
@info "solving CFLP p$i - unified oracle - seqInOut..."
master = Master(data; customize = customize_master_model!)
oracle = UnifiedOracle(data, master; customize = customize_sub_model!)
env = BendersSeqInOut(master, oracle; param = benders_inout_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Classic oracle with GBC" begin
@info "solving CFLP p$i - classical oracle with GBC - seqInOut..."
master = Master(data; customize = customize_master_model!)
Expand All @@ -88,6 +98,17 @@ using CPLEX
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Pareto oracle" begin
@info "solving CFLP p$i - pareto oracle - seqInOut..."
master = Master(data; customize = customize_master_model!)
param = ParetoOracleParam(fill(1.0, data.n_facilities))
oracle = ParetoOracle(data, master, param; customize = customize_sub_model!)
env = BendersSeqInOut(master, oracle; param = benders_inout_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end
21 changes: 21 additions & 0 deletions experiments/2_test_sequential_in_out_typical/scfl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ using CPLEX
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Unified oracle" begin
@info "solving SCFLP f25-c50-s64-r10-$i - unified oracle - seqInOut..."
master = Master(data; customize = customize_master_model!)
oracle = SeparableOracle(data, master, UnifiedOracle(), data.n_scenarios; customize = customize_sub_model!, sub_oracle_param = UnifiedOracleParam())
env = BendersSeqInOut(master, oracle; param = benders_inout_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Classic oracle with GBC" begin
@info "solving SCFLP f25-c50-s64-r10-$i - classical oracle with GBC - seqInOut..."
master = Master(data; customize = customize_master_model!)
Expand All @@ -84,6 +94,17 @@ using CPLEX
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Pareto oracle" begin
@info "solving SCFLP f25-c50-s64-r10-$i - pareto oracle - seqInOut..."
master = Master(data; customize = customize_master_model!)
param = ParetoOracleParam(fill(1.0, data.n_facilities))
oracle = SeparableOracle(data, master, ParetoOracle(), data.n_scenarios; customize = customize_sub_model!, sub_oracle_param = param)
env = BendersSeqInOut(master, oracle; param = benders_inout_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end
21 changes: 21 additions & 0 deletions experiments/2_test_sequential_in_out_typical/snip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ using JuMP
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Pareto oracle" begin
@info "solving SNIP instance-$instance snipno-$snipno budget-$budget - pareto oracle - seqInOut..."
master = Master(data; customize = customize_master_model!)
param = ParetoOracleParam(fill(1.0, length(data.D)))
oracle = SeparableOracle(data, master, ParetoOracle(), data.num_scenarios; customize = customize_sub_model!, sub_oracle_param = param)
env = BendersSeqInOut(master, oracle; param = benders_inout_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Unified oracle" begin
@info "solving SNIP instance-$instance snipno-$snipno budget-$budget - unified oracle - seqInOut..."
master = Master(data; customize = customize_master_model!)
oracle = SeparableOracle(data, master, UnifiedOracle(), data.num_scenarios; customize = customize_sub_model!, sub_oracle_param = UnifiedOracleParam())
env = BendersSeqInOut(master, oracle; param = benders_inout_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end
21 changes: 21 additions & 0 deletions experiments/2_test_sequential_in_out_typical/ufl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ using CPLEX
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Unified oracle" begin
@info "solving UFLP p$i - unified oracle - seqInOut..."
master = Master(data; customize = customize_master_model!)
oracle = UnifiedOracle(data, master; customize = customize_sub_model!)
env = BendersSeqInOut(master, oracle; param = benders_inout_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end

@testset "Classic oracle with GBC" begin
@info "solving UFLP p$i - classical oracle with GBC - seqInOut..."
master = Master(data; customize = customize_master_model!)
Expand Down Expand Up @@ -94,6 +104,17 @@ using CPLEX

# To test slim version, users can use # set_parameter!(oracle, "slim", true)
end

@testset "Pareto oracle" begin
@info "solving UFLP p$i - pareto oracle - seqInOut..."
master = Master(data; customize = customize_master_model!)
param = ParetoOracleParam(fill(1.0, data.n_facilities))
oracle = ParetoOracle(data, master, param; customize = customize_sub_model!)
env = BendersSeqInOut(master, oracle; param = benders_inout_param)
log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end
59 changes: 59 additions & 0 deletions experiments/3_test_sequential_disjunctive/cfl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,65 @@ using CPLEX
end
end

@testset "Unified oracle" begin
@testset "Seq" begin
for strengthened in [true], add_benders_cuts_to_master in [true], reuse_dcglp in [true], p in [1.0], lift in [true], disjunctive_cut_append_rule in [AllDisjunctiveCuts()]
@info "solving CFLP p$i - disjunctive oracle/unified - seq - strgthnd $strengthened; benders2master $add_benders_cuts_to_master reuse $reuse_dcglp p $p lift $lift dcut_append $disjunctive_cut_append_rule"
@testset "strgthnd $strengthened; benders2master $add_benders_cuts_to_master; reuse $reuse_dcglp; p $p; lift $lift; dcut_append $disjunctive_cut_append_rule" begin

oracle_param = SplitOracleParam(dcglp_param;
norm = LpNorm(p),
split_index_selection_rule = RandomFractional(),
disjunctive_cut_append_rule = disjunctive_cut_append_rule,
strengthened = strengthened,
add_benders_cuts_to_master = add_benders_cuts_to_master,
fraction_of_benders_cuts_to_master = 1.0,
reuse_dcglp = reuse_dcglp,
lift = lift)

master = Master(data; customize = customize_master_model!)
typical_oracles = [UnifiedOracle(data, master; customize = customize_sub_model!); UnifiedOracle(data, master; customize = customize_sub_model!)]
disjunctive_oracle = SplitOracle(master, typical_oracles, oracle_param)
env = BendersSeq(master, disjunctive_oracle; param = benders_param)

log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end

@testset "Pareto oracle" begin
@testset "Seq" begin
for strengthened in [true], add_benders_cuts_to_master in [true], reuse_dcglp in [true], p in [1.0], lift in [true], disjunctive_cut_append_rule in [AllDisjunctiveCuts()]
@info "solving CFLP p$i - disjunctive oracle/pareto - seq - strgthnd $strengthened; benders2master $add_benders_cuts_to_master reuse $reuse_dcglp p $p lift $lift dcut_append $disjunctive_cut_append_rule"
@testset "strgthnd $strengthened; benders2master $add_benders_cuts_to_master; reuse $reuse_dcglp; p $p; lift $lift; dcut_append $disjunctive_cut_append_rule" begin

oracle_param = SplitOracleParam(dcglp_param;
norm = LpNorm(p),
split_index_selection_rule = RandomFractional(),
disjunctive_cut_append_rule = disjunctive_cut_append_rule,
strengthened = strengthened,
add_benders_cuts_to_master = add_benders_cuts_to_master,
fraction_of_benders_cuts_to_master = 1.0,
reuse_dcglp = reuse_dcglp,
lift = lift)

master = Master(data; customize = customize_master_model!)
pareto_param = ParetoOracleParam(ones(data.n_facilities))
typical_oracles = [ParetoOracle(data, master, pareto_param; customize = customize_sub_model!); ParetoOracle(data, master, pareto_param; customize = customize_sub_model!)]
disjunctive_oracle = SplitOracle(master, typical_oracles, oracle_param)
env = BendersSeq(master, disjunctive_oracle; param = benders_param)

log = solve!(env)
@test env.termination_status == Optimal()
@test isapprox(mip_opt_val, env.obj_value, atol=1e-5)
end
end
end
end

@testset "Classic oracle with GBC" begin
@testset "Seq" begin
for strengthened in [true], add_benders_cuts_to_master in [true], reuse_dcglp in [true], p in [1.0], lift in [true], disjunctive_cut_append_rule in [AllDisjunctiveCuts()]
Expand Down
Loading
0