sbernasek
sbernasek

Reputation: 23

GLPK LP solver called via cvxopt runs indefinitely

I'm using cvxopt.solvers.lp to solve a linear programs using the glpk solver. For the most part this works reliably, but every once in a while the solver seems to get stuck and run indefinitely. The attached LP is an example of such a case. If I make even slight tweaks to the LP, the solver runs fine. Likewise, if I change the solver to instead use conelp then a solution is quickly found. I am at a bit of a loss - does anyone have any idea why glpk is getting stuck on this particular problem? Is there some way to detect and rectify this issue in advance? Thank you.

LP formulation: https://drive.google.com/drive/folders/1iqpBx8x2AmUzktQss-CU3DRkN2YZ5MoS?usp=sharing

Example code:

import numpy as np

from cvxopt.solvers import lp
from cvxopt import matrix

# inequalities
c = np.load("lp/c.npy")
G = np.load("lp/G.npy")
h = np.load("lp/h.npy")
A = np.load("lp/A.npy")
b = np.load("lp/b.npy")

c = matrix(c)
G = matrix(G)
h = matrix(h)
A = matrix(A)
b = matrix(b)

# finds solution
lp(c=c, G=G, h=h, A=A, b=b, solver=None)

# runs indefinitely
lp(c=c, G=G, h=h, A=A, b=b, solver="glpk")

Upvotes: 0

Views: 20

Answers (0)

Related Questions