[Cbc] Information about the LP relaxation inside CbcBranchDynamicDecision::betterBranch
john.forrest at fastercoin.com
Tue Jan 10 04:05:23 EST 2012
Solution changes because of stuff like strong branching.
Look at model()->testSolution()[idxVar]
On 07/01/12 14:12, Haroldo Gambini Santos wrote:
> 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/
> Cbc mailing list
> Cbc at list.coin-or.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cbc