Get all the solutions if there are several optimal solution

15 views
Skip to first unread message

Stephanie

unread,
Apr 1, 2018, 4:28:38 AM4/1/18
to YALMIP
Hi, I have a linear problem, and I solve it with gurobi and another solver, the solutions are different, but their optimal objective values are the same, which means there are several optimal solutions. And if I can get all the optimal solutions by using certain solver. Thanks

Johan Löfberg

unread,
Apr 1, 2018, 8:50:18 AM4/1/18
to YALMIP
It's not clear if you have an LP or MILP

In general, if the solution is non-unique in an LP, there are infinitely many solutions, hence you cannot get them all. 

There is no support for extracting several solutions. What you will have to do is to come up with some iterative scheme where you solve it once to get the optimal value, then solve it again with the constraint objective == optimalobjective but a random objective, which typically will give you some other vertex, and then run that until you have many solutions, and hope that you have them all

If it is a binary problem, you can resolve with an exclusion constraint (command exclude) to generate all binary solutions in an iterative scheme

Reply all
Reply to author
Forward
0 new messages