[Clp] CbcHeuristicLocal

John Forrest john.forrest at fastercoin.com
Wed Nov 8 05:30:50 EST 2017


Irina,

The solver needs to know about the solution and then it may use Local or 
other heuristics e.g. RINS.  You could play around with the standalone 
solver and use mipstart with a solution file.  Then if that looks good 
either still use mipstart and code based on example driver4.cpp or with 
more work directly pass in the solution -

CbcModel model ...
       model.setBestSolution( sol, nvars, objvalue, false );
        model.setCutoff(obj+epsilon);
        model.setSolutionCount(1);

or something like that.

John Forrest
On 06/11/17 17:09, Irina Hafner wrote:
>
> Hi all,
>
> I am currently working on a specific LP, where it is easy to calculate 
> a feasible solution in advance. Hence, I am looking for an algorithm 
> to improve an initial solution, for example via local search.
>
> I know, there is the “CbcHeuristicLocal” class and I even found some 
> examples.  When I tried to implement the algorithm in the following way
>
> OsiClpSolverInterfaceclp;
>
> CbcModelmodel(clp);
>
> //[…set initial solution…]
>
> CbcHeuristicLocalheuristicLocal(model);
>
> heuristicLocal.setSearchType(1);
>
> heuristicLocal.setFractionSmall(0.5);
>
> heuristicLocal.setHeuristicName("local");
>
> model.addHeuristic(&heuristicLocal);
>
> //[…]
>
> model.initialSolve();
>
> model.branchAndBound();
>
> the solution didn’t improve, and I got the following log massage 
> “Cbc0045I Heuristic local took 0 seconds (no good)”. So, I think the 
> algorithm didn’t even start.
>
> I am wondering if I missed to set some parameters or if I can’t use 
> this class as I thought?
>
> Has somebody some experiences with local search, the CbCHeuristicLocal 
> class or with the CbcTreeLocal class? It would be great to get more 
> information on this topic!
>
> Thank you in advance,
>
> Irina
>
>
>
> _______________________________________________
> Clp mailing list
> Clp at list.coin-or.org
> https://list.coin-or.org/mailman/listinfo/clp


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20171108/100654aa/attachment.html>


More information about the Clp mailing list