[Top][All Lists]

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

[Help-glpk] Intermediate feasible "solutions" (suboptimal)

From: Anil N. Hirani
Subject: [Help-glpk] Intermediate feasible "solutions" (suboptimal)
Date: Fri, 2 Oct 2009 14:00:40 -0500

I am using GLPK in PYTHON via CVXOPT (which has an option to select solver as GLPK). I am using it to solve an LP. I'd like to print out the values of the variables in the problem as simplex progresses. In other words, I am interested in feasible but suboptimal intermediate "solutions".

Is there any way to achieve that without using the GLPK API in C. That is, is it possible to print the intermediate feasible "solutions" by passing some option to GLPK via CVXOPT ? I couldn't find anything relevant in the GLPK manual, CVXOPT manual or online.

I tried the following : I set the iteration limit. But such pre- optimal termination seems to be interpreted as a failure by GLPK. Here's what happens. The output of GLPK is :

      0: obj =   0.000000000e+00  infeas =  3.500e+01 (0)
    200: obj =   3.367050904e+00  infeas =  2.000e+01 (0)
*   294: obj =   8.833290070e+00  infeas =  0.000e+00 (0)
*   300: obj =   8.833290070e+00  infeas =  0.000e+00 (0)
glp_simplex: unable to recover undefined or non-optimal solution

Following the message printed by GLPK at the end (above), we find that it is coming from the function "simplex2" in file glpapi06.c of GLPK. The appropriate lines are :

      if (glp_get_status(prob) != GLP_OPT)
      {  if (parm->msg_lev >= GLP_MSG_ERR)
xprintf("glp_simplex: unable to recover undefined or non- op"
               "timal solution\n");

I suppose I could start modifying my local copy of GLPK to get what I want. But I am hoping for an easier solution.


reply via email to

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