How can I disable the log output from GLPK solver in cvxopt?

621 Views Asked by At

Here's an example linear programming problem using cvxopt.

from cvxopt import matrix, solvers
import numpy as np

c = matrix(np.array([0] * m + [-1]).astype(float))
G = matrix(np.array(G_np).astype(float))
h = matrix(np.array([0] * (2*m)).astype(float).T)
A = matrix(np.array([1] * m + [0]).astype(float).reshape(1,m+1))
b = matrix(np.array([1]).astype(float))

sol = solvers.lp(c,G,h,A,b, solver="glpk")

The GLPK solver outputs numerous log messages. How can I turn these off?

1

There are 1 best solutions below

1
On BEST ANSWER

Set solvers.options['glpk'] = dict(msg_lev='GLP_MSG_OFF'). This is in addition to solvers.options['show_progress'] = False, which works for the other solvers.