I am using the lp_solve java wrapper to find an optimal solution to an IP. Is there an easy way to find all solutions? Or do I have to add new constraints to rule out the current solution and re-solve?
Asked
Active
Viewed 355 times
0
-
In many cases there are an infinite number of optimal solutions (e.g. `max 0*x s.t. x integer`). – josliber Jul 21 '16 at 17:06
-
yes I was hoping that, given a model with only binary variables, it would be able to find all optimal solutions (some of the other solvers do). guess not? – Austen Jul 21 '16 at 22:00
-
At least the R interface as num.bin.solns for that (see http://stackoverflow.com/q/28666795/3093387), but I'm struggling to see how that maps to the java interface. Looking at the lpSolve package C source code, it's just repeatedly adding a constraint to cut off the optimal solution `(1 for all the variables set to 1, -1 for all the variables set to 0)'x <= numSet-1` and then re-solving. – josliber Jul 21 '16 at 22:06
-
Oh ok thanks. i guess I'll have to do that myself. – Austen Jul 22 '16 at 07:53