Benders Decomposition

500 views
Skip to first unread message

Ayan Mukhopadhyay

unread,
Feb 7, 2016, 8:08:34 PM2/7/16
to Pyomo Forum
I am trying to solve a two-stage stochastic programming problem using Benders decomposition. I am following the example from the pyomo book. While using pyomo, here are some of the questions that I am facing:

1. Is there a way to write the sub-problem such that it is the dual formulation of the original subproblem? Or is writing it in the primal form the norm with pyomo?
2. When solving the sub-problems, how is the check made regarding whether the sub problem was unbounded or not?

Thanks!

Gabriel Hackebeil

unread,
Feb 8, 2016, 4:40:12 AM2/8/16
to pyomo...@googlegroups.com
The model that you define in Pyomo is what is sent to the solver. Depending on the solver and the model, you can ask for the dual solution to be returned with the primal solution. This done by adding a Suffix named ‘dual’ to your model. You can read about the Suffix component here:


There are also some examples of how to use Suffixes (including collecting duals) in the pyomo/suffixes examples directory, which you can obtain here:


2. When solving the sub-problems, how is the check made regarding whether the sub problem was unbounded or not?
 
The best place to check is the solver.termination_condition member on the results
object returned by a solver plugin. There are many statuses that can show up here. For a list, see the output from:

from pyomo.opt import TerminationCondition
print(TerminationCondition._keys)

The following code is an example of how to check that a solution is optimal before loading it into the model. It works with Pyomo 4.1 and later.

from pyomo.environ import *
from pyomo.opt import TerminationCondition


model = …

with SolverFactory("cplex") as opt:
    results = opt.solve(model, load_solutions=False)
    if results.solver.termination_condition != TerminationCondition.optimal:
        # something went wrong
        print(results.solver)                                                                       
    else:
        model.solutions.load_from(results)

You can tweak this to check for more specific cases (e.g., infeasible, unbounded) by comparing against other statuses on the TerminationCondition enum.

Gabe

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

omowunmiayo

unread,
Sep 10, 2019, 7:21:36 AM9/10/19
to Pyomo Forum
Hi,

I have a question as a follow-on from trying to implement this Bender's decomposition example. Please how can I apply this with a concrete model. I tried using the clone technique to create instances for the Sub-model but I had challenges modifying the Sets & parameters in the different created instances. I realised that the solution of the Submodel didn't change with the changed parameter

Please any ideas on how to resolve challenges like this with concrete model instances in Benders decomposition?

Looking forward to your response.

Thank you

Ola
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages