# JuMP Gurobi.jl CPLEX.jl Solution Pool

**URL:** <https://discourse.julialang.org/t/jump-gurobi-jl-cplex-jl-solution-pool/71604>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, optimization\
**Created:** [November 16, 2021, 6:05pm UTC](https://discourse.julialang.org/t/jump-gurobi-jl-cplex-jl-solution-pool/71604 "2021-11-16T18:05:24Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![CBongiova](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cbongiova/32/4856_2.png) [@CBongiova](https://discourse.julialang.org/u/CBongiova)\
**Post date:** [May 9, 2022, 6:20pm UTC](https://discourse.julialang.org/t/jump-gurobi-jl-cplex-jl-solution-pool/71604/5 "2022-05-09T18:20:36Z")

</div>

Hi,

I am also interested in obtaining a solution pool from a MILP using Gurobi. I have looked at the docs but I cannot manage to retrieve the different solutions. For example, for the model mentioned by @davide-f here above:

> using JuMP  
> m = Model(optimizer\_with\_attributes(Gurobi.Optimizer, “PoolSearchMode”=\>2, “PoolSolutions” =\> 1000))  
> @variables(m,begin  
> 0 \<= x \<= 5  
> 0 \<= y \<= 10, Int  
> z, Bin  
> zz, Bin  
> end)  
> @objective(m, Max, x + 2y + 5\*(z+zz))  
> @constraint(m, x + y + z + zz\<= 10)  
> @constraint(m, x + 2y + z + zz \<= 15)  
> @constraint(m, z + zz \<= 1)  
> optimize!(m)

I get:

> Academic license - for non-commercial use only  
> Optimize a model with 3 rows, 4 columns and 10 nonzeros  
> Variable types: 1 continuous, 3 integer (2 binary)  
> Coefficient statistics:  
> Matrix range [1e+00, 2e+00]  
> Objective range [1e+00, 5e+00]  
> Bounds range [5e+00, 1e+01]  
> RHS range [1e+00, 2e+01]  
> Found heuristic solution: objective 15.0000000  
> Presolve time: 0.00s  
> Presolved: 3 rows, 4 columns, 10 nonzeros  
> Variable types: 1 continuous, 3 integer (2 binary)  
> …  
> Explored 47 nodes (10 simplex iterations) in 0.01 seconds  
> Thread count was 8 (of 8 available processors)  
> Solution count 24: 19 19 19 … 5  
> No other solutions better than -1e+100  
> Optimal solution found (tolerance 1.00e-04)  
> Best objective 1.900000000000e+01, best bound 1.900000000000e+01, gap 0.0000%

And so we have:

- 24 solutions (by running result\_count(m))
- But then value(z; result=i) and objective\_value(m; result=i) always return the same value (for each i in {1,…,24})

Any idea of what is going on? Is the “result” argument not functioning?

Thank you!

---

_[View the full topic](https://discourse.julialang.org/t/jump-gurobi-jl-cplex-jl-solution-pool/71604)._
