[Coin-discuss] feeding Symphony solutions on the fly
Ted Ralphs
tkralphs at lehigh.edu
Fri Jan 21 17:07:35 EST 2005
Mike,
I have added the ability for a user to apply primal heuristics and
generate solutions on the fly by adding an additional argument to the
callback function user_is_feasible(). Check the file
Template/LP/user_lp.c for the following function stub:
int user_is_feasible(void *user, double lpetol, int varnum,
int *indices, double *values, int *feasible,
double *objval, char branching,
double *heur_solution)
{
}
The relaxed solution is passed in sparse format, as before, through the
arrays arguments indices[] and values[]. If the relaxed solution is
found to be infeasible, it can be rounded or otherwise perturbed to
produce a new feasible solution. If such a solution is found, it can be
passed back to SYMPHONY in the array heur_solution[]. You also need to
set *objval to the value of the solution in this case, as well as setting
*feasible = IP_HEUR_FEASIBLE;
If you determine that the solution SYMPHONY passed is feasible as it is,
then simply set
*feasible = IP_FEASIBLE;
Even in this case, you can set the objective function value to the true
value if desired to account for roundoff error. Note that SYMPHONY has
two built-in primal heuristics (adapted from CBC) that can be run by
setting the parameter "do_primal_heuristic" to TRUE. If you do a CVS
update, you should see these changes. Note that this is not very well
tested yet. Please give it a try and let me know if you run into any
problems.
Cheers,
Ted
--
Dr. Ted Ralphs
Assistant Professor
Industrial and Systems Engineering
Lehigh University
(610)758-4784
tkralphs at lehigh.edu
www.lehigh.edu/~tkr2
"An optimist is someone who thinks
'It doesn't get any better than this.'
A pessimist is someone who's afraid that's true."
More information about the Coin-discuss
mailing list