Hello Anil,
I have had a look at file cvxopt-1.1.1/src/C/glpk.c. The functions (like
lpx_simplex) used to interface to GLPK have not been in the official API
for many releases. Please, contact the authors of cvxopt and ask them to
update the glpk interface. You can download glpk including documentation
form ftp://ftp.gnu.org/gnu/glpk/glpk-4.39.tar.gz. The API is documented
in doc/glpk.pdf.
If you want to use GLPK from Python, you might consider using
python-glpk available at http://www.dcc.fc.up.pt/~jpp/code/python-glpk/
<http://www.dcc.fc.up.pt/%7Ejpp/code/python-glpk/> which supports the
complete current GLPK API.
If you want to trace the simplex solution process you will remark that
the published API does not foresee this. You will have to dig into the C
coding of GLPK.
For tracing the branch and bound solution of mixed integer linear
programs you can use the callback functions provided.
Best regards
Xypron
Anil N. Hirani wrote:
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)
ITERATION LIMIT EXCEEDED; SEARCH TERMINATED
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.
Regards
Anil
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk