>>> I would like to know if there a possibility to make GLPK stop as
>>> soon as a feasible solution is found.
>> 
>> It is possible only on api level.

> I was indeed looking for a solution on API level.

> Do you mean I nedd to use the new callback mechanism ?

Yes, I do.

>  I thought there
> would be a way such as setting a control parameter (using 
> lpx_set_int_parm). I haven't found any in the documentation.

It would require too much control parameters, so using callback is
a more appropriate way.

> Can you tell me how to do this ?


void cb_func(glp_tree *tree, void *info)
{      if (glp_ios_reason(tree) == GLP_IBINGO)
         glp_ios_terminate(tree);
      return;
}

And somewhere in main():

glp_prob *mip;
glp_iocp parm;
. . .
glp_simplex(mip, NULL);
glp_init_iocp(&parm);
parm.cb_func = cb_func;
glp_intopt(mip, &parm);
. . .




_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to