# Benders framework of cplex in JuMP

**URL:** <https://discourse.julialang.org/t/benders-framework-of-cplex-in-jump/62557>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump\
**Created:** [June 8, 2021, 3:41am UTC](https://discourse.julialang.org/t/benders-framework-of-cplex-in-jump/62557 "2021-06-08T03:41:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BYS](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bys/32/25384_2.png) [@BYS](https://discourse.julialang.org/u/BYS)\
**Post date:** [June 8, 2021, 3:41am UTC](https://discourse.julialang.org/t/benders-framework-of-cplex-in-jump/62557/1 "2021-06-08T03:41:19Z")

</div>

Hi, everyone  
Does JuMP support the Benders decomposition interface of cplex([IBM Documentation](https://www.ibm.com/docs/en/icos/20.1.0?topic=algorithm-examples-benders))? I find cplex doesn’t support the examples for Julia. I have a model,which the master problem is MILP, and the subproblem is LP. The model will be hard to solve if solving the master and subproblem together, I want to try to decompose it using JuMP and cplex.(I have tried to write the codes using classical Benders algorithm and it is found that the convergence is not good)  
Thanks in advace!

---

<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:** [June 8, 2021, 3:56am UTC](https://discourse.julialang.org/t/benders-framework-of-cplex-in-jump/62557/2 "2021-06-08T03:56:57Z")

</div>

> [@BYS](#):
>
> Does JuMP support the Benders decomposition interface of cplex?

No.

> I have tried to write the codes using classical Benders algorithm and it is found that the convergence is not good

How big is the problem? Benders has known issues with convergence, but you can do okay with some tricks (cut selection, some regularization in the first-stage).

The JuMP documentation has examples of a basic implementation of Benders.  
[https://jump.dev/JuMP.jl/stable/tutorials/Optimization%20concepts/benders\_decomposition/](https://jump.dev/JuMP.jl/stable/tutorials/Optimization%20concepts/benders_decomposition/)  
[https://jump.dev/JuMP.jl/stable/tutorials/Optimization%20concepts/benders\_lazy\_constraints/](https://jump.dev/JuMP.jl/stable/tutorials/Optimization%20concepts/benders_lazy_constraints/)

I was going to recommend StochasticPrograms.jl, but it looks like you already found it: [model of different stages · Issue #30 · martinbiel/StochasticPrograms.jl · GitHub](https://github.com/martinbiel/StochasticPrograms.jl/issues/30)

You should also checkout [GitHub - atoptima/Coluna.jl: Branch-and-Price-and-Cut in Julia](https://github.com/atoptima/Coluna.jl)

---

<div class="post-metadata">

**Author:** ![BYS](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bys/32/25384_2.png) [@BYS](https://discourse.julialang.org/u/BYS)\
**Post date:** [June 8, 2021, 4:07am UTC](https://discourse.julialang.org/t/benders-framework-of-cplex-in-jump/62557/3 "2021-06-08T04:07:04Z")

</div>

Thank you,again@odow. By the way, is the objective funtion value of sub-problem monotonic decreasing until the relative gap(UB-LB)/UB reaches? Why my master-problem objective function value has almost no changes during iteration process and my sub-problem objective function value  
has a big fluctuation during iteration process using the classical Benders algorithms I wrote?

---

<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:** [June 8, 2021, 4:17am UTC](https://discourse.julialang.org/t/benders-framework-of-cplex-in-jump/62557/4 "2021-06-08T04:17:00Z")

</div>

> is the objective funtion value of sub-problem monotonic decreasing

No. The objective value of the relaxed first-stage problem is monotonic.

> Why my master-problem objective function value has almost no changes during iteration process and my sub-problem objective function value  
> has a big fluctuation during iteration process using the classical Benders algorithms I wrote?

This is probably classic “bang-bang” solutions from the cutting planes. Google regularized Benders. Add a quadratic penalty term that penalizes deviations from the previous first-stage solution.

It seems like your minimizing, but if you’re maximizing, another common mistake is to use `dual` instead of `shadow_price` when maximizing. JuMP’s notion of duality is negated for linear programs when maximizing compared to some textbooks.

---

<div class="post-metadata">

**Author:** ![BYS](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bys/32/25384_2.png) [@BYS](https://discourse.julialang.org/u/BYS)\
**Post date:** [June 8, 2021, 4:33am UTC](https://discourse.julialang.org/t/benders-framework-of-cplex-in-jump/62557/5 "2021-06-08T04:33:10Z")

</div>

Okay,thank you. I will try the regularized Benders.
