help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] predefined execution time of glpk


From: Robbie Morrison
Subject: Re: [Help-glpk] predefined execution time of glpk
Date: Thu, 20 Jun 2013 05:11:46 +1200
User-agent: SquirrelMail/1.4.22

Hi Giorgio, all

Some more information regarding my earlier post
(see below).

Please see the start of these 2009 contributions:

  http://lists.gnu.org/archive/html/help-glpk/2009-09/msg00018.html
  http://lists.gnu.org/archive/html/bug-glpk/2009-09/msg00002.html

  The solver does not stop, because the time limit
  is checked at the beginning of the
  branch-and-bound loop, however, the dual simplex
  is cycling and does not return.

This behavior is based on an evidently
pathological problem and is probably not common
in practice.  The point is that 'tmlim' is a lower
bound and, in some cases, might not ever get
tripped.

If it is essential to enforce a time limit, you
can use various utilities on Linux to do so.
That only works at the process level tho:

  
http://stackoverflow.com/questions/2387485/limiting-the-time-a-program-runs-in-linux

HTH, Robbie

------------------------------------------------------------
To:          "GLPK help" <address@hidden>
Subject:      Re: [Help-glpk] predefined execution time of glpk
Message-ID:  <address@hidden>
From:        "Robbie Morrison" <address@hidden>
Date:         Wed, 19 Jun 2013 21:25:38 +1200
------------------------------------------------------------

> Hi John, Andrew, all
>
> ------------------------------------------------------------
> To:           john tass <address@hidden>
> Subject:      Re: [Help-glpk] predefined execution time of glpk
> Message-ID:  <address@hidden>
> From:         Andrew Makhorin <address@hidden>
> 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) : address@hidden
Webmail (preferred)           : address@hidden
[from Webmail client]





reply via email to

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