help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] GLPK 4_23 internal error in call back


From: Andrew Makhorin
Subject: Re: [Help-glpk] GLPK 4_23 internal error in call back
Date: Sun, 11 Nov 2007 20:35:23 +0300

> I am using GLPK 4.23 for solving a MIP problem and using call back suggested
> by Andrew Makhorin to exit when the MIP gap is <= 5%

> ---------------------------------------------------
> void cb_func(glp_tree *tree, void *info) 
> {     if (glp_ios_reason(tree) == GLP_IBINGO) 
>       {  if (glp_ios_mip_gap(tree) < 0.10) 
>             glp_ios_terminate(tree); 
>       } 
>       . . . 
> } 

> int main(void) 
> {     glp_prob *mip; 
>       glp_iocp parm; 
>       . . . 
>       glp_init_iocp(&parm); 
>       parm.cb_func = cb_func; 
>       glp_intopt(mip, &parm); 
>       . . . 
> } 
> -------------------------------------------------------------------------------------

> The call back works fine upto certain point when I get the following error:

> GLPK internal error: lp->tree == NULL; file ..\src\glpapi01.c, line 1147

> I compiled the source using VS2005 and calling the API's in C#. If I don't
> use use call backs the program works fine. But I don't have control over the
> mip gap. Any suggestion will be appreciated.

> Sam
> -------------output-----------------------------------------
> 11:02:09 AM *  1341:   objval =  8.225886544e+002   infeas = 
> 5.280220705e-013 (0)
> 11:02:09 AM OPTIMAL SOLUTION FOUND
> 11:02:09 AM Integer optimization begins...
> Gap = 1.79769313486232E+308 Reason = 6
> Gap = 1.79769313486232E+308 Reason = 7
> 11:02:10 AM +  1341: mip =     not found yet >=              -inf        (1;
> 0)
> Gap = 1.79769313486232E+308 Reason = 1
> Gap = 1.79769313486232E+308 Reason = 3
> Gap = 1.79769313486232E+308 Reason = 4
> Gap = 1.79769313486232E+308 Reason = 5
> Gap = 1.79769313486232E+308 Reason = 7
> 11:02:13 AM +  1341: mip =     not found yet >=  8.225886544e+002        (2;
> 0)
> Gap = 1.79769313486232E+308 Reason = 1
> Gap = 1.79769313486232E+308 Reason = 3
> Gap = 1.79769313486232E+308 Reason = 4
> Gap = 1.79769313486232E+308 Reason = 5
> Gap = 1.79769313486232E+308 Reason = 7
> 11:02:17 AM +  1345: mip =     not found yet >=  8.225886544e+002        (3;
> 0)
> 11:02:17 AM GLPK internal error: lp->tree == NULL; file ..\src\glpapi01.c,
> line 1147


Looks like you call glp_delete_prob (directly or indirectly) in the
callback routine that is not allowed (there must be an error message
which is not implemented yet). The callback routine should only call
glp_ios_terminate and return, in which case glp_intopt will return
immediately with the code GLP_ESTOP.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]