[Cbc] Information about the LP relaxation inside CbcBranchDynamicDecision::betterBranch

Haroldo Gambini Santos haroldo.santos at gmail.com
Sat Jan 7 09:12:13 EST 2012


Hi,

I'm working to customize my branching rules using a the *betterBranch* 
method in a class derived from *CbcBranchDynamicDecision*.

This method has the following signature:
*betterBranch(CbcBranchingObject *thisOne,
       CbcBranchingObject *bestSoFar,
       double changeUp, int numInfUp,
       double changeDown, int numInfDown)
*
To decide which variable to branch I need to check:
   - fractional value which variables take in current LP solution;
   - variable names (some variables are more important than others and I 
can check this by looking at their names.

I think I succeed to check for their names with the following code:
*   OsiSolverInterface *lp = thisOne->model()->referenceSolver();
    CbcIntegerBranchingObject *ibo = 
dynamic_cast<CbcIntegerBranchingObject *> (thisOne);
    if (ibo)
    {
       int idxInt = ibo->variable();
       int idxVar = ibo->model()->integerVariable()[idxInt];
       // name is in lp->getColName(idxVar)
*
To check for the fractional value I though I could pick the value in:
*   lp->getColSolution()[idxVar]
*
But this value appears to be an integer value in many calls - I though 
that only fractional variables where considered for *thisOne* object.

Is this the correct way to get the fractional value of the variable ???

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20120107/eaeb49fd/attachment.html>


More information about the Cbc mailing list