# BilevelJump with mode=BilevelJuMP.BigMMode or mode=BilevelJuMP.FortunyAmatMcCarlMode

**URL:** <https://discourse.julialang.org/t/bileveljump-with-mode-bileveljump-bigmmode-or-mode-bileveljump-fortunyamatmccarlmode/103806>\
**Category:** Optimization (Mathematical)\
**Created:** [September 13, 2023, 9:01am UTC](https://discourse.julialang.org/t/bileveljump-with-mode-bileveljump-bigmmode-or-mode-bileveljump-fortunyamatmccarlmode/103806 "2023-09-13T09:01:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martina.gherardi](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@martina.gherardi](https://discourse.julialang.org/u/martina.gherardi)\
**Post date:** [September 13, 2023, 9:01am UTC](https://discourse.julialang.org/t/bileveljump-with-mode-bileveljump-bigmmode-or-mode-bileveljump-fortunyamatmccarlmode/103806/1 "2023-09-13T09:01:00Z")

</div>

Hi,

I would like to ask 2 questions about the reformulation of the complementary slackness with _Fortuny-Amat and McCarl_ done by BilevelJump with the following setting

`mode=BilevelJuMP.BigMMode(; with_slack = false, primal_big_M = Inf, dual_big_M = Inf)`  
or  
`mode=BilevelJuMP.FortunyAmatMcCarlMode(primal_big_M = vp, dual_big_M = vd) `

1. Are these modes equivalent?
2. How to define the bigM for the **primal constraints**? I noticed that `primal_big_M=vp` is used as the bigM of the primal variables while the reformulation automatically determines other bigMs for the primal constraints, starting from vp.  
(note that `dual_big_M = vd` is used as the bigM for the dual constraints)

Thank you in advance

---

<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 13, 2023, 9:45pm UTC](https://discourse.julialang.org/t/bileveljump-with-mode-bileveljump-bigmmode-or-mode-bileveljump-fortunyamatmccarlmode/103806/2 "2023-09-13T21:45:16Z")

</div>

This is a question for @joaquimg

---

<div class="post-metadata">

**Author:** ![joaquimg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joaquimg/32/223_2.png) [@joaquimg](https://discourse.julialang.org/u/joaquimg)\
**Post date:** [September 14, 2023, 2:26am UTC](https://discourse.julialang.org/t/bileveljump-with-mode-bileveljump-bigmmode-or-mode-bileveljump-fortunyamatmccarlmode/103806/3 "2023-09-14T02:26:10Z")

</div>

> [@martina.gherardi](#):
>
> Are these modes equivalent?

`BigMMode` is equivalent to `FortunyAmatMcCarlMode`.

So  
`mode=BilevelJuMP.BigMMode(; with_slack = false, primal_big_M = Inf, dual_big_M = Inf)`  
and  
`mode=BilevelJuMP.FortunyAmatMcCarlMode(primal_big_M = vp, dual_big_M = vd)`  
are equivalent because `with_slack = false` is the default for both.

> [@martina.gherardi](#):
>
> How to define the bigM for the **primal constraints**? I noticed that `primal_big_M=vp` is used as the bigM of the primal variables while the reformulation automatically determines other bigMs for the primal constraints, starting from vp.  
> (note that `dual_big_M = vd` is used as the bigM for the dual constraints)

Currently, big Ms are only passed to variables and are computed automatically for constraints.  
I do agree the we should be able to set them directly to constraints if there is information from the user.  
I opened an issue to track this: [Allow adding constraint UB and LB big Ms · Issue #209 · joaquimg/BilevelJuMP.jl · GitHub](https://github.com/joaquimg/BilevelJuMP.jl/issues/209)
