How to find multiple optimal solutions using Gurobi

Viewed 350

I am using Gurobi through Julia, and currently have it set up so that it gives me an optimal solution to the LP I am interested in.

However, it would be really helpful if there was a way it could give multiple optimal solutions. Even just giving me two solutions instead of only one would be very useful for my project.

Does anyone know how to do this?

1 Answers

A continuous LP has 0, 1 or infinitely many optimal solutions. So enumerating them is difficult.

We could try to enumerate the optimal corner points (a.k.a. basis solutions). This is not so simple either. Here is one approach: https://yetanothermathprogrammingconsultant.blogspot.com/2016/01/finding-all-optimal-lp-solutions.html.

Notes:

  • With an objective with random coefficients you may be able to find a few solutions. To restrict the search to optimal solutions, add the original objective as a constraint.
  • If the problem is a MIP, Gurobi can find all optimal integer solutions (or a subset of them). This is done (very efficiently) using the solution pool.
Related