Suppressing Output for GLPK MILPs

931 views
Skip to first unread message

kchong

unread,
Mar 16, 2011, 2:11:52 PM3/16/11
to CVXOPT
Apologies in advance if this turns out to be a stupid question.

I'm trying to solve a MILP, using the solver GLPK, and the function
call

sol = cvxopt.glpk.ilp(<parameters>)

And I'd like to suppress the output that GLPK generates. I've used the
command

>>> from cvxopt import solvers
>>> solvers.options['LPX_K_MSGLEV'] = 0

Mentioned on the page:

http://abel.ee.ucla.edu/cvxopt/userguide/coneprog.html#algorithm-parameters

But that doesn't seem to work if I'm not solving an LP. Variants on
the string 'LPX_K_MSGLEV' don't do the trick either. Is there
something that I'm missing?

Thanks, K

ydisser

unread,
Sep 16, 2011, 4:57:49 PM9/16/11
to cvx...@googlegroups.com
I have the exact same question.

I appreciate any hints.

Brian Zhang

unread,
Apr 28, 2014, 8:36:54 PM4/28/14
to cvx...@googlegroups.com, tigran...@gmail.com
I'm having this problem too and this didn't work for me. It seems like setting this option only works for solvers.lp(solver='glpk'). The settings don't affect glpk.ilp at all

On Monday, July 9, 2012 7:51:43 PM UTC-5, Tigran Saluev wrote:
Just for the future googlers like me:
it's about
cvxopt.solvers.options['show_progress'] = False

David Breuer

unread,
Aug 20, 2015, 11:12:34 AM8/20/15
to CVXOPT
Hi, here is a very late answer, but hopefully helpful for some people:

cvxopt.glpk.options['LPX_K_MSGLEV']=0


It works for me in combination with cvxopt.glpk.ilp.


Best, David



Stephane Caron

unread,
Sep 19, 2015, 7:42:40 AM9/19/15
to CVXOPT
Using both

    cvxopt.solvers.options['show_progress'] = False
    cvxopt.solvers.options['LPX_K_MSGLEV'] = 0

did not work for me.

A docstring in the source code in src/C/glpk.c points to another parameter:

    cvxopt.solvers.options['msg_lev'] = 'GLP_MSG_OFF'

This one works for me (cvxopt 1.1.7). Hope this helps.

Stephane

Raymond Wright

unread,
Aug 16, 2016, 7:18:46 AM8/16/16
to CVXOPT
For the sake of anyone who ever googles this, I was only able to get this to work for the ilp solver by using this with a small modification, namely

cvxopt.glpk.options['msg_lev'] = 'GLP_MSG_OFF'
Reply all
Reply to author
Forward
0 new messages