coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
518 stars 92 forks source link

Example code using IncumbentUpdater #144

Open JeroenGar opened 3 years ago

JeroenGar commented 3 years ago

Hello,

I've searched through the documentation and found that it is possible to receive updates when a new feasible solution is found with IncumbentUpdater.

However I am really struggling to understand how this works. I've also searched around for example code but was not able to find anything.

Would it be possible to provide a very simple example of how the IncumbentUpdater should be used?

Thanks in advance!

zuzhaoye commented 2 years ago

I have the same question. Here is what I find in the directory 'mip/gurobi.py':

    def optimize(self, relax: bool = False) -> OptimizationStatus:

        # todo add branch_selector and incumbent_updater callbacks

Since they said it is "todo", so I guess the IncumbenUpdater function hasn't been finished or published. Correct me if I am wrong.