[Coin-discuss] Using CbcHeuristicFPump outside branch and cut

John J Forrest jjforre at us.ibm.com
Wed Apr 5 03:06:13 EDT 2006


James,

Using FPump should not slow it down.  When I try it is only used at the
root node with setWhen NOT being used.  This means when_ will be 1 and the
code at line 84 of CbcHeuristicFPump.cpp will return at once unless it is
at root node.

However you should be able to use it outside branchAndBound - I may get
time to look at it.

You are correct about documentation being wrong way round.

John Forrest




                                                                           
             "James Gibbons"                                               
             <James.Gibbons at no                                             
             ttingham.ac.uk>                                            To 
             Sent by:                  <coin-discuss at list.coin-or.org>     
             coin-discuss-boun                                          cc 
             ces at list.coin-or.                                             
             org                                                   Subject 
                                       [Coin-discuss] Using                
                                       CbcHeuristicFPump outside branch    
             04/04/06 09:37 AM         and cut                             
                                                                           
                                                                           
             Please respond to                                             
             Discussions about                                             
                open source                                                
               software for                                                
                Operations                                                 
                 Research                                                  
             <coin-discuss at lis                                             
              t.coin-or.org>                                               
                                                                           
                                                                           




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.


_______________________________________________
Coin-discuss mailing list
Coin-discuss at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-discuss





More information about the Coin-discuss mailing list