Can Gurobi always find multiple optimal solutions if they exist?
AnsweredI have implemented an assignment problem with gurobipy and would like to find multiple optimal assignments, not just one (I know multiple exist).
I've set PoolSearchMode = 2 and PoolSolutions = 10, but after optimizing I still only get SolCount = 1. I've also tried turning off presolve, but that didn't change anything.
I've done this successfully for other models so I thought it would work for an assignment problem too. Any advice?
-
Hi Kiera,
With reference to the PoolSearchMode docs, what is the value of PoolObjBound at the end of the run? If you change the objective sense, from min to max, or max to min, do you obtain the same solution? Can you construct an alternative optimal solution - if you can what happens if you use it as a MIP start?
- Riley
0 -
Hi Riley,
Thank you for your suggestions! My initial problem was that my assignment variables were still set to be continuous by default instead of binary.
With that fixed, I can now obtain multiple solutions in the solution pool. However, they're all duplicates of the same optimal solution. Is there a way to get distinct optimal solutions?
For this particular test instance, all feasible assignments are optimal (the graph is complete and all edge weights are the same). So the PoolObjBound value is the optimal value. When changing from max to min, I do obtain the same solution and all solutions in the pool are the same assignment. I've also tried inputting an alternative optimal solution as a MIP start and the solution pool then only has duplicates of that solution.
0 -
Hi Kiera,
You should be able to achieve what you want by using the PoolIgnore attribute on variables.
Let me know if there's anything unclear in that doc page?
- Riley
0 -
Thank you!
0
Please sign in to leave a comment.
Comments
4 comments