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

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
Please sign in to leave a comment.
Comments
2 comments