[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] How to provide to the GLPK MIP solver a integer feasible
From: |
Raniere Silva |
Subject: |
Re: [Help-glpk] How to provide to the GLPK MIP solver a integer feasible solution |
Date: |
Mon, 8 Apr 2013 22:36:06 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi Giorgio,
> I have a model to which I can provide a initial feasible solution.
> How can I do that?
I do long time ago (about 3 years).
> Initially I tried with glp_read_mip:
I didn't use that. Hope that some one can help you with that.
> The second attempt was with the callback routine:
>
> void callback(glp_tree *tree, void *info){
> switch(glp_ios_reason(tree)) {
> case GLP_IHEUR: glp_ios_heur_sol(tree, initsol);break;
> default: break;
> }
> }
>
> where initsol was the integer feasible array solution. The code was:
> ...
> glp_iocp parm;
> glp_init_iocp(&parm);
> parm.cb_func = callback;
> glp_simplex(mip, NULL);
> glp_intopt(lp, &parm)
> ...
I used the callack function below:
void callback(glp_tree *tree, void *info){
if(glp_ios_reason(tree) == GLP_IHEUR && glp_ios_curr_node(tree) == 1){
glp_ios_heur_sol(tree, info);
} /* ----- end if ----- */
return ;
}
Raniere
- Re: [Help-glpk] How to provide to the GLPK MIP solver a integer feasible solution,
Raniere Silva <=