[Cbc] Interactivity questions

Haroldo Gambini Santos haroldo at ufop.edu.br
Fri Feb 8 13:27:43 EST 2019


Em 08/02/2019 17:53, Jonathan Lee escreveu:
> I have a few questions about using the CbcModel (C++) class 
> interactively, if that's even possible:
>
>  1. Is there any way to interrupt the solver? ex., a user clicks a
>     "cancel" button I'd like the CbcModel::branchAndBound method to
>     exit. Currently I'm just killing the thread it is running in.
>
Not that I'm aware... A solution with callbacks and unix signals would 
be possible but your solution is simpler and works :)
>
>  1. Can I feed the solver a (non-optimal) solution for any performance
>     gain? I've seen some things about setHotStart and setBestSolution,
>     but no clear example or documentation. Do either one of these do
>     what I want?
>
For many problems this makes a big difference ! CBC only prunes the tree 
efficiently when it has an upper bound.

You can you the MIPStart feature.

 From the command line you just have to include

cbc instance.mps  mips solution.sol   solve

 From the API you can use:

   void setMIPStart(int count, const char **colNames, const double 
colValues[]);
Not sure if is included in stable or just in trunk right now, but I 
would recommend using trunk anyway because it is quite stable.

>  1. Is there any way to resume after a timeout? Or after setting (and
>     reaching) a max number of solutions? If the previous question is
>     workable, then I suppose I could use the most recent solution, but
>     might still lose some work since the last solution was found. Is
>     there a way to totally store the state and resume?
>
In linux you can save an entire process to the disk and resume it 
whenever you want, did it some years ago. Not sure how to do it on other 
plaftorms.
> Thanks in advance for any help
> --Jonathan
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/cbc

-- 
=============================================================
Haroldo Gambini Santos
Computing Department
Universidade Federal de Ouro Preto - UFOP
email: haroldo at ufop.edu.br
home/research page: www.decom.ufop.br/haroldo


It has long been an axiom of mine that the little things are infinitely
the most important.
-- Sir Arthur Conan Doyle, "A Case of Identity"



More information about the Cbc mailing list