bug-glpk
[Top][All Lists]
Advanced

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

Re: [Bug-glpk] mip gap > 0 causes return code time limit exceeded


From: Stefan Vigerske
Subject: Re: [Bug-glpk] mip gap > 0 causes return code time limit exceeded
Date: Sat, 24 Nov 2007 17:44:51 +0300

Hi,

I wrote:
> However, as return code from lpx_intopt I get LPX_E_TMLIM (time limit
> exceeded), which I do not really understand. It is probably caused by
> the "ret = GLP_ETMLIM;" in glpios03.c line 1346.

What seem to work with glpk 4.24 is the following patch:
--- glpk/src/glpapi08.c 2007-11-21 10:00:00.000000000 +0100
+++ glpk.orig/src/glpapi08.c 2007-11-24 15:13:03.000000000 +0100
@@ -345,9 +345,15 @@
       switch (ret)
       {  case 0:
             if (tree->mip->mip_stat == GLP_FEAS)
-            {  if (parm->msg_lev >= GLP_MSG_ALL)
-                  xprintf("INTEGER OPTIMAL SOLUTION FOUND\n");
-               tree->mip->mip_stat = GLP_OPT;
+             { if (ios_relative_gap(tree) > 0) {
+                 if (parm->msg_lev >= GLP_MSG_ALL)
+                   xprintf("INTEGER FEASIBLE SOLUTION FOUND, GAP
SMALLER THAN TOLERANCE\n");
+                   tree->mip->mip_stat = GLP_FEAS;
+               } else {
+                 if (parm->msg_lev >= GLP_MSG_ALL)
+                   xprintf("INTEGER OPTIMAL SOLUTION FOUND\n");
+                   tree->mip->mip_stat = GLP_OPT;
+               }
             }
             else
             {  if (parm->msg_lev >= GLP_MSG_ALL)
diff -Naur glpk.OLD/src/glpios03.c glpk.patched/src/glpios03.c
--- glpk/src/glpios03.c 2007-11-21 10:00:00.000000000 +0100
+++ glpk.orig/src/glpios03.c 2007-11-24 15:13:09.000000000 +0100
@@ -1341,7 +1341,7 @@
          {  if (tree->parm->msg_lev >= GLP_MSG_DBG)
                xprintf("Relative gap tolerance reached; search terminat"
                   "ed\n");
-            ret = GLP_ETMLIM;
+            ret = 0;
             goto done;
          }
 #endif

Btw, LPX_K_BFTYPE, LPX_K_MIPGAP, and LPX_C_MIR haven't made it into the
parameter list of the glpk manual yet.
And GLP_MINOR_VERSION haven't got increased in glpk.h last time.

Best,
Stefan







reply via email to

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