# I added 1 Million constraints to an LP unwittingly

**URL:** <https://discourse.julialang.org/t/i-added-1-million-constraints-to-an-lp-unwittingly/127668>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, examples, gurobi, experience\
**Created:** [April 3, 2025, 11:12am UTC](https://discourse.julialang.org/t/i-added-1-million-constraints-to-an-lp-unwittingly/127668 "2025-04-03T11:12:09Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Post date:** [April 4, 2025, 12:27am UTC](https://discourse.julialang.org/t/i-added-1-million-constraints-to-an-lp-unwittingly/127668/8 "2025-04-04T00:27:22Z")

</div>

It takes about 4 seconds on my laptop to add 7k constraints with JuMP.  
is this slow?

```julia
for r in eachrow(A1)                                                                                           
       ite += 1                                                                                                   
       println("ite = $ite <= 201, time_elapsed = $(time() - t0)")                                                
       JuMP.@constraint(lpr, [c in eachrow(A2)], transpose(r) * cross_multrix * c >= 0)                           
end
ite = 1 <= 201, time_elapsed = 0.01900005340576172
ite = 2 <= 201, time_elapsed = 14.52999997138977 # the first one is a bit denser, taking 14 seconds
ite = 3 <= 201, time_elapsed = 18.377000093460083
ite = 4 <= 201, time_elapsed = 22.23099994659424
ite = 5 <= 201, time_elapsed = 26.15400004386902

```

To reproduce this procedure, please see code in this [post](https://discourse.julialang.org/t/the-inappropriateness-of-applying-rlt-to-solve-the-dbp-in-aro-who-lacks-rcr/127203/2).

---

_[View the full topic](https://discourse.julialang.org/t/i-added-1-million-constraints-to-an-lp-unwittingly/127668)._
