# BilevelJuMP and Lazy cns with Gurobi

**URL:** <https://discourse.julialang.org/t/bileveljump-and-lazy-cns-with-gurobi/104060>\
**Category:** Optimization (Mathematical)\
**Tags:** gurobi\
**Created:** [September 20, 2023, 11:17am UTC](https://discourse.julialang.org/t/bileveljump-and-lazy-cns-with-gurobi/104060 "2023-09-20T11:17:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabrizio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fabrizio/32/30587_2.png) [@Fabrizio](https://discourse.julialang.org/u/Fabrizio)\
**Post date:** [September 20, 2023, 11:17am UTC](https://discourse.julialang.org/t/bileveljump-and-lazy-cns-with-gurobi/104060/1 "2023-09-20T11:17:48Z")

</div>

I repost this here for conveniece

Dear all,  
when using pure Jump model i exensively use the lazy attribute with some cns using Gurobi as a solver with the syntiax

> MOI.set(MyMod, Gurobi.ConstraintAttribute(“Lazy”), CnsName, K)

where K is 1/2 or 3 depending on the Gurobi possibilities. Besides the need to indexing single constraint in for loops, i receive an error using the same approach within a certain Bilevel problem using BilevelJump.  
Question is: is it possible to do that kind of attribute setting, or the BJump interface does not enable it?

Regards,  
Fabrizio

---

<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 20, 2023, 8:25pm UTC](https://discourse.julialang.org/t/bileveljump-and-lazy-cns-with-gurobi/104060/2 "2023-09-20T20:25:00Z")

</div>

x-ref [Lazy cns with Gurobi · Issue #210 · joaquimg/BilevelJuMP.jl · GitHub](https://github.com/joaquimg/BilevelJuMP.jl/issues/210)

My guess is that this is likely not possible with BilevelJuMP, but @joaquimg can confirm.
