[Coin-discuss] Cbc - getting leaves values

Lou Hafer lou at cs.sfu.ca
Thu Jun 2 12:39:25 EDT 2005


Emilia,

	Good news and bad news, I'm afraid.
	
	The CbcTree class keeps a sorted vector of leaf nodes, which you can
scan using the [] operator. The objective value is kept in each node, and can
be accessed with the objectiveValue() method.

	The bad news is that the full solution is not stored with the node.  To
get this, you'll need to rebuild the subproblem, solve the relaxation, and get
the solution from the solver through the solver interface.  Not something to be
done casually.  See CbcModel.cpp around line 852 for an entry point to the code
that rebuilds a node.

	If you do this scan frequently, you may want to consider creating some
sort of cache with this information.  Alternatively, augment CbcNodeInfo to
incrementally track the primal or dual solution in the same way that it
maintains row and column cuts and basis.

	I'm just reacquainting myself with Cbc after a moderately long break,
so one of the other developers may have a better suggestion or point out 
something I've missed.

							Lou




More information about the Coin-discuss mailing list