Unexpectedly many solutions from Solution Pool
AnsweredWe are using Gurobi 10.0.0 and gurobipy
We use
num_sol = 5
model.setParam(GRB.param.PoolSearchMode, 2)
model.setParam(GRB.param.PoolSolutions, num_sol)
On some instances get 15 (not necessarily distinct) solutions even though the value of num_sol is set to a constant that is < 15. From other posts, I understand why we get the same solution multiple times, but I do not understand why we get more than num_sol solutions.
Has anyone observed this behavior?
Alejandro Schaffer
Are
0
-
Official comment
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Alejandro,
Do I understand correctly that after optimization if you check the attribute model.SolCount you get 15 but calling model.getParamInfo('PoolSolutions') gives
('PoolSolutions', <class 'int'>, 5, 1, 2000000000, 10) ?Can you share an example?Thanks, Marika
0 -
The problem was solved
- use model.SolCount to get the number of stored solutions
- use parameter SolutionNumber to define which solution to access when querying attribute Xn, ObjNVal, or PoolObjVal
An example can be found in poolsearch.py
0
Post is closed for comments.
Comments
3 comments