0

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?

Jared Nielsen
  • 3,669
  • 9
  • 25
  • 36

1 Answers1

0

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.

Jared Nielsen
  • 3,669
  • 9
  • 25
  • 36