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.
The text was updated successfully, but these errors were encountered:
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.
Dear support team,
I want to know how to set the initial solution when using benders decomposition.
I want to solve the problem with benders decomposition
This is my demo code.
When I don't set
master.initBendersDefault(sub)
, scip hintsI can get answer:
But I set
master.initBendersDefault(sub)
, scip hintsI get answer
Why is there infeasible when I set
initBendersDefault
? And I'm really confused about how to set the initial solution for the Benders decomposition.The text was updated successfully, but these errors were encountered: