You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I don't set master.initBendersDefault(sub) , scip hints
1/1 feasible solution given by solution candidate storage, new primal bound 1.100000e+01
I can get answer:
Optimal value for x: 2.5
Optimal value for y: 0.0
Optimal objective value: 7.5
But I set master.initBendersDefault(sub), scip hints
all 1 solutions given by solution candidate storage are infeasible
Benders' decomposition: Objective coefficients of copied of master problem variables has been changed to zero.
I get answer
Optimal value for x: 2.5
Optimal value for y: 0.0
Optimal objective value: 9.0
Why is there infeasible when I set initBendersDefault? And I'm really confused about how to set the initial solution for the Benders decomposition.
def create_master_problem():
master = Model()
x = master.addVar()
return master, x
def create_sub_problem():
sub = Model()
return sub
def benders_decomposition():
master, x = create_master_problem()
sub = create_sub_problem()
master.initBendersDefault(sub)
master_initial_sol = master.createSol()
master.setSolVal(master_initial_sol, x, 1)
master.addSol(master_initial_sol)
master.optimize()
benders_decomposition()
Of course the code crashes when optimizing, but before doing so it says that the solution is not feasible. I disabled presolving, but it remains infeasible then.
Another separate problem is that optimizing just crashes without error message when using trySol instead.
Activity
Joao-Dionisio commentedon Sep 29, 2024
Can reproduce. Here is a smaller MRE
Of course the code crashes when optimizing, but before doing so it says that the solution is not feasible. I disabled presolving, but it remains infeasible then.
Another separate problem is that optimizing just crashes without error message when using
trySolinstead.DouBiBaNi commentedon Sep 30, 2024
Thank you for your reply and look forward to a quick resolution. T_T