Cplex best current solution

992 views Asked by At

I'd like to get informations about my cplex problem during solve. My first idea was to use an IloCplex.IncumbentCallback but it's not compatible with dynamic search, and I get better results with dynamic search. So I'm looking for a way to get informations without loosing dynamic mode.

It seems I can't use a callback because only informational callbacks are compatible with dynamic search, but none of the 4 informations callbacks are called often enough to give information when I need it.

When cplex finds a new solution, I guess this solution must be stored somewhere, so there should be a way to get informations about this solution

I would like to get :

  • Best Integer
  • Best Bound
  • Problem variables values.

Thanks

1

There are 1 answers

1
Ioannis On BEST ANSWER

You can retrieve almost all of these with a MIPInfoCallback:

  • For Best Integer use get_incumbent_objective_value(self)
  • For Best Bound use get_best_objective_value(self)
  • To retrieve the incumbent (best solution) values use get_incumbent_values(self, *args)
  • The bad news are when you want to retrieve the values of the variables at a node LP solution: You then need to use a ControlCallback, which has a get_values method. Indeed here you lose dynamic search. I am not sure there is a way around this..

The above links refer to the Python API, but the situation should be similar for the other APIs as well. Information that can be retrieved by informational callbacks is here (although this list refers to version 12.5, and some features might be missing).

I hope this helps!