help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Upper limit in B&B fase


From: Andrew Makhorin
Subject: Re: [Help-glpk] Upper limit in B&B fase
Date: Fri, 29 Nov 2002 16:34:18 +0300

>May i ask you where to change the source code to stop the b&b when it
>reaches a user defined upper limit? (i'm sorry, you already answered
>this question probably...)
>
>I need something like the LPX_K_OBJUL parameter but in the B&B fase.

You need to insert a fragment into the file glpmip1.c (glpk 3.2.3) as
follows (replacing <upper limit> by a valid floating-point expression):

963:     /* the search has been successfully completed */
964:     ret = MIP_E_OK;
965:     goto done;
966:  }
      /* check if an upper obj. limit has been reached */
      if (tree->found && tree->best[0] >= <upper limit>)
      {  ret = MIP_E_ITLIM;
         goto done;
      }
967:  /* check if the iterations limit has been exhausted */
968:  if (tree->it_lim == 0)
969:  {  ret = MIP_E_ITLIM;
970:     goto done;
971:  }

In this fragment the flag tree->found is non-zero if the b&b solver has
found any integer feasible solution, and tree->best[0] contains the
corresponding value of the objective function (which is unscaled and has
correct sign). Note that tree->best[0] is undefined if the flag
tree->found is zero.

The exit code used for this additional stopping criterion is the same
as if iterations limit were exhausted, so when you will see the message
"iterations limit exceeded; search terminated" you should understand it
as "upper obj. limit reached; search terminated".





reply via email to

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