[Cbc] Setting an initial integer solution.

David Einstein deinst at gmail.com
Thu Mar 13 14:29:11 EDT 2014


Never mind.  I was using the wrong setBestSolution.  Sorry to be annoying.


On Thu, Mar 13, 2014 at 1:27 PM, David Einstein <deinst at gmail.com> wrote:

> I have a not very good integer solution, that I would like to start the
> MIP off with.  I have tried
>
>   CbcModel cbc(osi);
>   CbcMain0(cbc);
>   cbc.setDblParam(CbcModel::CbcMaximumSeconds, maxseconds);
>   cout << " about to set solution " << endl;
>   if (allint) {
>     cbc.setBestSolution(CBC_ROUNDING, obj, goodsol);
>   }
>   cout << "set solution" << endl;
>   const char *argv2[] = {"schedulemip", "-solve", "-quit"};
>   CbcMain1(3, argv2, cbc);
>
>
> where goodsol is an integer solution if allint is true, and obj is the
> value of the objective at goodsol.  When I try this, I get
>
> (gdb) backtrace
> #0  0x00000000005c6ef8 in OsiBabSolver::solutionAddsCuts (this=0x0) at
> /home/deinst/projects/coin-Cbc/Osi/src/Osi/OsiAuxInfo.hpp:121
> #1  0x00000000005b0d74 in CbcModel::setBestSolution (this=0x7fffcade08a0,
> how=CBC_ROUNDING, objectiveValue=@0x7fffcade0848: 151088.41499999998,
> solutionIn=0x7ae6640, fixVariables=0) at
> ../../../coin-Cbc/Cbc/src/CbcModel.cpp:11907
> #2  0x0000000000484886 in CbcFrame::run_mip(std::vector<Constraint,
> std::allocator<Constraint> >, std::vector<Variable,
> std::allocator<Variable> > const&, int, int) ()
> #3  0x000000000047b44e in solveprob7(std::vector<worker,
> std::allocator<worker> > const&, std::vector<task_t, std::allocator<task_t>
> > const&, std::set<int, std::less<int>, std::allocator<int> > const&,
> std::vector<int, std::allocator<int> > const&, Switches const&, Cost
> const&, std::vector<std::vector<int, std::allocator<int> >,
> std::allocator<std::vector<int, std::allocator<int> > > > const&,
> Model_Parameters const&, MinComp const&, std::string const&) ()
> #4  0x00000000004074c2 in main ()
>
> We seem to be querying a nonexistent OsiBabSolver.  I suspect that I am
> using either the wrong function, or the wrong message.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20140313/8d0c543e/attachment-0001.html>


More information about the Cbc mailing list