Hi Robbie,

please, look at glpk guide first.
If you are solving a MIP problem I suppose you are using glp_intopt instead
of glp_simplex.
In that case you have to set up a different parm struct whose name is
glp_iocp.

glp_iocp parm;
...
glp_init_iocp(&parm);
parm.tm_lim = 60000;
glp_intopt(MIP, &parm);
...

Best,

Gio


2013/6/19 Robbie Morrison <[email protected]>

>
> Hi John, Andrew, all
>
> ------------------------------------------------------------
> To:           john tass <[email protected]>
> Subject:      Re: [Help-glpk] predefined execution time of glpk
> Message-ID:  <1371545937.2157.5.camel@corvax>
> From:         Andrew Makhorin <[email protected]>
> Date:         Tue, 18 Jun 2013 12:58:57 +0400
> ------------------------------------------------------------
>
> >> Is it possible, within a C++ aplication, to
> >> predefine a time limit of gkpk execution , and
> >> after this time expires to be able of getting
> >> the best solution that glpk has found so far ?
> >> Is there any command I must include in my C++
> >> application? For your information, the linear
> >> problem I try to solve is extemely hard and has
> >> a very big size. So, I can not affort to wait
> >> for its solution but I want the best solution
> >> within 60 secs instead.
> >
> > #include <glpk.h>
> > glp_smcp parm;
> > . . .
> > glp_init_smcp(&parm);
> > parm.tm_lim = 60000;
> > glp_simplex(P, &parm);
> > . . .
> >
> > For more details please see the glpk reference manual (doc/glpk.pdf)
> > included in the distribution.
>
> Just to note, for completeness, that that works
> fine for simplex calls, but may not for MIP
> calls.  This is because the time limit condition
> is only checked when the linear relaxations are
> attempted.  In which case, call-backs might be
> required for finer-grain control?  Wasn't there a
> thread on this issue earlier (I looked but
> couldn't find it)?  Or am I totally confused and
> mistaken!
>
> cheers, Robbie
> ---
> Robbie Morrison
> PhD student -- policy-oriented energy system simulation
> Technical University of Berlin (TU-Berlin), Germany
> University email (redirected) : [email protected]
> Webmail (preferred)           : [email protected]
> [from Webmail client]
>
>
>
> _______________________________________________
> Help-glpk mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/help-glpk
>
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to