[Coin-discuss] Using CbcHeuristicFPump outside branch and cut
James Gibbons
James.Gibbons at nottingham.ac.uk
Tue Apr 4 09:37:03 EDT 2006
Hi,
Hopefully this will be my last question for a bit. I've found that using CbcHeuristicFPump finds a good solution for my problem. Unfortunately, it then slows down the rest of branchAndBound(). The documentation recommends using it outside branch and cut, but I can't work out how to do this. My attempt is at the end of this email. From the source code it looks as if CbcHeuristicFPump::solution will always return 0 using my code because model_->getCurrentPassNumber() (line 88 of CbcHeuristicFPump.cpp) will always be 0. I tried the naive bodge of changing line 90 to if (!atRoot||passNumber>1) but this caused a crash. Is there a way around this?
BTW there is a documentation error in CBCHeuristicFPump.hpp, line 36, which I *think* gets 1 and 0 the wrong way around.
Thanks,
James
My code:
CbcModel model(*solver1);
CbcHeuristicFPump heur0(model);
double heurObjVal(1.0e50);
double *heurSol;
heur4.setWhen(3);
model.addHeuristic(&heur0);
int heurState = model.heuristic(0)->solution(heurObjVal,heurSol);
if(heurState!=0) {
model.setBestSolution(CBC_HEURISTIC_SOLUTION,heurObjVal,heurSol);
}
model.heuristic(0)->setWhen(0); //turn it off
model.branchAndBound();
--
Dr James Gibbons
Research Fellow
Division of Agricultural & Environmental Sciences
School of Biosciences
University of Nottingham
Sutton Bonington Campus
Loughborough
LE12 5RD
direct line: 0115 9516081
fax: 0115 9516060
e-mail: james.gibbons at nottingham.ac.uk
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
More information about the Coin-discuss
mailing list