<br><font size=2 face="sans-serif">Fabrizio,</font>
<br>
<br><font size=2 face="sans-serif">Without seeing your heuristic code it
is difficult to say what is wrong. &nbsp;Look at the files CbcHeuristic*.cpp
in Cbc and Cbc/Samples to see which is closest to what you want. &nbsp;
For instance in CbcHeuristic.cpp in CbcRounding::solution you can see the
use of getColSolution. &nbsp;Two points: You need to set solutionValue
and betterSolution array and returncode of 1 to tell Cbc you think you
have a better solution. &nbsp;Also - yes it is obviously a good idea to
use current solution as otherwise you would just be doing same heuristic
at each node but you can cheat. &nbsp;A valid solution from ::solution
is one which does not violate the bounds at the continuous optimum - it
can violate bounds at the node in the tree. &nbsp;You can see different
uses in the various CbcHeuristic files - so you if you use current solver
you get current bounds and if you use continuousSolver you get original
bounds.</font>
<br>
<br><font size=2 face="sans-serif">As to fixing variables there are many
ways depending on exactly what you want to do. &nbsp;A CglFix cut generator
approach would work. &nbsp;CglProbing is far too complex but if you want
I could put up a simple example. &nbsp;You could also inherit from the
branching objects to do extra fixing. &nbsp;Another idea which has merit
is to make a specialized solver (e.g. as in Samples/qmip.cpp and ClpQuadInterface)
and fix variables before solving. &nbsp;This is probably too complex but
I will come back to it.</font>
<br>
<br><font size=2 face="sans-serif">I could easily add a new virtual function
to allow user to fix variables. &nbsp;This could be called before the solve
of a branch or after. &nbsp;If after it would act a bit like the reduced
cost fixing which is done after a branch. &nbsp;This would be a clean way
which would make it less intimidating to try.</font>
<br>
<br><font size=2 face="sans-serif">If you are fixing many variables and
are intending to do complete search then you might wish to go back to modifying
the solve. &nbsp;I have an example which does nested branch and cut so
if a lot of variables are fixed a branch makes a much smaller MIP and completely
fathoms it. &nbsp;Too much choice....</font>
<br>
<br><font size=2 face="sans-serif">To get best solution in a CglCut you
should make the CbcModel part of the data structure of your generator.
&nbsp;Then you could pick up model_-&gt;bestSolution();</font>
<br>
<br><font size=2 face="sans-serif">Please contact me if you want clarification
or sample code.</font>
<br>
<br><font size=2 face="sans-serif">John Forrest</font>