# Add\_bridges

**URL:** <https://discourse.julialang.org/t/add-bridges/93478>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [January 24, 2023, 9:17pm UTC](https://discourse.julialang.org/t/add-bridges/93478 "2023-01-24T21:17:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart\_Rogers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stuart_rogers/32/10694_2.png) [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Post date:** [January 24, 2023, 9:17pm UTC](https://discourse.julialang.org/t/add-bridges/93478/1 "2023-01-24T21:17:42Z")

</div>

What is the default value of add\_bridges when a JuMP model is created? Can this be checked via a JuMP call? For a JuMP model m, get\_optimizer\_attribute(m, MOI.add\_bridges()) doesn’t work.

---

<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:** [January 24, 2023, 9:26pm UTC](https://discourse.julialang.org/t/add-bridges/93478/2 "2023-01-24T21:26:50Z")

</div>

> What is the default value of add\_bridges when a JuMP model is created?

The default is `true`.

> Can this be checked via a JuMP call?

No. Why do you need this?

As a side note:

I’ve just seen that the docs don’t include the actual docstring:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/8/a8a7d3572656282d2cfc064dae92bbaed2f39fa8.png)

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/0/c01230fb772cfa39cdd4b9a976287875a358d2a0.png)

I’ll get this fixed.

---

<div class="post-metadata">

**Author:** ![Stuart\_Rogers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stuart_rogers/32/10694_2.png) [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Post date:** [January 24, 2023, 9:34pm UTC](https://discourse.julialang.org/t/add-bridges/93478/3 "2023-01-24T21:34:20Z")

</div>

> [@odow](#):
>
> No. Why do you need this?

How do we know what the default value is, without checking the code, if we can’t check it using a JuMP call?

---

<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:** [January 24, 2023, 9:42pm UTC](https://discourse.julialang.org/t/add-bridges/93478/4 "2023-01-24T21:42:45Z")

</div>

> How do we know what the default value is, without checking the code, if we can’t check it using a JuMP call?

Read the documentation. But my question was more, “why do you need to know the default?”

```julia
julia> using JuMP

help?> Model
search: Model ModelMode model_string copy_model owner_model direct_model AbstractModel INVALID_MODEL nonlinear_model

  Model()

  Return a new JuMP model without any optimizer; the model is stored in a cache.

  Use set_optimizer to set the optimizer before calling optimize!.

  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

  Model(optimizer_factory; add_bridges::Bool = true)

  Return a new JuMP model with the provided optimizer and bridge settings.

  See set_optimizer for the description of the optimizer_factory and add_bridges arguments.

  Examples
  ==========

  Create a model with the optimizer set to Ipopt:

  model = Model(Ipopt.Optimizer)

  Pass an anonymous function which creates a Gurobi.Optimizer, and disable bridges:

  env = Gurobi.Env()
  model = Model(() -> Gurobi.Optimizer(env); add_bridges = false)

```

There is a bug in Documenter that is preventing the docstrings from appearing in the online documentation.

That’ll be fixed shortly: [Fix docstring of Model not appearing in docs by odow · Pull Request #3198 · jump-dev/JuMP.jl · GitHub](https://github.com/jump-dev/JuMP.jl/pull/3198)

---

<div class="post-metadata">

**Author:** ![Stuart\_Rogers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stuart_rogers/32/10694_2.png) [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Post date:** [January 24, 2023, 9:46pm UTC](https://discourse.julialang.org/t/add-bridges/93478/5 "2023-01-24T21:46:52Z")

</div>

> [@odow](#):
>
> But my question was more, “why do you need to know the default?”

Maybe I don’t want to specify every parameter and attribute and use the default values when creating a model, for efficient looking code. In this case, it would be useful for the documentation to state the default values.

---

<div class="post-metadata">

**Author:** ![Stuart\_Rogers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stuart_rogers/32/10694_2.png) [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Post date:** [January 24, 2023, 10:07pm UTC](https://discourse.julialang.org/t/add-bridges/93478/6 "2023-01-24T22:07:22Z")

</div>

Using HiGHS, add\_bridges=false degrades performance for a particular model. I had thought add\_bridges=false might improve performance based on this documentation: [Models · JuMP](https://jump.dev/JuMP.jl/stable/reference/models/#JuMP.set_optimizer).

add\_bridges = true:

Solving report  
Status Optimal  
Primal bound -128  
Dual bound -128  
Gap 0% (tolerance: 0.01%)  
Solution status feasible  
-128 (objective)  
0 (bound viol.)  
4.88498130835e-15 (int. viol.)  
0 (row viol.)  
Timing 1460.68 (total)  
821.37 (presolve)  
0.00 (postsolve)  
Nodes 404  
LP iterations 542675 (total)  
0 (strong br.)  
32998 (separation)  
36029 (heuristics)  
1465.169666 seconds (11.94 M allocations: 781.290 MiB, 0.03% gc time, 0.28% compilation time)

add\_bridges = false:

Solving report  
Status Optimal  
Primal bound -128  
Dual bound -128  
Gap 0% (tolerance: 0.01%)  
Solution status feasible  
-128 (objective)  
0 (bound viol.)  
1.33226762955e-13 (int. viol.)  
0 (row viol.)  
Timing 2115.38 (total)  
815.70 (presolve)  
0.00 (postsolve)  
Nodes 825  
LP iterations 1085261 (total)  
0 (strong br.)  
58459 (separation)  
122888 (heuristics)  
2118.386670 seconds (5.68 M allocations: 348.871 MiB, 0.02% gc time, 0.13% compilation time)

---

<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:** [January 24, 2023, 10:20pm UTC](https://discourse.julialang.org/t/add-bridges/93478/7 "2023-01-24T22:20:56Z")

</div>

The performance difference is just randomness, and it is a side-effect of the bridges, not as a direct result of them. Going via bridges or not can change the order of constraints that are present in the model. Different row orders can give wildly different performance characteristics. You could have another model where the performance is reversed. Alternatively, you might be able to play with the order of constraints in your formulation and achieve the same result.

The documentation issue is fixed: [Fix docstring of Model not appearing in docs by odow · Pull Request #3198 · jump-dev/JuMP.jl · GitHub](https://github.com/jump-dev/JuMP.jl/pull/3198), and will shortly show in the `dev` version of the docs, and the `stable` in the next release of JuMP.

Instead of [https://jump.dev/JuMP.jl/stable/reference/models/#Constructors](https://jump.dev/JuMP.jl/stable/reference/models/#Constructors)

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/f/3f89a82341d7737b0de31acc381901b988c2e4d4.png)

it will show

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/d/6df3885b46f256d4079219bab9df07748aef880c.png)

---

<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:** [January 25, 2023, 3:49am UTC](https://discourse.julialang.org/t/add-bridges/93478/8 "2023-01-25T03:49:36Z")

</div>

Just to close the loop: this is now fixed.

> **[Models · JuMP](https://jump.dev/JuMP.jl/stable/reference/models/#JuMP.Model)**
>
> Documentation for JuMP.
