lynix
lynix

Reputation: 145

Getting best n solutions for ILP

I'd like to use an ILP solver (e.g. lp_solve) to find the solution for an optimization problem.

The challenge is that some constraints are too complex to be formalized as linear statements, but may be validated using a simulation framework.

So I'd need to run the solver, check the solution against my complex constraints, and in case they are not satisfied, continue with the second-best solution etc.

Is there a solver that does not only provide the optimal solution, but the best n solutions regarding the give objective function?

Upvotes: 1

Views: 1108

Answers (1)

Ali
Ali

Reputation: 58501

Yes, there is:

  1. Either the solver supports it through a solution pool,

  2. or you have to build this solution pool yourself through the callback functions provided by the API of the solver.

In the latter case, the corresponding callback function is called whenever a new, better solution is found than the best known solution up to that point. The second option is supported by all the notable solvers I know of.

More on this topic:

Upvotes: 2

Related Questions