5

I am working on an MILP problem, and the project needs to output the top N best results rather than the global best. I am looking for an open source solver which has a callback function. Can anyone provide help on this?

Chemmyyu
  • 151
  • 1
  • 5
    Not to my knowledge, but you can do it yourself with any solver by adding a set of no good cuts to sequentially exclude previous optimal solutions. – Kuifje Nov 16 '21 at 08:18
  • Great! This works for my case. But found another problem, the model does not report infeasible during the loop, instead, it always output the same solution as the previous one. – Chemmyyu Jun 23 '22 at 04:26
  • There is certainly a bug in your code. Feel free to open a new question, with your code, and we will be glad to help you fix it. – Kuifje Jun 23 '22 at 07:06

1 Answers1

3

No, i am not aware of such a solver. However sequentially excluding previously optimal results comes with an additional pitfall: If the solver discovered symmetries and did cut them away you also exclude symmetric solutions although they would rank before the next best objective.

worldsmithhelper
  • 4,007
  • 6
  • 21