# Is the any package or for solving a MIP with branch and bound that gives the user the developed constraints during the solution procedure?

**URL:** <https://discourse.julialang.org/t/is-the-any-package-or-for-solving-a-mip-with-branch-and-bound-that-gives-the-user-the-developed-constraints-during-the-solution-procedure/86714>\
**Category:** Optimization (Mathematical)\
**Tags:** question, package, optim\
**Created:** [September 3, 2022, 1:08am UTC](https://discourse.julialang.org/t/is-the-any-package-or-for-solving-a-mip-with-branch-and-bound-that-gives-the-user-the-developed-constraints-during-the-solution-procedure/86714 "2022-09-03T01:08:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_ricci](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@Alex\_ricci](https://discourse.julialang.org/u/Alex_ricci)\
**Post date:** [September 3, 2022, 1:08am UTC](https://discourse.julialang.org/t/is-the-any-package-or-for-solving-a-mip-with-branch-and-bound-that-gives-the-user-the-developed-constraints-during-the-solution-procedure/86714/1 "2022-09-03T01:08:08Z")

</div>

I have a two-stage stochastic optimization model with binary and continuous variables in the first and the second stages.

To solve this I employ a benders decomposition technique. In this technique I need to get the dual of the second stage to generate cutting planes.

To get the dual of the second stage problem I want to relax the original MIP problem, solve the relaxed problem and obtain the solution. If the obtained solution is fractional I need to generate constraints such as x =\>1 or x\<=0. This is very similar to the classic branch and bound method. Since the second stage model is LP I can get the dual which is what I need.

Is there a package or whatever somewhere that performs the branch and bound algorithm with continuous relaxation of MIP and provide the user with the generated cuts so I can use them to drive the problem dual?

Thanks!

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [September 3, 2022, 7:32am UTC](https://discourse.julialang.org/t/is-the-any-package-or-for-solving-a-mip-with-branch-and-bound-that-gives-the-user-the-developed-constraints-during-the-solution-procedure/86714/2 "2022-09-03T07:32:59Z")

</div>

Maybe Bonobo.jl can do that?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [September 4, 2022, 9:50pm UTC](https://discourse.julialang.org/t/is-the-any-package-or-for-solving-a-mip-with-branch-and-bound-that-gives-the-user-the-developed-constraints-during-the-solution-procedure/86714/3 "2022-09-04T21:50:18Z")

</div>

You’ll likely have to code this manually.

See here for a tutorial on Benders: [Benders decomposition · JuMP](https://jump.dev/JuMP.jl/stable/tutorials/algorithms/benders_decomposition/)

It’d be a little over-kill, but you could also try [GitHub - odow/SDDP.jl: Stochastic Dual Dynamic Programming in Julia](https://github.com/odow/SDDP.jl), which can solve two-stage problems with mixed binary and continuous variables.
